diff options
author | Nick Greenfield <boyd.greenfield@gmail.com> | 2014-12-19 21:56:12 -0500 |
---|---|---|
committer | Nick Greenfield <boyd.greenfield@gmail.com> | 2014-12-19 21:56:12 -0500 |
commit | fda9da5f1eae5f1d6edaaf04aca0df54fa14c9ff (patch) | |
tree | 14d3fd02f37f68b26531e7937bb5e6d2a70aa7dc /tools | |
parent | fb93cee95de2300f863057efdf163e2413177c3d (diff) | |
download | Nim-fda9da5f1eae5f1d6edaaf04aca0df54fa14c9ff.tar.gz |
Update nimweb.nim to work w/ non-hardcoded --docSeeSrcUrl argument to nim doc
Diffstat (limited to 'tools')
-rw-r--r-- | tools/nimweb.nim | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/tools/nimweb.nim b/tools/nimweb.nim index c4dc8226d..1d02149ab 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. @@ -44,6 +45,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. @@ -263,18 +265,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 @@ -306,8 +308,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) |