Skip to content

Commit

Permalink
make documentation generator tests green again
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq committed Sep 13, 2018
1 parent 7d9c5be commit 9b29436
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -45,7 +45,7 @@ xcuserdata/

# Generated files.
/compile.json
/compiler/nimrod.dot
/compiler/nim.dot
/reject.json
/run.json
# for `nim doc foo.nim`
Expand Down
2 changes: 1 addition & 1 deletion nimdoc/tester.nim
Expand Up @@ -14,7 +14,7 @@ proc test(dir: string; fixup = false) =
quit("FAILURE: nim buildIndex failed")

for expected in walkDirRec(dir / "expected/"):
let produced = expected.replace("/expected/", "/htmldocs/")
let produced = expected.replace('\\', '/').replace("/expected/", "/htmldocs/")
if not fileExists(produced):
echo "FAILURE: files not found: ", produced
inc failures
Expand Down
6 changes: 4 additions & 2 deletions nimdoc/testproject/expected/subdir/subdir_b/utils.html
Expand Up @@ -1242,7 +1242,8 @@ <h1 class="title">Module utils</h1>
<a class="reference reference-toplevel" href="#7" id="57">Types</a>
<ul class="simple simple-toc-section">
<li><a class="reference" href="#SomeType"
title="SomeType = int"><wbr />Some<wbr />Type<span class="attachedType" style="visibility:hidden"></span></a></li>
title="SomeType = enum
enumValueA, enumValueB, enumValueC"><wbr />Some<wbr />Type<span class="attachedType" style="visibility:hidden"></span></a></li>

</ul>
</li>
Expand All @@ -1264,7 +1265,8 @@ <h1 class="title">Module utils</h1>
<div class="section" id="7">
<h1><a class="toc-backref" href="#7">Types</a></h1>
<dl class="item">
<dt id="SomeType"><a name="SomeType"></a><pre><a href="utils.html#SomeType"><span class="Identifier">SomeType</span></a> <span class="Other">=</span> <span class="Identifier">int</span></pre></dt>
<dt id="SomeType"><a name="SomeType"></a><pre><a href="utils.html#SomeType"><span class="Identifier">SomeType</span></a> <span class="Other">=</span> <span class="Keyword">enum</span>
<span class="Identifier">enumValueA</span><span class="Other">,</span> <span class="Identifier">enumValueB</span><span class="Other">,</span> <span class="Identifier">enumValueC</span></pre></dt>
<dd>


Expand Down
7 changes: 5 additions & 2 deletions nimdoc/testproject/expected/testproject.html
Expand Up @@ -1276,8 +1276,11 @@ <h1 class="title">Module testproject</h1>
<div id="tocRoot"></div>
<p class="module-desc">This is the top level module.
<p><strong class="examples_text">Examples:</strong></p>
<pre class="listing"><span class="Identifier">doAssert</span> <span class="Identifier">bar</span><span class="Other">(</span><span class="DecNumber">3</span><span class="Other">,</span> <span class="DecNumber">4</span><span class="Other">)</span> <span class="Operator">==</span> <span class="DecNumber">7</span>
<span class="Identifier">foo</span><span class="Other">(</span><span class="DecNumber">1</span><span class="Other">,</span> <span class="DecNumber">2</span><span class="Other">)</span></pre></p>
<pre class="listing"><span class="Keyword">import</span>
<span class="Identifier">subdir</span> <span class="Operator">/</span> <span class="Identifier">subdir_b</span> <span class="Operator">/</span> <span class="Identifier">utils</span>

<span class="Identifier">doAssert</span> <span class="Identifier">bar</span><span class="Other">(</span><span class="DecNumber">3</span><span class="Other">,</span> <span class="DecNumber">4</span><span class="Other">)</span> <span class="Operator">==</span> <span class="DecNumber">7</span>
<span class="Identifier">foo</span><span class="Other">(</span><span class="Identifier">enumValueA</span><span class="Other">,</span> <span class="Identifier">enumValueB</span><span class="Other">)</span></pre></p>
<div class="section" id="6">
<h1><a class="toc-backref" href="#6">Imports</a></h1>
<dl class="item">
Expand Down

0 comments on commit 9b29436

Please sign in to comment.