summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-06-09 21:18:01 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-06-09 21:18:01 +0200
commitfa1749d8d3cee6de3f5485b45378cad69d333acf (patch)
treec6190fb63b788494b984c266baf2ba3de5565daa /compiler
parent76c8d6164b10846f18dbd441e4d1db5d501da09d (diff)
downloadNim-fa1749d8d3cee6de3f5485b45378cad69d333acf.tar.gz
generated source code links also work when generated on Unix
Diffstat (limited to 'compiler')
-rw-r--r--compiler/docgen.nim7
1 files changed, 3 insertions, 4 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim
index 8555ec4f0..d954b897b 100644
--- a/compiler/docgen.nim
+++ b/compiler/docgen.nim
@@ -402,12 +402,11 @@ proc genItem(d: PDoc, n, nameNode: PNode, k: TSymKind) =
   var seeSrcRope: Rope = nil
   let docItemSeeSrc = getConfigVar("doc.item.seesrc")
   if docItemSeeSrc.len > 0 and options.docSeeSrcUrl.len > 0:
-    # XXX toFilename doesn't really work. We need to ensure that this keeps
-    # returning a relative path.
+    let path = n.info.toFilename.extractFilename.rope
     let urlRope = ropeFormatNamedVars(options.docSeeSrcUrl,
-      ["path", "line"], [n.info.toFilename.rope, rope($n.info.line)])
+      ["path", "line"], [path, rope($n.info.line)])
     dispA(seeSrcRope, "$1", "", [ropeFormatNamedVars(docItemSeeSrc,
-        ["path", "line", "url"], [n.info.toFilename.rope,
+        ["path", "line", "url"], [path,
         rope($n.info.line), urlRope])])
 
   add(d.section[k], ropeFormatNamedVars(getConfigVar("doc.item"),