summary refs log tree commit diff stats
path: root/tools/nimweb.nim
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2014-12-21 09:55:06 +0100
committerAndreas Rumpf <rumpf_a@web.de>2014-12-21 09:55:06 +0100
commit6a1ae0d616c328a4bf3794d59dedaac6ae08cc2d (patch)
treefc15feaa7e2989083972203709bce2bb169113ad /tools/nimweb.nim
parent18f00a1fa1d8a71c74340d7803a29af81d5f9860 (diff)
parentfda9da5f1eae5f1d6edaaf04aca0df54fa14c9ff (diff)
downloadNim-6a1ae0d616c328a4bf3794d59dedaac6ae08cc2d.tar.gz
Merge pull request #1748 from boydgreenfield/improved-doc-styling
Improved doc styling
Diffstat (limited to 'tools/nimweb.nim')
-rw-r--r--tools/nimweb.nim18
1 files changed, 10 insertions, 8 deletions
diff --git a/tools/nimweb.nim b/tools/nimweb.nim
index fa4f15995..d56b6aecf 100644
--- a/tools/nimweb.nim
+++ b/tools/nimweb.nim
@@ -19,6 +19,7 @@ type
     authors, projectName, projectTitle, logo, infile, outdir, ticker: string
     vars: StringTableRef
     nimArgs: string
+    gitRepo: string
     gitCommit: string
     quotations: Table[string, tuple[quote, author: string]]
     numProcessors: int # Set by parallelBuild:n, only works for values > 0.
@@ -46,6 +47,7 @@ proc initConfigData(c: var TConfigData) =
   c.logo = ""
   c.ticker = ""
   c.vars = newStringTable(modeStyleInsensitive)
+  c.gitRepo = "https://github.com/Araq/Nimrod/tree"
   c.gitCommit = "master"
   c.numProcessors = countProcessors()
   # Attempts to obtain the git current commit.
@@ -266,18 +268,18 @@ proc buildDoc(c: var TConfigData, destPath: string) =
     commands = newSeq[string](len(c.doc) + len(c.srcdoc) + len(c.srcdoc2))
     i = 0
   for d in items(c.doc):
-    commands[i] = "nim rst2html $# --docSeeSrcUrl:$# -o:$# --index:on $#" %
-      [c.nimArgs, c.gitCommit,
+    commands[i] = "nim rst2html $# --docSeeSrcUrl:$#/$#/$# -o:$# --index:on $#" %
+      [c.nimArgs, c.gitRepo, c.gitCommit, splitFile(d).dir,
       destPath / changeFileExt(splitFile(d).name, "html"), d]
     i.inc
   for d in items(c.srcdoc):
-    commands[i] = "nim doc $# --docSeeSrcUrl:$# -o:$# --index:on $#" %
-      [c.nimArgs, c.gitCommit,
+    commands[i] = "nim doc $# --docSeeSrcUrl:$#/$#/$# -o:$# --index:on $#" %
+      [c.nimArgs, c.gitRepo, c.gitCommit, splitFile(d).dir,
       destPath / changeFileExt(splitFile(d).name, "html"), d]
     i.inc
   for d in items(c.srcdoc2):
-    commands[i] = "nim doc2 $# --docSeeSrcUrl:$# -o:$# --index:on $#" %
-      [c.nimArgs, c.gitCommit,
+    commands[i] = "nim doc2 $# --docSeeSrcUrl:$#/$#/$# -o:$# --index:on $#" %
+      [c.nimArgs, c.gitRepo, c.gitCommit, splitFile(d).dir,
       destPath / changeFileExt(splitFile(d).name, "html"), d]
     i.inc
 
@@ -309,8 +311,8 @@ proc buildAddDoc(c: var TConfigData, destPath: string) =
   # build additional documentation (without the index):
   var commands = newSeq[string](c.webdoc.len)
   for i, doc in pairs(c.webdoc):
-    commands[i] = "nim doc $# --docSeeSrcUrl:$# -o:$# $#" %
-      [c.nimArgs, c.gitCommit,
+    commands[i] = "nim doc $# --docSeeSrcUrl:$#/$#/$# -o:$# $#" %
+      [c.nimArgs, c.gitRepo, c.gitCommit, splitFile(doc).dir,
       destPath / changeFileExt(splitFile(doc).name, "html"), doc]
   mexec(commands, c.numProcessors)