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

nim doc for a multi-module library too complicated #9444

Closed
jabbalaci opened this issue Oct 19, 2018 · 11 comments
Closed

nim doc for a multi-module library too complicated #9444

jabbalaci opened this issue Oct 19, 2018 · 11 comments
Labels
Documentation Generation Related to documentation generation (but not content).

Comments

@jabbalaci
Copy link

Summary

If you have a multi-module library, then generating the docs for the modules + creating a theindex.html file that has all the exported things from every module is not that easy. nim doc should have an option to generate everything for a multi-module library.

Description

I figured out what commands are needed to achieve this goal. I put together a sample multi-module library, see here: https://github.com/jabbalaci/NimMultiModuleLibrary . In the README I explain the necessary steps.

@kaushalmodi
Copy link
Contributor

Related: #9392

@narimiran narimiran added the Documentation Content Related to documentation content (not generation). label Oct 19, 2018
@haltcase
Copy link
Contributor

Isn't this what nim doc --project is for? It's only recently been added though.

@krux02
Copy link
Contributor

krux02 commented Oct 20, 2018

I feel sorry now. I was not aware of this feature yet. The commend line documentation of nim really needs to be improved, because I did not find it there.

@jabbalaci
Copy link
Author

Isn't this what nim doc --project is for? It's only recently been added though.

I tried it in my sample project:

$ nim doc --project src/stuff.nim

It produces src/htmldocs/stuff.html, nothing else. No .idx files, no theindex.html.

@krux02
Copy link
Contributor

krux02 commented Oct 20, 2018

In my opinion, nim doc should by default be recursive and generate as much documentation as possible. Generating the documentation of just one single file is really a very specific use case, it should not be in the base API.

@krux02 krux02 changed the title Generating docs for a multi-module library nim doc for a multi-module library too complicated Oct 20, 2018
@krux02 krux02 added Documentation Generation Related to documentation generation (but not content). and removed Documentation Content Related to documentation content (not generation). labels Oct 20, 2018
@timotheecour
Copy link
Member

It produces src/htmldocs/stuff.html, nothing else. No .idx files, no theindex.html.

see also --index:on flag (cf: #9392)

@jabbalaci
Copy link
Author

see also --index:on flag (cf: #9392)

nim doc --project --index:on src/stuff.nim produces src/htmldocs/stuff.html and src/htmldocs/stuff.idx . The submodules in src/stuff/*.nim are left untouched. No theindex.html is generated.

Actually, what does --project do? Running nim doc --index:on src/stuff.nim I get the same things: an .html and an .idx file. The only difference is the location of the produced files. The .idx file is put in src/htmldocs, while the .html file is next to the source file.

@jabbalaci
Copy link
Author

In addition, it'd be nice to generate links to the source code too. I couldn't make nim doc --docSeeSrcUrl work. If someone has an example, please share it.

@timotheecour
Copy link
Member

timotheecour commented Oct 21, 2018

i had added in #8423 git.commit and git.url flag, see use in travis.yaml; needs to be documented (see "for future PR" in that PR)
eg:

--git.commit:devel --git.url:https://github.com/nim-lang/Nim

see also: #6071 (comment)

now that #8423 was merged, we can close this after changing all references of --docSeeSrcUrl to --git.url and --git.commit

@Araq
Copy link
Member

Araq commented Jan 13, 2019

This is all now supported, check out the nimdoc/tester project setup.

@Araq Araq closed this as completed Jan 13, 2019
@FedericoCeratto
Copy link
Member

Related: #11074

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Generation Related to documentation generation (but not content).
Projects
None yet
Development

No branches or pull requests

8 participants