|
| 1 | +# Style Guide |
| 2 | + |
| 3 | +## Framework |
| 4 | + |
| 5 | +Follow the [Diátaxis approach](https://diataxis.fr/) when you think about and work on new documentation. |
| 6 | +This approach helps you decide on what kind of documentation to write and how to write it well. |
| 7 | + |
| 8 | +## Voice |
| 9 | + |
| 10 | +Documents should be written mainly in a combination of "second person" and "active voice", depending on the context. |
| 11 | + |
| 12 | +### Second Person |
| 13 | + |
| 14 | +Address the reader directly, often using "you". |
| 15 | +For example, "You need to create a HTTPRoute", |
| 16 | +rather than saying "An HTTPRoute needs to be created by you." |
| 17 | + |
| 18 | +### Active Voice |
| 19 | + |
| 20 | +The subject of the sentence performs the action. |
| 21 | +For example, "The Gateway controller processes the HTTPRoute to establish routing rules", |
| 22 | +rather than saying "The HTTPRoute is processed by the Gateway controller to establish routing rules" |
| 23 | + |
| 24 | +## Tense |
| 25 | + |
| 26 | +Use present tense, unless the meaning is better conveyed in future or past tense. |
| 27 | +For example, "This command starts the operator" |
| 28 | +rather than "This command will start the operator" |
| 29 | + |
| 30 | +## Language |
| 31 | + |
| 32 | +Use simple and direct language. Avoid unnecessary phrases, such as saying 'please'. |
| 33 | +For example, use "To create a ReplicaSet,..." instead of "In order to create a ReplicaSet, ...". |
| 34 | +Another example, use "View the pods." instead of "With this next command, we'll view the pods". |
| 35 | + |
| 36 | +## Avoid jargon and idioms |
| 37 | + |
| 38 | +Some readers may not speak English as a primary language. Avoid jargon and idioms to help them understand better. |
| 39 | +For example, use "Internally,..." instead of "Under the hood,...", |
| 40 | +or "Create a new cluster." instead of "Spin up a cluster." |
| 41 | + |
| 42 | +## Avoid time sensitive statements |
| 43 | + |
| 44 | +Avoid making promises or giving hints about the future. If you need to talk about an alpha feature, put the text under a heading that identifies it as alpha information. |
| 45 | +An exception to this would be mentioning the deprecation (and potential eventual removal) of some API. |
| 46 | + |
| 47 | +Avoid statements that will soon be out of date. |
| 48 | +An indication of this is words like "currently" and "new." A feature that is new today might not be considered new in a few months. |
| 49 | + |
| 50 | +For example, use "In version 1.0, ..." instead of "In the current version, ...". |
| 51 | + |
| 52 | +## Avoid words that don't add value |
| 53 | + |
| 54 | +Avoid words such as "just", "simply", "easy", "easily", or "simple". These words do not add value. |
| 55 | + |
| 56 | +## Images |
| 57 | + |
| 58 | +Avoid the overuse of images and screenshots as they can be a pain to maintain. |
| 59 | + |
| 60 | +## Characters |
| 61 | + |
| 62 | +Avoid the use of unusual characters, for example Unicode numbering and emojis. |
| 63 | + |
| 64 | +## Grammar |
| 65 | + |
| 66 | +* Start sentences with capital letters and end with . or : |
| 67 | +* Products, projects, and tools should be capitalised i.e Kuadrant, Authorino, Limitador etc |
| 68 | + |
| 69 | +## Inline Blocks, Notes & Warnings |
| 70 | + |
| 71 | +To highlight some content like blocks, notes or warnings, use the correct formatting as per https://squidfunk.github.io/mkdocs-material/reference/admonitions/#inline-blocks |
| 72 | + |
| 73 | +For example: |
| 74 | + |
| 75 | +````markdown |
| 76 | +```markdown |
| 77 | +!!! note |
| 78 | + |
| 79 | + This method currently only works if the Gateway is provided by Istio, with service mesh capabilities enabled across the cluster. |
| 80 | +``` |
| 81 | +```` |
| 82 | + |
| 83 | +## Code Blocks |
| 84 | + |
| 85 | +For code blocks preface the language in the code block as per https://squidfunk.github.io/mkdocs-material/reference/code-blocks/#usage |
| 86 | + |
| 87 | +For example: |
| 88 | + |
| 89 | +````markdown |
| 90 | +```bash |
| 91 | +kubectl get deployments -n kuadrant-system |
| 92 | +``` |
| 93 | +```` |
| 94 | + |
| 95 | +## Numbering in lists |
| 96 | + |
| 97 | +Avoid the overuse of numbering. It allows for docs to be updated much easier in the future. |
| 98 | + |
| 99 | +## Environment Variables |
| 100 | + |
| 101 | +Environment variables should be capitalised and use 'KUADRANT_' at the start, for example, `KUADRANT_GATEWAY_NS`, unless they are already defined environment variables for existing tools and services. |
0 commit comments