Nim
Nim copied to clipboard
Add `maindir` nimdoc configuration item that points to the directory of theindex.html
This is done to support global links in the documentation's menu in the nimdoc.cfg as follows:
<ul class="simple-boot">
<li><a href="$maindir/index.html">Index</a></li>
<li><a href="$maindir/mydoc.html">My documentation</a></li>
<li><a href="$theindexhref">Generated index</a></li>
</ul>
Using this $maindir configuration item, one might even get rid of the $theindexhref and use $maindir/theindex.html instead.
Nice but please add a test case for this or patch an existing one.
Hi @Araq, thank you very much for your quick response! Please note I am still quite new to Nim so I would be happy to get some pointers here.
I would be happy to add a corresponding test, but could not find a valuable examples on how to craft it.
Could you please give me a hint how to test this specific feature?
The existing tests in tests/nimdoc/* appear to merely check language features but do not give me a clue on how to check on resulting nimdoc configuration.
Maybe it is worth to move the code to derive maindir into a separate function that can be tested separately?
Does it need to be public (*) so I can call it from a test?
Thank you!
Look at nimdoc/testproject/expected for example. nimdoc/tester.nim is a special test program, not based on testament that can be tweaked further.
I now use the following entry in nimdoc.cfg to point to "my module", which also works with nested projects, i.e., from other modules within subdirectories:
<li><a href="$theindexhref/../mymodule.html">My Module</a></li>
This is maybe a bit hacky but avoids the proposed patch.
This pull request is stale because it has been open for 1 year with no activity. Contribute more commits on the pull request and rebase it on the latest devel, or it will be closed in 30 days. Thank you for your contributions.
This pull request has been marked as stale and closed due to inactivity after 395 days.