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

refactor rendering documentation of options #7379

Merged

Conversation

fricklerhandwerk
Copy link
Contributor

this makes more obvious what the code produces, and the structure of the
output easier to change

this makes more obvious what the code produces, and the structure of the
output easier to change
Copy link
Member

@thufschmitt thufschmitt left a comment

Choose a reason for hiding this comment

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

LGTM, just one small rendering issue in the man page that should be fixed

let
inherit (optionsInfo.${name}) description documentDefault defaultValue aliases;
result = squash ''
- [`${name}`]{#conf-${name}}
Copy link
Member

Choose a reason for hiding this comment

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

We didn't use this kind of anchors because it doesn't render properly in the man page renderer

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Eh. lowdown is very minimal.

Copy link
Contributor Author

@fricklerhandwerk fricklerhandwerk Dec 7, 2022

Choose a reason for hiding this comment

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

@thufschmitt the same problem appears for nix-build (7708a34) and nix-store (a793863).

I feel an aversion to working around lacking tools and would prefer improving the tools, even if that's more expensive in the short term.

Anyways, fixed it by ugly workaround, for now.

Copy link
Member

Choose a reason for hiding this comment

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

I feel an aversion to working around lacking tools and would prefer improving the tools, even if that's more expensive in the short term.

Yeah, I agree on the principle. But I also wouldn't want to touch that myself 😛

Now I wonder whether we could just accept that the man pages are somewhat broken and live with it…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I always felt that the man pages were a substantial asset of Nix documentation, due to the fact that Nix is one of the tools that is highly capable of working offline. We should tend to it, but it is expensive indeed.

Copy link
Member

Choose a reason for hiding this comment

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

The offline aspect is very important indeed. But the help pages (nix --help and friends) are not man pages and already provide most of these benefits. So maybe we should capitalize on that instead.

(Just to be clear: that maybe is a real maybe, not a rhetoric construct. I don't know what the best solution is)

Copy link
Contributor Author

@fricklerhandwerk fricklerhandwerk Dec 8, 2022

Choose a reason for hiding this comment

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

nix --help and man nix don't differ much technically except that the first one has fancy colors and apparently can't yet display information on nix.conf and other specific topics. Both are rendered by lowdown from the same sources.

Copy link
Member

Choose a reason for hiding this comment

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

Oh indeed, I was somehow convinced that it was using something else than lowdown. Sorry for the confusion then.

this avoids incorrect rendering on the man pages, since `lowdown`
neither parses the anchor syntax nor HTML.

this should rather be fixed in lowdown, as adding more anchors
would otherwise produce ever more noise and error-prone repetition.
this is a follow-up on e7dcacb.

most links are relative and this should not be too much of a detriment.
@thufschmitt thufschmitt merged commit 1dd7779 into NixOS:master Dec 8, 2022
@fricklerhandwerk fricklerhandwerk deleted the refactor-generate-options branch October 9, 2023 21:16
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.

2 participants