Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gnome-builder
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Günther Wagner
gnome-builder
Commits
5e7e0672
Commit
5e7e0672
authored
Mar 15, 2017
by
Sébastien Lafargue
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rst preview: fix include files not found
parent
a64af696
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
4 deletions
+14
-4
plugins/html-preview/html_preview_plugin/__init__.py
plugins/html-preview/html_preview_plugin/__init__.py
+14
-4
No files found.
plugins/html-preview/html_preview_plugin/__init__.py
View file @
5e7e0672
...
...
@@ -21,6 +21,7 @@
import
gi
import
os
import
locale
gi
.
require_version
(
'Gtk'
,
'3.0'
)
gi
.
require_version
(
'Ide'
,
'1.0'
)
...
...
@@ -34,6 +35,11 @@ from gi.repository import Ide
from
gi.repository
import
WebKit2
from
gi.repository
import
Peas
try
:
locale
.
setlocale
(
locale
.
LC_ALL
,
''
)
except
:
pass
can_preview_rst
=
True
try
:
...
...
@@ -185,11 +191,15 @@ class HtmlPreviewView(Ide.LayoutView):
</html>
"""
%
params
def
get_rst
(
self
,
text
):
return
publish_string
(
text
,
writer_name
=
'html5'
)
def
get_rst
(
self
,
text
,
path
):
return
publish_string
(
text
,
writer_name
=
'html5'
,
source_path
=
path
,
destination_path
=
path
)
def
reload
(
self
):
base_uri
=
self
.
document
.
get_file
().
get_file
().
get_uri
()
file
=
self
.
document
.
get_file
().
get_file
()
base_uri
=
file
.
get_uri
()
begin
,
end
=
self
.
document
.
get_bounds
()
text
=
self
.
document
.
get_text
(
begin
,
end
,
True
)
...
...
@@ -197,7 +207,7 @@ class HtmlPreviewView(Ide.LayoutView):
if
self
.
markdown
:
text
=
self
.
get_markdown
(
text
)
elif
self
.
rst
:
text
=
self
.
get_rst
(
text
).
decode
(
"utf-8"
)
text
=
self
.
get_rst
(
text
,
file
.
get_path
()
).
decode
(
"utf-8"
)
self
.
webview
.
load_html
(
text
,
base_uri
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment