1
0
Fork 0
mirror of https://github.com/NixOS/nix.dev.git synced 2024-10-18 14:32:43 -04:00

Update with review comments

This commit is contained in:
Zach Mitchell 2023-08-09 22:31:16 -06:00
parent a096fdce5c
commit 35c1df9789

View file

@ -10,42 +10,58 @@ If you cannot contribute time, consider [donating to the NixOS Foundation's docu
## Documentation framework
We aim to build our documentation according to the [Diataxis][diataxis] framework, which divides documentation into four categories:
[diataxis]: https://diataxis.fr
- Reference
- How-to
- Explanation
- Tutorial
We've found that contributors struggle to know the difference between these categories, while we _strongly_ recommend reading up on the Diataxis framework, we can summarize it in this way:
We've found that contributors struggle to understand the differences between these categories, and while we _strongly_ recommend reading up on the Diataxis framework, we can summarize them as follows:
- Reference
- Reference matieral includes technical documentation, API documentation, etc.
- Reference material includes technical documentation, API documentation, etc.
- Reference material should be relatively terse, simply listing which functions/classes/etc exist, but should still clearly define how to use the code and how it relates to the rest of the ecosystem.
- Reference material should focus on "what's out there", with the text and layout optimized for scanning and random access.
- Reference material should be supplemented with examples.
- How-to (we call these "Recipes")
- A recipe is a list of steps to achieve a specific goal.
- The goal is not to show how or why something works, but instead to show how to solve a specific problem.
- A Recipe assumes that the reader already has the background to understand the topic at hand and therefore doesn't need to explain the introduction of each new concept.
- Recipes are a list of steps showing how to achieve a specific goal or solve a specific problem.
- The goal is to help the reader reach a specific end, not understand the theory or greater context.
- A recipe assumes that the reader already has the background to understand the topic at hand and therefore doesn't need to explain the introduction of each new concept.
- Explanation (we call these "Concepts")
- A Concept describes the internals of a piece of code or how to think about a particular concept or entity in the ecosystem.
- A Concept can also describe the historical context behind why something works the way that it does today.
- If you find yourself wanting to write about the nitty gritty details of how something works, you most likely want to write an Explanation.
- Concepts describe the internals of a piece of code or how to think about a particular idea or entity in the ecosystem.
- A concept can also describe the historical context behind why something works the way that it does today.
- If you find yourself wanting to write about the nitty gritty details of how something works, you most likely want to write an explanation.
- Tutorial
- A tutorial walks the user through a particular activity to help give them muscle memory with accepted tools and patterns in the ecosystem.
- Tutorials walk the user through a particular activity to help give them muscle memory with accepted tools and patterns in the ecosystem.
- While the activity itself is important, the goal is to get the reader familiar with the patterns and tools in the ecosystem.
We also find that people struggle with the difference between a How-to/Recipe and a Tutorial.
One analogy is landing an airplane.
A person landing a plane for the first time to avoid a crash landing needs a Recipe for how to land the plane, they don't need to know any history or theory, they just need to get the plane on the ground in one piece.
The documentation they would refer to in this context should simply be a sequence of steps saying "do this, now do that, and, finally, do this last thing."
An airline pilot in a simulator would refer to a tutorial to walk them through landing an airplane.
In this context it's fine if the plane crashes, it's just a simulation.
What's more important is that the airline pilot learns how to land the plane by being clearly walked through the process.
### Recipe vs. tutorial
We find that contributors primarily struggle with the difference between a How-to/Recipe and a Tutorial.
Here are several explanations to help you understand the difference.
- A recipe is used in a "working" context where the reader just wants a sequence of instructions to achieve an outcome.
- In this context the reader may already know or may not care how or why these instructions work, they just want to know what to do in order to achieve the desired result.
- A tutorial is used in a "learning" context where the reader is following a sequence of instructions to gain practice performing a certain task.
- Some small bits of motivation or explanation are helpful in this context to help a reader connect the dots with other things they may have already learned or, but the focus is not on _how_ or _why_.
A helpful analogy is landing an airplane in two different contexts.
Let's say the pilot is unconscious and you now have to land the plane to avoid a crash landing.
In this context you just want to know how not to die.
You don't care about how or why, you just want to be on the ground in one piece.
This is the context for a recipe.
A pilot training in a flight simulator wants to practice landing the plane.
The pilot-in-training needs practice knowing when to deploy the landing gear, when to adjust flaps, etc.
Actually landing the plane during the flight simulation is less important than learning the individual skills that make up a successful landing.
This is the context for a tutorial.
Finally, one last way of thinking about the difference between How-to/Recipe and Tutorial is like this:
- Recipe: "step 1: do this, step 2: do that, etc"
- Tutorial: "take my hand as I show you how to do this"
[diataxis]: https://diataxis.fr
## Reference manuals
The manuals for [Nix][nix manual] ([source][nix manual src]), [Nixpkgs][Nixpkgs manual] ([source][nixpkgs manual src]), and [NixOS][NixOS manual] ([source][nixos manual src]) are purely reference documentation, specifying interfaces and behavior.