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

doc: dedocbookify nixpkgs manual #239636

Merged
merged 15 commits into from
Jul 3, 2023
Merged

doc: dedocbookify nixpkgs manual #239636

merged 15 commits into from
Jul 3, 2023

Conversation

pennae
Copy link
Contributor

@pennae pennae commented Jun 24, 2023

Description of changes

extend nixos-render-docs with the minal missing features needed to render the nixpkgs manual, and migrate the nixpkgs manual over. this also removes a lot of support infrastructure and the ability to build the manual in a nix shell since the build now takes all of five seconds when started from scratch. keeping the shell+makefile combo alive adds more complexity than it's worth at that kind of speed, and impure manual builds are a bit of a trap anyway.

the manual is almost completely identical except for a few heading level changes, element id changes, and nixdoc function reordering. nixdoc should probably sort its output at some point, but today is not that day.

drafted because the nixdoc update included here reference a not-yet-merged PR.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added the 8.has: documentation This PR adds or changes documentation label Jun 24, 2023
@ofborg ofborg bot requested a review from asymmetric June 24, 2023 20:54
@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/2023-06-26-documentation-team-meeting-notes-58/29666/1

@pennae pennae marked this pull request as ready for review July 1, 2023 14:00
pennae added 3 commits July 1, 2023 17:31
docbook always emits intra-file links if only a single file is emitted.
it doesn't seem to do this for intra-file links when multiple files are
emitted, so we don't do that yet either.
there's not point in rendering these if we're rendering to a single file
for all content.
the nixpkgs manual uses section tocs for eg the nixpkgs library function
reference. we will only not emit tocs for subsections at this point, but
maybe we should consider doing so in the future.
doc/default.nix Outdated Show resolved Hide resolved
doc/default.nix Outdated Show resolved Hide resolved
doc/default.nix Outdated Show resolved Hide resolved
doc/manual.md Outdated Show resolved Hide resolved
doc/functions/library.md Outdated Show resolved Hide resolved
Copy link
Member

Choose a reason for hiding this comment

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

Some of these are still used by nixos-search. Can we remove them now @ncfavier, or should we wait?

Copy link
Member

Choose a reason for hiding this comment

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

Yeah, nixos-search uses this file. I guess it should be moved into the nixos-search tree before we remove it here

@pennae
Copy link
Contributor Author

pennae commented Jul 1, 2023

this should have addressed all comments so far :)

pennae added 5 commits July 1, 2023 20:27
this is only used in the stdenv chapter, but footnotes could be useful
in other places as well. since markdown-it has a plugin to parse
footnote syntax we may as well just support them even if they're rare.
mostly to clean up the main manual build makefile and derivation a bit.
not technically necessary, but will make life easier later.
nothing except function docs uses this, so we need not expose it. we'll
be reworking this entire section of the build anyway, with the target of
breaking up doc-support as it is now.
@pennae
Copy link
Contributor Author

pennae commented Jul 1, 2023

nixdoc got a release for improved markdown output, no more unstable for that :)

pennae added 4 commits July 1, 2023 20:59
also updates nixdoc to 2.3.0. the nixdoc update is not a separate commit
because that would leave the manual build broken for one commit,
potentially breaking bisects and rebases.
all xml-related tooling can go away. shell.nix is no longer useful since
the makefile is gone and the build runs entirely via a derivation, and
gitignore is thus also no longer that useful. it may filter out some
swap files, but its main reason to exist (keeping generated files out of
a concurrent build of the derivation) has gone away.
this leaves doc-support as a simple wrapper around function docs. this
wrapper will go away very soon as well.
separating function docs out like this makes it less clear how library
documentation is generated and integrated into the build. if in the
future more parts of nixpkgs use nixdoc it will make sense to have all
information about library doc generation in the same place.
@pennae
Copy link
Contributor Author

pennae commented Jul 1, 2023

ope, had left the old nixdoc homepage url by mistake. should point to the nix-community repo now instead.

@fricklerhandwerk
Copy link
Contributor

Reviewed together with @pennae and @asymmetric. This looks very good and we can still fix up details as we go.

@pennae
Copy link
Contributor Author

pennae commented Jul 3, 2023

@ncfavier can you take care of moving the files nixos-search needs? would like to merge soon before divergences happen and we have to redo the xml-to-md bit again.

@ncfavier
Copy link
Member

ncfavier commented Jul 3, 2023

Done

@pennae pennae merged commit 06140b7 into NixOS:master Jul 3, 2023
@pennae pennae deleted the nixpkgs-manual-nrd branch July 3, 2023 18:48
@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/2023-07-03-documentation-team-meeting-notes-60/29983/1

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/tables-or-html-in-nixpkgs-manual/29989/4

asymmetric added a commit to asymmetric/nixpkgs that referenced this pull request Jul 25, 2023
We have moved away from Make since nixos-render-docs was introduced to
build the nixpkgs manual in NixOS#239636.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

6 participants