-
-
Notifications
You must be signed in to change notification settings - Fork 95
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
Better organise documentation #488
Comments
I appreciate the criticism, because it's warranted to an extent. That's why there is a search function in the docs though. About the docs in general:The problem is: How would one better organize the docs? Examples of docs in particular I don't find better than Nim docs:
Example of good docs:
Now, personally I don't know how to improve the situation without writing a custom doc generator and even if I wanted to do that I wouldn't know what to change. And note that there is always the index: https://mratsim.github.io/Arraymancer/theindex.html which you can also use for a broad overview + in browser searching for keywords (if for some reason the JS search box isn't helping). About high level / low levelArraymancer's docs are already quite different from the average Nim docs, with the header and all that. In principle the machinery is there to put arbitrary modules into arbitrary header tabs. This is all done here: https://github.com/mratsim/Arraymancer/blob/master/docs/docs.nim#L176-L287 and using the template from here: https://github.com/mratsim/Arraymancer/blob/master/docs/nimDocTemplates.nim#L113-L194 It would be pretty easy to have a separate tab for only low level stuff. And indeed that's kinda the idea behind the
Personally, I like that. I hate having to step through all sorts of trouble to find references / documentation to the backend parts. Just because they are not relevant to the average user, doesn't mean there shouldn't be docs for them. Could there be a better distinction as such in the docs? Certainly.
The doc generation mentioned above and in particular tutorial sections / module headers are all things that are easy to contribute to. So please feel free to help out if this is important to you. I've invested quite some nerves into the whole doc business already to attempt to make the generation smarter and to an extent to allow other people to contribute better. |
My documentation plan is to follow the outline of https://documentation.divio.com/
However, Nim doc is seriously lacking for this.
I tried to generate json as well as a workaround so that it could be consumed from other doc generators. I don't mind spending time to polish docs, see for example what I'm producing for work with auditors https://status-im.github.io/nimbus-eth2/auditors-book but Nim docgen is very unsuitable for large projects. To be clear, my ideal baseline for a documentation system would be:
Extras include:
|
I agree that nimdoc is... less than stellar. One thing I find particularly irritating (although perhaps just due to an object-oriented background) is that it lists all the types and then all the procedures working on those types, but they often aren't in any particular order. The
Could a workaround be to make a file which It sounds to me that what you really want would be nim integration with Sphinx. By default it still uses RST, although I think Markdown is an option (at the very least, it does support RST tables). It was written for Python but has plugins to support other languages. It shouldn't be too difficult to write an extension to support Nim constructs. The more difficult task would then be to write a program which would automatically generate the necessary Markdown or RST code to describe your library. You mention exporting docs into JSON, so if you have that then you're already part way there. I have some expertise with documentation generators (having written one for Fortran) so I could potentially help out with this. Edit: I see you've already raised that issue (nim-lang/needed-libraries#79). |
I know this would be a big job, but it would be really useful if the documentation could be organised better. Function documentation is organised by source file and it often is not self-evident in which file a given function would be written. Browsing through the sourcefiles exposes the user to some of the backend implementation. Furthermore, there is no clear distinction between low-level and high-level features within each module. Much of this criticism applies to Nim docs as a whole (I don't find the default tool is particularly good).
Relatedly, the tutorials section could probably use expansion and additional documentation could likely be given at the top of each file. Of course, I fully appreciate that this would be a lot of work (and generally less interesting than implementing new features).
The text was updated successfully, but these errors were encountered: