Navigation Menu

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 automatic generation of library function documentation #53055

Merged
merged 1 commit into from Jan 4, 2019

Conversation

tazjin
Copy link
Member

@tazjin tazjin commented Dec 30, 2018

Important: Please also see #49275. Only one of these pull requests should be merged.

cc: @infinisil @grahamc


Modifies the build process of the manual to invoke nixdoc
automatically to generate XML files with function documentation.

Currently documentation is present for five of the files in lib/.

To add another file to the generated docs, both
doc/functions/library.xml and doc/lib-function-docs.nix must be
updated.

Modifies the build process of the manual to invoke nixdoc
automatically to generate XML files with function documentation.

Currently documentation is present for five of the files in `lib/`.

To add another file to the generated docs, both
`doc/functions/library.xml` and `doc/lib-function-docs.nix` must be
updated.
Copy link
Member

@infinisil infinisil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very much in favor of this approach. Having checked in the generated xml files wouldn't really serve any direct purpose, because they're neither nice to look at nor editable (as edits would get overridden).

@tazjin
Copy link
Member Author

tazjin commented Dec 31, 2018

One note about this: The path for overrides will not work with this version (at the moment). That requires a change in nixdoc.

Overrides are not actually in use yet though, so it does not matter much for now.

Copy link
Member

@FRidh FRidh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very good. I think we need to update the docstrings in attrsets a bit with the info that's currently in the xml, and then we can have that one generated as well.

@FRidh FRidh merged commit 0c99dac into NixOS:master Jan 4, 2019
@tazjin tazjin deleted the feat/automatic-lib-doc-generation branch January 4, 2019 11:51
@tazjin
Copy link
Member Author

tazjin commented Jan 4, 2019

I think we need to update the docstrings in attrsets a bit with the info that's currently in the xml, and then we can have that one generated as well.

Currently there is a little blocker for that, nixdoc does not yet support multiple examples in the markup and we haven't been able to agree on any format to use for it so far. I have a suggestion for how it could work in this issue, but it's not implemented yet.

As an alternative we have the override feature, where XML blobs can be dropped in to replace the documentation for a specific function - however, I can't figure out the syntax for multiple root-level elements in an override anymore. I'm sure this is something I tested with @grahamc at NixCon, so it does work - somehow. Going to have to dive into DocBook docs a little bit.

samueldr pushed a commit that referenced this pull request Feb 10, 2019
Since #53055 was merged the Makefile for the manual could not be run
correctly as the generated function documentation was included, but
not actually generated.

This adds the necessary generation step by first building the XML file
containing function locations and preserving its store path in a
variable, which is then used both for linking of the locations file
and as a build input for the function docs generator.

This fixes #55014
@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/sphinx-support-for-nix/4998/5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants