|
| 1 | +# Documentation philosophy |
| 2 | + |
| 3 | +:::{seealso} |
| 4 | +We recommend reading these resources: |
| 5 | + |
| 6 | +- [Diátaxis] |
| 7 | +- [Write the docs' Software documentation guide] |
| 8 | + - [Write the docs' Documentation principles] |
| 9 | +::: |
| 10 | + |
| 11 | +## User profiles |
| 12 | + |
| 13 | +Documentation sources are in the <source:docs> folder |
| 14 | +and separated into 4 main parts: |
| 15 | + |
| 16 | +<source:docs/ioc> |
| 17 | +: for documentation related to IOC development |
| 18 | + |
| 19 | +<source:docs/pkgs> |
| 20 | +: for documentation on using packages on any Linux distribution |
| 21 | + |
| 22 | +<source:docs/nixos-services> |
| 23 | +: for documentation related to NixOS administration |
| 24 | + |
| 25 | +<source:docs/development> |
| 26 | +: for documentation related to internal EPNix development |
| 27 | + |
| 28 | +Anything that isn't specific to these parts |
| 29 | +is in the main {file}`docs` folder. |
| 30 | + |
| 31 | +This separation tries to match the profiles of EPNix users: |
| 32 | + |
| 33 | +- IOC developers |
| 34 | +- Non-NixOS system administrators |
| 35 | +- NixOS system administrators |
| 36 | +- EPNix contributors |
| 37 | + |
| 38 | +## Article types |
| 39 | + |
| 40 | +Each of these parts follows the [Diátaxis] model, |
| 41 | +meaning that each article falls into one of these types: |
| 42 | + |
| 43 | +Tutorial |
| 44 | +: Has a single goal, |
| 45 | + which it uses to teach a certain subject |
| 46 | + to a user. |
| 47 | + |
| 48 | + For example, |
| 49 | + in {doc}`../../ioc/tutorials/streamdevice`, |
| 50 | + the user creates an IOC |
| 51 | + for a specific power supply simulator. |
| 52 | + There isn't any choice or option, |
| 53 | + no "if you want to do this, then do that." |
| 54 | + The goal of this tutorial isn't to guide the user in creating *any* `StreamDevice` IOC, |
| 55 | + but to teach a new user how IOC development generally works |
| 56 | + using EPNix. |
| 57 | + |
| 58 | + Tutorials should target a practical and realistic goal. |
| 59 | + |
| 60 | + :::{seealso} |
| 61 | + [Diátaxis' Tutorials article] |
| 62 | + ::: |
| 63 | + |
| 64 | +How-to guide |
| 65 | +: In contrast to tutorials, |
| 66 | + the goal of guides isn't to teach new concepts |
| 67 | + but to show users how they achieve their own goals. |
| 68 | + |
| 69 | + For example, |
| 70 | + in {doc}`../../nixos-services/user-guides/phoebus-save-and-restore`, |
| 71 | + the article guides the user to set up the Phoebus save-and-restore authentication, |
| 72 | + depending on what authentication type they want. |
| 73 | + |
| 74 | + :::{seealso} |
| 75 | + [Diátaxis' How-to guides article] |
| 76 | + ::: |
| 77 | + |
| 78 | +Explanation |
| 79 | +: As with tutorials, |
| 80 | + the goal of an explanation is to teach, |
| 81 | + but instead of doing a practical task, |
| 82 | + the user reads an article. |
| 83 | + |
| 84 | + For example, |
| 85 | + in {doc}`../../ioc/explanations/template-files`, |
| 86 | + the user doesn't have any specific action to take. |
| 87 | + The article should help the user understand |
| 88 | + what should go where in the future of their IOC development. |
| 89 | + |
| 90 | + :::{seealso} |
| 91 | + [Diátaxis' Explanation article] |
| 92 | + ::: |
| 93 | + |
| 94 | +Reference |
| 95 | +: References are generally an exhaustive list |
| 96 | + of something that EPNix provides, |
| 97 | + for example, |
| 98 | + packages or NixOS options. |
| 99 | + |
| 100 | + References are not the place to teach or guide users. |
| 101 | + Users consult references as part of their work, |
| 102 | + picking and choosing the information they are looking for. |
| 103 | + |
| 104 | + For example, |
| 105 | + in the {doc}`../../nixos-services/options-reference/ioc-services` options reference, |
| 106 | + the list of options is given "as-is," |
| 107 | + without detailed guides on how to use them or how to start. |
| 108 | + This is the role of the corresponding guide linked at the top of the page. |
| 109 | + The options reference is meant to be succinct, |
| 110 | + to help the user find what they want on the page. |
| 111 | + |
| 112 | + References should be generated from code. |
| 113 | + |
| 114 | + :::{seealso} |
| 115 | + [Diátaxis' Reference article] |
| 116 | + ::: |
| 117 | + |
| 118 | +This structure helps focus the writing depending on the user's use case: |
| 119 | + |
| 120 | +- New users have a practical, single-path tutorial to follow |
| 121 | + and explanations to read. |
| 122 | + |
| 123 | + Talking about choices and specific cases would confuse new users |
| 124 | + and lower the usefulness of tutorials. |
| 125 | + |
| 126 | +- Users who actually want to deploy software have guides and references |
| 127 | + that take care of specific use cases |
| 128 | + without needing to explain much. |
| 129 | + |
| 130 | + Explaining too much in a how-to guide or a reference |
| 131 | + would prevent the user from finding the information they need. |
| 132 | + |
| 133 | +## Article ordering |
| 134 | + |
| 135 | +As a general rule of documentation, |
| 136 | +important information must come first, |
| 137 | +which is why tutorials and guides are first in each part. |
| 138 | + |
| 139 | +Tutorials are first because they should be the first articles read by new users. |
| 140 | +Once the user has learned enough to start being proficient, |
| 141 | +guides should be read. |
| 142 | +References should be last, |
| 143 | +because they're consulted after users become more familiar |
| 144 | +with what they're working on. |
| 145 | + |
| 146 | +The same can be said when ordering articles within their type: |
| 147 | + |
| 148 | +- Tutorials are ordered so that users can follow them sequentially |
| 149 | +- Inside guides, |
| 150 | + "prerequisites" should be put first |
| 151 | +- Explanations should be ordered by complexity |
| 152 | + |
| 153 | +(writing-style)= |
| 154 | +## Writing style |
| 155 | + |
| 156 | +### Understandability |
| 157 | + |
| 158 | +The writing in articles should prioritize being understood by users: |
| 159 | + |
| 160 | +- Be direct; |
| 161 | + use short sentences |
| 162 | +- Be consistent |
| 163 | + - Use the same terms consistently |
| 164 | + - Have a consistent writing style |
| 165 | +- Don't use complex words |
| 166 | +- Avoid unexplained acronyms |
| 167 | +- Use realistic examples and figures to illustrate your point |
| 168 | +- Put related information close to each other |
| 169 | +- Avoid overlapping articles |
| 170 | +- Each unique link should have a unique and descriptive title |
| 171 | + - For internal links, |
| 172 | + prefer using the automatic title |
| 173 | + by using the {rst:role}`doc` role |
| 174 | +- Don't use words such as "simple," "simply," "just," or "obvious." |
| 175 | + |
| 176 | +### Discoverability |
| 177 | + |
| 178 | +Users should be able to find what they want without issue: |
| 179 | + |
| 180 | +- Put important information first |
| 181 | +- Use headings and subheadings |
| 182 | +- Use admonitions for important information, |
| 183 | + such as {rst:dir}`important` |
| 184 | +- Link related articles |
| 185 | +- If you expect users to search for some information in the wrong article, |
| 186 | + link the correct one |
| 187 | + |
| 188 | +### Vale |
| 189 | + |
| 190 | +To enforce parts of the writing style |
| 191 | +and to take advantage of already written style guides, |
| 192 | +we've set up the [Vale] linter. |
| 193 | + |
| 194 | +This enables us to write rules, |
| 195 | +such as: |
| 196 | + |
| 197 | +```{code-block} yaml |
| 198 | +:caption: Example Vale rule |
| 199 | +
|
| 200 | +extends: substitution |
| 201 | +message: Consider using '%s' instead of '%s' |
| 202 | +level: warning |
| 203 | +swap: |
| 204 | + # To be consistent with the Nix terminology |
| 205 | + development environment: development shell |
| 206 | +``` |
| 207 | + |
| 208 | + |
| 209 | +We encourage all writers of EPNix documentation to use Vale, |
| 210 | +although following every rule isn't mandatory. |
| 211 | + |
| 212 | +For example, |
| 213 | +using the passive voice in certain contexts makes sense, |
| 214 | +but the "passive voice" rule is still enabled |
| 215 | +to avoid using it when possible. |
| 216 | + |
| 217 | + [Diátaxis' Explanation article]: https://diataxis.fr/explanation/ |
| 218 | + [Diátaxis' How-to guides article]: https://diataxis.fr/how-to-guides/ |
| 219 | + [Diátaxis' Reference article]: https://diataxis.fr/reference/ |
| 220 | + [Diátaxis' Tutorials article]: https://diataxis.fr/tutorials/ |
| 221 | + [Diátaxis]: https://diataxis.fr/ |
| 222 | + [Vale]: https://vale.sh/ |
| 223 | + [Write the docs' Documentation principles]: https://www.writethedocs.org/guide/writing/docs-principles/ |
| 224 | + [Write the docs' Software documentation guide]: https://www.writethedocs.org/guide/ |
0 commit comments