summary refs log tree commit diff stats
path: root/compiler/docgen.nim
diff options
context:
space:
mode:
authorKaushal Modi <kaushal.modi@gmail.com>2019-05-25 14:20:25 -0400
committerAndreas Rumpf <rumpf_a@web.de>2019-05-25 20:20:25 +0200
commit2f610d621f52fe83863c19ac65f7e1336bce838d (patch)
tree28c4fb2e037a92589f1b3505c0168ade870c4d96 /compiler/docgen.nim
parent6a94599d66484396b4e080e5bb8c1aa8e8f129af (diff)
downloadNim-2f610d621f52fe83863c19ac65f7e1336bce838d.tar.gz
Use the correct HTML file reference in "nim doc" generated idx files (#11326)
* Use the correct HTML file reference in "nim doc" generated idx files

Now "nim doc --out:foo.html --index:on bar.nim" generates "foo.html"
and the generated "bar.idx" contains references to "foo.html".

Fixes https://github.com/nim-lang/Nim/issues/11325.

* Refactor the nim doc tester to extend it for more tests

* Reference the HTML files relative to the outDir, not project dir

* Add test for issues #11312 and #11325

- https://github.com/nim-lang/Nim/issues/11312
- https://github.com/nim-lang/Nim/issues/11325

Diffstat (limited to 'compiler/docgen.nim')
-rw-r--r--compiler/docgen.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/docgen.nim b/compiler/docgen.nim
index bfd09895a..f5762ca4d 100644
--- a/compiler/docgen.nim
+++ b/compiler/docgen.nim
@@ -670,7 +670,7 @@ proc genItem(d: PDoc, n, nameNode: PNode, k: TSymKind) =
     [nameRope, result, comm, itemIDRope, plainNameRope, plainSymbolRope,
       symbolOrIdRope, plainSymbolEncRope, symbolOrIdEncRope, seeSrcRope]))
 
-  let external = AbsoluteFile(d.filename).relativeTo(d.conf.projectPath, '/').changeFileExt(HtmlExt).string
+  let external = AbsoluteFile(d.destFile).relativeTo(d.conf.outDir, '/').changeFileExt(HtmlExt).string
 
   var attype: Rope
   if k in routineKinds and nameNode.kind == nkSym: