Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add maindir nimdoc configuration item that points to the directory of theindex.html #19856

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from

Conversation

theamarin
Copy link

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.

…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.
@Araq
Copy link
Member

Araq commented Jun 1, 2022

Nice but please add a test case for this or patch an existing one.

@theamarin
Copy link
Author

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!

@Araq
Copy link
Member

Araq commented Jun 2, 2022

Look at nimdoc/testproject/expected for example. nimdoc/tester.nim is a special test program, not based on testament that can be tweaked further.

@theamarin
Copy link
Author

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.

Copy link
Contributor

github-actions bot commented May 2, 2024

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.

@github-actions github-actions bot added the stale Staled PR/issues; remove the label after fixing them label May 2, 2024
Copy link
Contributor

github-actions bot commented Jun 8, 2024

This pull request has been marked as stale and closed due to inactivity after 395 days.

@github-actions github-actions bot closed this Jun 8, 2024
@Araq Araq reopened this Jun 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Staled PR/issues; remove the label after fixing them
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants