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

Section headings from comments at top of files #19

Closed
tazjin opened this issue Oct 28, 2018 · 7 comments
Closed

Section headings from comments at top of files #19

tazjin opened this issue Oct 28, 2018 · 7 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@tazjin
Copy link
Contributor

tazjin commented Oct 28, 2018

Currently sections (i.e. the "groups" of functions, strings, lists etc.) generated by nixdoc don't have any descriptions other than what the user specifies on the CLI.

Some files (for example lib/debug.nix) have multi-line comments at the beginning that could be interpreted as section headings.

Implementation wise, the rnix parser will probably attach those as meta to the very first AST node which should be relatively easy to check for.

@tazjin tazjin added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Oct 28, 2018
@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/how-to-generate-documentation-from-arbitrary-nix-code/22292/8

@fricklerhandwerk fricklerhandwerk moved this from Agenda to Open in Nix documentation Oct 27, 2022
@olafklingt olafklingt moved this to TODO Infrastructure in Nix documentation Mar 12, 2023
@infinisil infinisil moved this from Topic: Infrastructure to ⚖ To Discuss in Nix documentation Apr 4, 2023
@fricklerhandwerk
Copy link
Contributor

@zmitchell is interested to pick this up

@tazjin
Copy link
Contributor Author

tazjin commented Apr 6, 2023

Note that before adding any complex features like this depending on parser output, the parser should be upgraded. nixdoc is using a very old version of rnix, and the API has nothing to do with the current one anymore - the longer that isn't done, the harder it will be eventually if more things are built on the old API.

@zmitchell
Copy link

Right, is that what's happening here? #36

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/2023-04-06-documentation-team-meeting-notes-39/27048/1

@phaer
Copy link
Member

phaer commented Aug 31, 2023

I ran to this and pushed a quick implementation to #70 . It's naive w.r.t to white-space handling and passes the string on without parsing or so, so once currently looses the section headings. On the plus side it's a trivial implementation.

@infinisil
Copy link
Collaborator

This is now implemented with #70!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

6 participants