diff options
author | Araq <rumpf_a@web.de> | 2018-10-31 00:19:24 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2018-10-31 00:19:24 +0100 |
commit | 48f73aaa1cc4228e5ba58f471c5f66116c9e59ad (patch) | |
tree | 2deaebc816cac430ff774172bb38860c4175001b /nimdoc | |
parent | 8f28be0dd8b0519ed98e62f1f66f5fb17c0c96bc (diff) | |
download | Nim-48f73aaa1cc4228e5ba58f471c5f66116c9e59ad.tar.gz |
docgen: fixes #9432 [backport]
Diffstat (limited to 'nimdoc')
-rw-r--r-- | nimdoc/testproject/expected/subdir/subdir_b/utils.html | 27 | ||||
-rw-r--r-- | nimdoc/testproject/expected/testproject.html | 58 | ||||
-rw-r--r-- | nimdoc/testproject/expected/theindex.html | 26 | ||||
-rw-r--r-- | nimdoc/testproject/subdir/subdir_b/utils.nim | 16 | ||||
-rw-r--r-- | nimdoc/testproject/testproject.nim | 6 |
5 files changed, 132 insertions, 1 deletions
diff --git a/nimdoc/testproject/expected/subdir/subdir_b/utils.html b/nimdoc/testproject/expected/subdir/subdir_b/utils.html index e7f9cd508..60050d8ae 100644 --- a/nimdoc/testproject/expected/subdir/subdir_b/utils.html +++ b/nimdoc/testproject/expected/subdir/subdir_b/utils.html @@ -1255,6 +1255,16 @@ function main() { </ul> </li> +<li> + <a class="reference reference-toplevel" href="#18" id="68">Templates</a> + <ul class="simple simple-toc-section"> + <li><a class="reference" href="#aEnum.t%2C" + title="aEnum(): untyped"><wbr />a<wbr />Enum<span class="attachedType" style="visibility:hidden"></span></a></li> + <li><a class="reference" href="#bEnum.t%2C" + title="bEnum(): untyped"><wbr />b<wbr />Enum<span class="attachedType" style="visibility:hidden"></span></a></li> + + </ul> +</li> </ul> @@ -1285,6 +1295,23 @@ constructor. </dd> </dl></div> +<div class="section" id="18"> +<h1><a class="toc-backref" href="#18">Templates</a></h1> +<dl class="item"> +<a id="aEnum.t,"></a> +<dt><pre><span class="Keyword">template</span> <span class="Identifier">aEnum</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">untyped</span></pre></dt> +<dd> + + +</dd> +<a id="bEnum.t,"></a> +<dt><pre><span class="Keyword">template</span> <span class="Identifier">bEnum</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">untyped</span></pre></dt> +<dd> + + +</dd> + +</dl></div> </div> </div> diff --git a/nimdoc/testproject/expected/testproject.html b/nimdoc/testproject/expected/testproject.html index 1d09d809c..83de0d894 100644 --- a/nimdoc/testproject/expected/testproject.html +++ b/nimdoc/testproject/expected/testproject.html @@ -1245,6 +1245,18 @@ function main() { </ul> </li> <li> + <a class="reference reference-toplevel" href="#7" id="57">Types</a> + <ul class="simple simple-toc-section"> + <li><a class="reference" href="#A" + title="A {.inject.} = enum + aA"><wbr />A<span class="attachedType" style="visibility:hidden"></span></a></li> + <li><a class="reference" href="#B" + title="B {.inject.} = enum + bB"><wbr />B<span class="attachedType" style="visibility:hidden"></span></a></li> + + </ul> +</li> +<li> <a class="reference reference-toplevel" href="#8" id="58">Vars</a> <ul class="simple simple-toc-section"> <li><a class="reference" href="#aVariable" @@ -1257,6 +1269,16 @@ function main() { <ul class="simple simple-toc-section"> <li><a class="reference" href="#bar%2CT%2CT" title="bar[T](a, b: T): T"><wbr />bar<span class="attachedType" style="visibility:hidden"></span></a></li> + <li><a class="reference" href="#isValid%2CT" + title="isValid[T](x: T): bool"><wbr />is<wbr />Valid<span class="attachedType" style="visibility:hidden"></span></a></li> + + </ul> +</li> +<li> + <a class="reference reference-toplevel" href="#13" id="63">Funcs</a> + <ul class="simple simple-toc-section"> + <li><a class="reference" href="#someFunc%2C" + title="someFunc()"><wbr />some<wbr />Func<span class="attachedType" style="visibility:hidden"></span></a></li> </ul> </li> @@ -1294,6 +1316,25 @@ function main() { <dl class="item"> <a class="reference external" href="subdir/subdir_b/utils.html">subdir/subdir_b/utils</a> </dl></div> +<div class="section" id="7"> +<h1><a class="toc-backref" href="#7">Types</a></h1> +<dl class="item"> +<a id="A"></a> +<dt><pre><a href="testproject.html#A"><span class="Identifier">A</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">inject</span></span><span class="Other">.}</span></span> <span class="Other">=</span> <span class="Keyword">enum</span> + <span class="Identifier">aA</span></pre></dt> +<dd> +The enum A. + +</dd> +<a id="B"></a> +<dt><pre><a href="testproject.html#B"><span class="Identifier">B</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">inject</span></span><span class="Other">.}</span></span> <span class="Other">=</span> <span class="Keyword">enum</span> + <span class="Identifier">bB</span></pre></dt> +<dd> +The enum B. + +</dd> + +</dl></div> <div class="section" id="8"> <h1><a class="toc-backref" href="#8">Vars</a></h1> <dl class="item"> @@ -1314,6 +1355,23 @@ function main() { </dd> +<a id="isValid,T"></a> +<dt><pre><span class="Keyword">proc</span> <span class="Identifier">isValid</span><span class="Other">[</span><span class="Identifier">T</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">x</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">bool</span></pre></dt> +<dd> + + +</dd> + +</dl></div> +<div class="section" id="13"> +<h1><a class="toc-backref" href="#13">Funcs</a></h1> +<dl class="item"> +<a id="someFunc,"></a> +<dt><pre><span class="Keyword">func</span> <span class="Identifier">someFunc</span><span class="Other">(</span><span class="Other">)</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt> +<dd> +My someFunc. + +</dd> </dl></div> <div class="section" id="17"> diff --git a/nimdoc/testproject/expected/theindex.html b/nimdoc/testproject/expected/theindex.html index 865e5a28e..652077be8 100644 --- a/nimdoc/testproject/expected/theindex.html +++ b/nimdoc/testproject/expected/theindex.html @@ -1221,16 +1221,32 @@ function main() { <div class="container"> <h1 class="title">Index</h1> Modules: <a href="subdir/subdir_b/utils.html">subdir/subdir_b/utils</a>, <a href="testproject.html">testproject</a>.<br/><p /><h2>API symbols</h2> -<dl><dt><a name="aVariable" href="#aVariable"><span>aVariable:</span></a></dt><dd><ul class="simple"> +<dl><dt><a name="A" href="#A"><span>A:</span></a></dt><dd><ul class="simple"> +<li><a class="reference external" + data-doc-search-tag="testproject: A" href="testproject.html#A">testproject: A</a></li> + </ul></dd> +<dt><a name="aEnum" href="#aEnum"><span>aEnum:</span></a></dt><dd><ul class="simple"> +<li><a class="reference external" + data-doc-search-tag="utils: aEnum(): untyped" href="subdir/subdir_b/utils.html#aEnum.t%2C">utils: aEnum(): untyped</a></li> + </ul></dd> +<dt><a name="aVariable" href="#aVariable"><span>aVariable:</span></a></dt><dd><ul class="simple"> <li><a class="reference external" data-doc-search-tag="testproject: aVariable" href="testproject.html#aVariable">testproject: aVariable</a></li> </ul></dd> +<dt><a name="B" href="#B"><span>B:</span></a></dt><dd><ul class="simple"> +<li><a class="reference external" + data-doc-search-tag="testproject: B" href="testproject.html#B">testproject: B</a></li> + </ul></dd> <dt><a name="bar" href="#bar"><span>bar:</span></a></dt><dd><ul class="simple"> <li><a class="reference external" data-doc-search-tag="testproject: bar[T](a, b: T): T" href="testproject.html#bar%2CT%2CT">testproject: bar[T](a, b: T): T</a></li> <li><a class="reference external" data-doc-search-tag="testproject: bar(): untyped" href="testproject.html#bar.m%2C">testproject: bar(): untyped</a></li> </ul></dd> +<dt><a name="bEnum" href="#bEnum"><span>bEnum:</span></a></dt><dd><ul class="simple"> +<li><a class="reference external" + data-doc-search-tag="utils: bEnum(): untyped" href="subdir/subdir_b/utils.html#bEnum.t%2C">utils: bEnum(): untyped</a></li> + </ul></dd> <dt><a name="enumValueA" href="#enumValueA"><span>enumValueA:</span></a></dt><dd><ul class="simple"> <li><a class="reference external" data-doc-search-tag="SomeType.enumValueA" href="subdir/subdir_b/utils.html#enumValueA">SomeType.enumValueA</a></li> @@ -1247,6 +1263,14 @@ function main() { <li><a class="reference external" data-doc-search-tag="testproject: foo(a, b: SomeType)" href="testproject.html#foo.t%2CSomeType%2CSomeType">testproject: foo(a, b: SomeType)</a></li> </ul></dd> +<dt><a name="isValid" href="#isValid"><span>isValid:</span></a></dt><dd><ul class="simple"> +<li><a class="reference external" + data-doc-search-tag="testproject: isValid[T](x: T): bool" href="testproject.html#isValid%2CT">testproject: isValid[T](x: T): bool</a></li> + </ul></dd> +<dt><a name="someFunc" href="#someFunc"><span>someFunc:</span></a></dt><dd><ul class="simple"> +<li><a class="reference external" + data-doc-search-tag="testproject: someFunc()" href="testproject.html#someFunc%2C">testproject: someFunc()</a></li> + </ul></dd> <dt><a name="SomeType" href="#SomeType"><span>SomeType:</span></a></dt><dd><ul class="simple"> <li><a class="reference external" data-doc-search-tag="utils: SomeType" href="subdir/subdir_b/utils.html#SomeType">utils: SomeType</a></li> diff --git a/nimdoc/testproject/subdir/subdir_b/utils.nim b/nimdoc/testproject/subdir/subdir_b/utils.nim index d7d82b3cd..e2ec80dc2 100644 --- a/nimdoc/testproject/subdir/subdir_b/utils.nim +++ b/nimdoc/testproject/subdir/subdir_b/utils.nim @@ -8,3 +8,19 @@ type proc someType*(): SomeType = ## constructor. SomeType(2) + +# bug #9235 + +template aEnum*(): untyped = + type + A* {.inject.} = enum ## The enum A. + aA + +template bEnum*(): untyped = + type + B* {.inject.} = enum ## The enum B. + bB + + func someFunc*() = + ## My someFunc. + discard diff --git a/nimdoc/testproject/testproject.nim b/nimdoc/testproject/testproject.nim index 327466014..d6fac4751 100644 --- a/nimdoc/testproject/testproject.nim +++ b/nimdoc/testproject/testproject.nim @@ -22,3 +22,9 @@ macro bar*(): untyped = result = newStmtList() var aVariable*: array[1,int] + +aEnum() +bEnum() + +# bug #9432 +proc isValid*[T](x: T): bool = x.len > 0 |