[gobject-introspection: 15/30] devdocs: Mark links to other GIRs as such

commit 916c626a4e17f356eaa5b73b9e67aaaab310e212
Author: Philip Chimento <philip chimento gmail com>
Date:   Sat Dec 12 16:14:07 2015 -0800

    devdocs: Mark links to other GIRs as such
    DevDocs will try to normalize links relative to the current documentation
    if it can, and strips ../ off the front, so e.g. a link on the
    gio20/gio.file page to ../gobject20/gobject.object will end up resolving
    to http://<host>/gio20/gobject20/gobject.object, which doesn't exist.
    We clearly mark links to other GIRs with a gir:// URL scheme that DevDocs
    won't process automatically, and then fill in the links ourselves in the
    DevDocs scraper.

 giscanner/docwriter.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/giscanner/docwriter.py b/giscanner/docwriter.py
index f5389cd9..d79b3fc7 100644
--- a/giscanner/docwriter.py
+++ b/giscanner/docwriter.py
@@ -1164,11 +1164,11 @@ class DevDocsFormatterGjs(DocFormatterGjs):
         ns = node.namespace
         slug = ns.name.lower() + str(ns.version).replace('.', '')
         if not self.should_render_node(node):
-            target = '../%s/%s' % (slug, make_page_id(node.parent))
+            target = 'gir:///%s/%s' % (slug, make_page_id(node.parent))
             return self._write_xref_markdown(target, self.make_anchor(node),
-        target = '../%s/%s' % (slug, make_page_id(node))
+        target = 'gir:///%s/%s' % (slug, make_page_id(node))
         return self._write_xref_markdown(target, None,

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]