-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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: update conventions with repl examples and function (in|out)puts #280520
Conversation
b67e20e
to
22431b0
Compare
I do not think your changes address the issue I raised. I tried to express this once, but made mistakes. So here's the second try. In most places, there's a "headerless" style of documentation: e.g. There might be other styles, including headered ones. It's worth understanding which "local styles" are already in use. The To fix potential issues around misunderstanding of colloquialisms, note that "to ditch" means: I will stick to discard from now on for clarity. The convention as it stands now---even though a work in progress---has the potential to influence new PRs which choose to change existing Therefore:
|
@bzm3r
And I have already addressed in the PR that the headers are there for navigational purposes, and they don't force the content to be written in any specific way. Anyone can still write The need for headers is way less pronounced in the
The Rust documentation uses headers. I picked a random page there for Notably, the Rust documentation doesn't have an "Inputs" header because most of its functions don't have arguments with 10+ different attributes like dockerTools.buildImage, for example. Python's functions sometimes have a large number of arguments, and in my opinion it's a really bad experience to navigate their docs. Note that even then, they also have some similarities with the conventions in this PR, for example how they move examples to be the last part of each unit they're documenting: examples for regular expressions, examples for datetime.
Done.
As I wrote already, these are not conflicting things.
I believe I've already addressed that what you're calling a "headerless style" relates to the content of the documentation, not to its structure, and those are not conflicting things. As for selecting a convention, this is exactly what we're doing in the documentation team meetings. I find an opportunity to standardise something in the nixpkgs manual, then I bring it to the meeting, we discuss it there, and we decide on something. And that is then documented in a PR just like this one. The good thing about the structure of something is that it can easily be changed later (as opposed to the content, which is way harder). If we find out later that some other structure is better, we can quickly move to it. We might need to adapt some text in the process, but we won't need to completely change the content of the documentation. (and I already know this is inefficient and so on, all of this is already addressed in #278769 - I'm the one doing the work to bring consistency to the manuals, so I'll work this way, even though it seems inefficient, because it's what helps me make progress on the content as quickly as possible, which is ultimately what matters)
It should be up to whoever's writing the documentation to figure out what content goes where, and even whether they should stick to the convention or not. I can't predict all the possible content that goes in the manuals, but I do know that a good part of it documents utility functions, and those follow roughly the same documentation structure. Hence why a convention for following the same structure (if it makes sense, which is also to be determined by whoever's writing the documentation). I thought this was kind of implied in the conventions, but I'll update the PR to make it clear that the conventions are about keeping a consistent structure in the manuals.
This document does encourage people to use the conventions laid out in it. That's (also) why they're being documented. |
22431b0
to
e03040c
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-01-15-documentation-team-meeting-notes-104/38305/1 |
@DanielSidhion Okay: I will step out of your way then, and not raise further issues here on this point. If in the future I feel that that the Input/Output header style does not work well, I'll create a separate PR to address that.
Could you update the first post of this PR again with what was discussed in this documentation team meeting? |
doc/README.md
Outdated
- When documenting functions or anything that has inputs/outputs and example usage, use nested headings to clearly separate inputs, outputs, and examples. | ||
Keep examples as the last nested heading, and link to the examples wherever applicable in the documentation. | ||
|
||
The content of the nested headings is still up to the writer. |
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.
I feel like this is so obvious that we don't need to mention it
Though hopefully in the future the input attribute docs would be automatically generated by nixdoc ;)
e03040c
to
a731d0c
Compare
Reviewed in the docs team meeting, looking good! |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/2024-01-25-documentation-team-meeting-notes-106/38792/1 |
Description of changes
Closes #276829.
This PR adds two more items to the nixpkgs documentation conventions as discussed in the documentation meetings and PR reviews.
This is related to #278769, where I'm going through the nixpkgs manual to make it more consistent (and also update its content). I'm documenting the conventions I'm applying as I do this work in an effort to:
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.