-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
init support for doc-comments #91
init support for doc-comments #91
Conversation
Nice! We should definitely wait for the RFC to be accepted, which should be pretty soon. After that I'm generally in favor of merging it, but we definitely need tests, documentation and a changelog entry for this. |
c0fc25c
to
7ca1b1f
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-01-04-documentation-team-meeting-notes-102/37754/1 |
88e466d
to
490ed95
Compare
Co-authored-by: Shahar Dawn Or <mightyiampresence@gmail.com>
490ed95
to
574ebed
Compare
@infinisil could i ask you for some review & suggestions? |
Nice, I've been eagerly awaiting a ping for it to be ready :D. I can't get to it immediately, but I'll take a close look when I get to it! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looking really good!
I'd like to see some extra tests:
-
One to make sure that the headings get indented properly
-
One to make sure omitting a doc comment from an attribute doesn't duplicate the previous one:
{ /** Comment */ foo = 0; # This should not have any docs bar = 1; }
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-02-15-documentation-team-meeting-notes-109/39826/1 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/tweag-nix-dev-update-54/39990/1 |
21bfc3b
to
629f1f7
Compare
@infinisil. Just worked your feedback in. |
c0eafe0
to
72742d1
Compare
@infinisil to keep you updated. Features such as #98 make more sense on nix value level. Unfortunately the comments are not part of the c++nix ast which requires invoking an addtional (e.g. rnix based) tool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some minor bits now
I just bootstrapped a cli tool https://github.com/hsjobeki/flutsch. Which in combination with a static analysis tool could replace nixdoc entirely.
Nice! I generally don't mind archiving nixdoc if there's something better. Though I definitely can't say I'm a fan of C++ 😅
72742d1
to
4b4ae1b
Compare
Yes. C++ is horrible. Then using a static rust/rnix based tool on top of that (introspection information) to generate the markdown docs. |
Co-authored-by: Silvan Mosberger <github@infinisil.com>
4b4ae1b
to
37ad8cd
Compare
@infinisil
Adds support for doc-comments. (see: NixOS/rfcs#145)
onetwo levels, so the nixpkgs manual rendering still works.Doesn't discover new items, it just renders, what was rendered before. (e.g. lib.lists.map keeps name and section heading)
But If the content is a new doc-comment (surrounded by
/** */
) then it doesn't perform the 'nixdoc' rendering withExample:
andType:
sections. Instead the section headings are written in explicit markdown by the user/documentation writer.All section headings are automatically shifted down two levels. (Means you can and should currently write H1 to H4 in your doc comments)
This is certainly a limitation, to resolve this we need to change the nixpkgs manual rendering tool (nixos_render_docs) which could be one of the next steps.
Moved some rust functions into separate files. Having everything in main.rs makes it hard to maintain two separate feature sets.
legacy.rs
format.rs
test.rs
Version 3.0.0
This PR bumps the version to 3.0.0