added docgen.rst2html for the forum; fixed tester bug concerning removeDir
This commit is contained in:
parent
38eafd30ae
commit
96e7ee91cc
4 changed files with 63 additions and 3 deletions
|
|
@ -881,3 +881,57 @@ proc CommandRst2TeX =
|
||||||
splitter = "\\-"
|
splitter = "\\-"
|
||||||
CommandRstAux(gProjectFull, TexExt)
|
CommandRstAux(gProjectFull, TexExt)
|
||||||
|
|
||||||
|
# ---------- forum ---------------------------------------------------------
|
||||||
|
|
||||||
|
proc setupConfig*() =
|
||||||
|
setConfigVar("split.item.toc", "20")
|
||||||
|
setConfigVar("doc.section", """
|
||||||
|
<div class="section" id="$sectionID">
|
||||||
|
<h1><a class="toc-backref" href="#$sectionTitleID">$sectionTitle</a></h1>
|
||||||
|
<dl class="item">
|
||||||
|
$content
|
||||||
|
</dl></div>
|
||||||
|
""")
|
||||||
|
setConfigVar("doc.section.toc", """
|
||||||
|
<li>
|
||||||
|
<a class="reference" href="#$sectionID" id="$sectionTitleID">$sectionTitle</a>
|
||||||
|
<ul class="simple">
|
||||||
|
$content
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
""")
|
||||||
|
setConfigVar("doc.item", """
|
||||||
|
<dt id="$itemID"><pre>$header</pre></dt>
|
||||||
|
<dd>
|
||||||
|
$desc
|
||||||
|
</dd>
|
||||||
|
""")
|
||||||
|
setConfigVar("doc.item.toc", """
|
||||||
|
<li><a class="reference" href="#$itemID">$name</a></li>
|
||||||
|
""")
|
||||||
|
setConfigVar("doc.toc", """
|
||||||
|
<div class="navigation" id="navigation">
|
||||||
|
<ul class="simple">
|
||||||
|
$content
|
||||||
|
</ul>
|
||||||
|
</div>""")
|
||||||
|
setConfigVar("doc.body_toc", """
|
||||||
|
$tableofcontents
|
||||||
|
<div class="content" id="content">
|
||||||
|
$moduledesc
|
||||||
|
$content
|
||||||
|
</div>
|
||||||
|
""")
|
||||||
|
setConfigVar("doc.body_no_toc", "$moduledesc $content")
|
||||||
|
setConfigVar("doc.file", "$content")
|
||||||
|
|
||||||
|
proc rstToHtml*(s: string): string =
|
||||||
|
## exported for *nimforum*.
|
||||||
|
const filen = "input"
|
||||||
|
var d = newDocumentor(filen)
|
||||||
|
var dummyHasToc = false
|
||||||
|
var rst = rstParse(s, false, filen, 0, 1, dummyHasToc)
|
||||||
|
d.modDesc = renderRstToOut(d, rst)
|
||||||
|
let res = genOutFile(d)
|
||||||
|
result = res.ropeToStr
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
# This is the config file for the documentation generator.
|
# This is the config file for the documentation generator.
|
||||||
# (c) 2011 Andreas Rumpf
|
# (c) 2012 Andreas Rumpf
|
||||||
# Feel free to edit the templates as you need.
|
# Feel free to edit the templates as you need.
|
||||||
|
|
||||||
split.item.toc = "20"
|
split.item.toc = "20"
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# This is the config file for the documentation generator that produces TeX
|
# This is the config file for the documentation generator that produces TeX
|
||||||
# output.
|
# output.
|
||||||
# (c) 2011 Andreas Rumpf
|
# (c) 2012 Andreas Rumpf
|
||||||
# Feel free to edit the templates as you need.
|
# Feel free to edit the templates as you need.
|
||||||
|
|
||||||
split.item.toc = "20"
|
split.item.toc = "20"
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,13 @@
|
||||||
const
|
const
|
||||||
rodfilesDir = "tests/rodfiles"
|
rodfilesDir = "tests/rodfiles"
|
||||||
|
|
||||||
proc delNimCache() = removeDir(rodfilesDir / "nimcache")
|
proc delNimCache() =
|
||||||
|
let dir = rodfilesDir / "nimcache"
|
||||||
|
try:
|
||||||
|
removeDir(dir)
|
||||||
|
except EOS:
|
||||||
|
echo "[Warning] could not delete: ", dir
|
||||||
|
|
||||||
proc plusCache(options: string): string = return options & " --symbolFiles:on"
|
proc plusCache(options: string): string = return options & " --symbolFiles:on"
|
||||||
|
|
||||||
proc runRodFiles(r: var TResults, options: string) =
|
proc runRodFiles(r: var TResults, options: string) =
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue