Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGonzalo Odiard <godiard@gmail.com>2013-11-12 16:18:28 (GMT)
committer Gonzalo Odiard <godiard@gmail.com>2013-11-12 16:18:28 (GMT)
commit34f08dd420a28ca7515bdd9ccdec6cd263e69837 (patch)
treeabe32cf0af57b8a0f2fc4ef06565bad1c28053a5
parentefb8cd2046de0546ee48dccbfb77612cfe20cd5e (diff)
Implement view source callback to show the rst source
Signed-off-by: Gonzalo Odiard <gonzalo@laptop.org>
-rwxr-xr-xhelpactivity.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/helpactivity.py b/helpactivity.py
index 487084c..ee56003 100755
--- a/helpactivity.py
+++ b/helpactivity.py
@@ -105,6 +105,16 @@ class HelpActivity(activity.Activity):
self._web_view.show()
self._web_view.load_uri(HOME)
+ def get_document_path(self, async_cb, async_err_cb):
+ html_uri = self._web_view.get_uri()
+ rst_path = html_uri.replace('file:///', '/')
+ rst_path = rst_path.replace('html/', 'source/')
+ rst_path = rst_path.replace('.html', '.rst')
+ tmp_path = os.path.join(activity.get_activity_root(), 'instance',
+ 'source.rst')
+ os.symlink(rst_path, tmp_path)
+ async_cb(tmp_path)
+
class Toolbar(Gtk.Toolbar):
def __init__(self, web_view):