-
-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
treewide: Fix AST of Nix in all markdown files #299554
treewide: Fix AST of Nix in all markdown files #299554
Conversation
This should help us with highlighting and future formatting.
This allows for correct highlighting and maybe future automatic formatting. The AST was verified to work with nixfmt only.
Since I mentioned this multiple times in the description: This is what the manual would look like if we nixfmt'ed it: helsinki-systems@8c506ddd8436 |
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.
Nice! You may want to note in the commit message why we're using angle brackets there.
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.
Neat! Thank you for doing this. Do you have anything documented on how you did this? I'm assuming you built a tool to do this work. Is it available anywhere? I'd like to add this as part of the documentation team's toolset.
We use angle brackets since they look a lot like a placeholder while also being valid nix code, as suggested by roberth here: NixOS#299554 (comment)
7b6a05e
to
96075d9
Compare
Changed the commit message that @fricklerhandwerk suggested and also linked Robert's comment there. @DanielSidhion partly. I wrote a script that finds the issues, the fixing of the 600+ issues was a manual process. The script does not exist anymore because it has since grown into a full utility to analyze the nix formatting in markdown files and to automatically fix it if needed. I plan to upstream this along a full reformat (see #299554 (comment)) and a GitHub workflow that ensures that people don't accidentially break it again :) |
impressive work! Cool ! |
Description of changes
This PR does 2 things:
The end-goal of this PR is to make the ASTs parsable by the formatter to get RFC-166 into the manual. This is important since the manual is likely to be one of the first contact points of new users and also a place where code is likely to be copied from. This might also make the code compliant with other parsers as well, allowing for future functionality like checking for renamed options.
As outlined above, this does not reformat the code with nixfmt (yet). This is the preparation to do such things in the future. There are however a lot of manual reformats to make the code look "normal" (like when adding
{}
around something that has to be indented now).I am also aware that there are other places where documentation can be found, which are not in .md files. There's
toPretty
and the examples from the manual but the PR is probably big enough as-is.Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 馃憤 reaction to pull requests you find important.