Skip to content

Commit

Permalink
tests on inclusion of .rst & .nim into .nim
Browse files Browse the repository at this point in the history
  • Loading branch information
a-mr committed Sep 1, 2021
1 parent 75c9995 commit a6a07b9
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
25 changes: 24 additions & 1 deletion nimdoc/testproject/expected/subdir/subdir_b/utils.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ <h1 class="title">subdir/subdir_b/utils</h1>
<li><a class="reference" href="#fn10%2Cint"
title="fn10(a: int): int">fn10(a: int): int</a></li>

</ul>
<ul class="simple nested-toc-section">funWithGenerics
<li><a class="reference" href="#funWithGenerics%2CT%2CU"
title="funWithGenerics[T, U: SomeFloat](a: T; b: U)">funWithGenerics[T, U: SomeFloat](a: T; b: U)</a></li>

</ul>
<ul class="simple nested-toc-section">someType
<li><a class="reference" href="#someType_2"
Expand Down Expand Up @@ -256,7 +261,13 @@ <h1 class="title">subdir/subdir_b/utils</h1>
<div class="nine columns" id="content">
<div id="tocRoot"></div>

<p class="module-desc">
<p class="module-desc"><p>This is a description of the utils module.</p>
<p>Links work:</p>
<ul class="simple"><li>other module: <a class="reference external" href="iterator.html">iterators</a> (not in this dir, just an example)</li>
<li>internal: <a class="reference internal nimdoc" title="proc fn2(x: int)" href="#fn2,int">fn2(x)</a></li>
<li>internal included from another module: <a class="reference internal nimdoc" title="proc funWithGenerics[T, U: SomeFloat](a: T; b: U)" href="#funWithGenerics,T,U">funWithGenerics*[T, U: SomeFloat](a: T, b: U)</a>.</li>
</ul>

<h1><a class="toc-backref" id="this-is-now-a-header" href="#this-is-now-a-header">This is now a header</a></h1>
<h2><a class="toc-backref" id="this-is-now-a-header-next-header" href="#this-is-now-a-header-next-header">Next header</a></h2>
<h3><a class="toc-backref" id="next-header-and-so-on" href="#next-header-and-so-on">And so on</a></h3>
Expand Down Expand Up @@ -526,6 +537,18 @@ <h1><a class="toc-backref" href="#12">Procs</a></h1>

comment

</dd>
</div>

</div>

<div id="funWithGenerics-procs-all">
<div id="funWithGenerics,T,U">
<dt><pre><span class="Keyword">proc</span> <a href="#funWithGenerics%2CT%2CU"><span class="Identifier">funWithGenerics</span></a><span class="Other">[</span><span class="Identifier">T</span><span class="Other">,</span> <span class="Identifier">U</span><span class="Other">:</span> <span class="Identifier">SomeFloat</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">a</span><span class="Other">:</span> <span class="Identifier">T</span><span class="Other">;</span> <span class="Identifier">b</span><span class="Other">:</span> <span class="Identifier">U</span><span class="Other">)</span></pre></dt>
<dd>



</dd>
</div>

Expand Down
4 changes: 4 additions & 0 deletions nimdoc/testproject/subdir/subdir_b/utils.nim
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
##[
.. include:: ./utils_overview.rst
# This is now a header
## Next header
Expand Down Expand Up @@ -34,6 +36,8 @@ Ref. type like G_ and `type G`_ and `G[T]`_ and `type G*[T]`_.
]##

include ./utils_helpers

type
SomeType* = enum
enumValueA,
Expand Down
1 change: 1 addition & 0 deletions nimdoc/testproject/subdir/subdir_b/utils_helpers.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
proc funWithGenerics*[T, U: SomeFloat](a: T, b: U) = discard
8 changes: 8 additions & 0 deletions nimdoc/testproject/subdir/subdir_b/utils_overview.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
This is a description of the utils module.

Links work:

* other module: `iterators <iterator.html>`_ (not in this dir, just an example)
* internal: `fn2(x)`_
* internal included from another module: `funWithGenerics*[T, U:
SomeFloat](a: T, b: U)`_.

0 comments on commit a6a07b9

Please sign in to comment.