|
| 1 | +# Port documentation style guide |
| 2 | + |
| 3 | +This document details guidelines for contributing to Port's documentation, and demonstrates how to correctly write and review documentation content. |
| 4 | + |
| 5 | +## Styling guidelines |
| 6 | + |
| 7 | +### Capital letters |
| 8 | + |
| 9 | +1. **Headers** - generally, all headers should have a capital letter only for the first word. The rest of the sentence will be in lowercase letters. For example: "Promote scorecards". |
| 10 | +2. **Links** - unless the link is at a start of a new sentence, it should not be capitalized. |
| 11 | +3. **General product names** - well known products such as Lambda, Kubernetes, ArgoCD, etc. should follow their standard capitalization rules and styling. |
| 12 | + |
| 13 | +### Tone & style |
| 14 | + |
| 15 | +**General docs** |
| 16 | + |
| 17 | +- Avoid using gender-specific language. |
| 18 | +- When addressing the reader, use second-person pronouns (you, your). For example "You can achieve this by…". |
| 19 | +- Don't use commanding language such as "You will now create a blueprint…" or "In this guide you will create...". |
| 20 | +Instead use "We will now create a blueprint…" or "Let's create…" |
| 21 | +- Use emojis 🥸 when you see fit. It can lighten a complex topic, and generally convey a friendly experience. Be careful not to overuse. |
| 22 | +- Be search-oriented, ensure the proper keywords that users will likely search for in the page are present. |
| 23 | +- Keep sentences concise and direct. Aim for 15-25 words per sentence when possible. |
| 24 | +- Use active voice rather than passive voice. For example, "Port connects to your Git provider" instead of "Your Git provider is connected to by Port." |
| 25 | +- Break up long paragraphs into smaller chunks (3-5 sentences maximum). |
| 26 | +- Use consistent terminology throughout the documentation. Avoid using different terms to refer to the same concept. |
| 27 | + |
| 28 | +**Guides & examples** |
| 29 | + |
| 30 | +When writing guides and guide-like content: |
| 31 | +- Use "We" language to convey to the readers that we are guiding them along and not just telling them what to do. |
| 32 | +- Include screenshots and/or GIFs to improve clarity. |
| 33 | +- Structure guides with clear steps, using numbered lists for sequential actions. |
| 34 | +- Begin each step with an action verb when possible (e.g., "Click", "Navigate", "Enter", "Select"). |
| 35 | +- Provide context for each step to help users understand why they're performing it. |
| 36 | +- Include expected outcomes after completing important steps. |
| 37 | +- Add troubleshooting tips for common issues users might encounter. |
| 38 | + |
| 39 | +### Technical writing best practices |
| 40 | + |
| 41 | +- **Clarity over cleverness**: Choose clear, straightforward language over clever or marketing-oriented phrasing. |
| 42 | +- **Consistency**: Use the same terms, formatting, and patterns throughout the documentation. |
| 43 | +- **Accuracy**: Ensure all technical information, code examples, and procedures are accurate and tested. |
| 44 | +- **Completeness**: Include all necessary information without assuming too much prior knowledge. |
| 45 | +- **Avoid jargon**: Define technical terms on first use or link to a glossary. |
| 46 | +- **Use examples**: Provide real-world examples to illustrate concepts. |
| 47 | +- **Versioning awareness**: Clearly indicate when features are version-specific. |
| 48 | + |
| 49 | +### Tabs |
| 50 | + |
| 51 | +- General rule - add `queryString` to <Tabs> component to ensure each tab can be accessed directly from their URL. Example: |
| 52 | +`<Tabs groupId="example" queryString>` |
| 53 | +- General rule - don't use `#` headers inside tabs since they are rendered in the table of contents on the right side of the page, but can't be accessed unless the tab they're in is selected. |
| 54 | +If you want to use headers inside tabs, use `<h>` , for example `<h2>Header text</h2>`. |
| 55 | + |
| 56 | +### Links |
| 57 | + |
| 58 | +- All links must use full paths and not relative ones, to ensure safer code. |
| 59 | +- Decide if you want your link to open in the same tab or a new one. To make an internal link* open in a new tab, add [`https://docs.port.io`](https://docs.port.io) to the beginning of the link. |
| 60 | +*Internal link - a link that leads to another page **within** the docs site. |
| 61 | +- Use descriptive link text that indicates what the user will find when clicking. Avoid generic phrases like "click here" or "learn more". |
| 62 | +- Check that all links work before submitting your contribution. |
| 63 | + |
| 64 | +### Lists |
| 65 | + |
| 66 | +- Use `-` for bullets. |
| 67 | +- End each item with a `.` rather than a `;`. |
| 68 | +- Do not add an `etc.` item. |
| 69 | +- Keep list items parallel in structure (all items should be phrases, complete sentences, or similar constructions). |
| 70 | +- For numbered lists, use `1.` for all items (Markdown will automatically number them correctly). |
| 71 | + |
| 72 | +### Images & GIFs |
| 73 | + |
| 74 | +- Images should have a simple black border, otherwise they can blend in with the background, making for unclear docs. See **full example** below. |
| 75 | +- Images should be saved under `/static/img/` in the relevant directory. Create a new directory if the relevant one does not exist. |
| 76 | +- Like links, images should always be specified using **full path links** and not relative ones. |
| 77 | +- Images should have a proper `width` defined, so they are scaled properly. See **full example** below. |
| 78 | +- **Full example:** |
| 79 | +`<img src='/img/software-catalog/pages/excludePropertiesForm.png' width='50%' border='1px' />` |
| 80 | +- Consider using GIFs when you think they will better convey what you're trying to demonstrate. |
| 81 | +- Include alt text for all images to improve accessibility. |
| 82 | +- Ensure screenshots are current and reflect the latest UI. |
| 83 | + |
| 84 | +### Code examples |
| 85 | + |
| 86 | +- Always include `showLineNumbers` for code blocks with more than one line. |
| 87 | +- Ensure code examples are complete and can be copied and used directly when possible. |
| 88 | +- Use syntax highlighting by specifying the language after the opening backticks. |
| 89 | +- For inline code references, use single backticks (e.g., `blueprint`). |
| 90 | +- Test all code examples to ensure they work as documented. |
| 91 | +- Include comments in code examples to explain complex or non-obvious parts. |
| 92 | + |
| 93 | +### Hierarchy changes |
| 94 | + |
| 95 | +- If you move/delete/change the path of a file, check to see if its URL is used in other places such as: |
| 96 | + - The main Port monorepo. |
| 97 | + - Port's marketing site. |
| 98 | + - Port's Github action. |
| 99 | + - Any other place that may be relevant to the page you're changing. |
| 100 | +- Consider adding a redirect in our Amplify (hosting service), this is especially useful when moving/changing entire directories. Talk to @Hadar to achieve this. |
| 101 | + |
| 102 | +### Admonitions |
| 103 | + |
| 104 | +- Use the type that best fits the nature of your text. The available types can be found [here](https://docusaurus.io/docs/markdown-features/admonitions). |
| 105 | +- Always include a title, this makes the admonition's purpose clearer and increases the chance that readers will not skip it if it's relevant to them. |
| 106 | +- Full example: |
| 107 | +:::tip Supported versions |
| 108 | +Content goes here |
| 109 | +::: |
| 110 | +- Use admonitions sparingly to highlight important information. Overuse reduces their effectiveness. |
| 111 | +- Choose the appropriate admonition type based on the content: |
| 112 | + - `tip`: For helpful suggestions |
| 113 | + - `info`: For additional context |
| 114 | + - `caution`: For potential issues |
| 115 | + - `warning`: For critical information |
| 116 | + |
| 117 | +### Tips |
| 118 | + |
| 119 | +- Docusaurus doesn't allow broken internal links, so run `npm run build` before pushing to ensure all links are valid. |
| 120 | +- Preview your changes locally using `npm start` to see how they will appear on the live site. |
| 121 | +- Consider the reading flow and information hierarchy when structuring your content. |
| 122 | +- Use headings to create a logical structure that helps readers navigate the content. |
| 123 | +- When documenting UI elements, use bold text for labels and buttons (e.g., **Save** button). |
| 124 | + |
| 125 | +### Summary/details |
| 126 | + |
| 127 | +- General rule - use **bold** and (click to expand). For example: |
| 128 | +<details> |
| 129 | +<summary><b>Repository blueprint (Click to expand)</b></summary> |
| 130 | + |
| 131 | +Content goes here |
| 132 | + |
| 133 | +</details> |
| 134 | + |
| 135 | +### Formatting Standards |
| 136 | + |
| 137 | +- Spacing! <br /> is your friend, use it sparingly to make pages easier on the eyes. |
| 138 | +- Add `showLineNumbers` to all code snippets, except one-liners, for example: |
| 139 | +```yaml showLineNumbers |
| 140 | +resources: |
| 141 | + - kind: repository |
| 142 | +``` |
| 143 | +- Use consistent formatting for similar elements throughout the documentation. |
| 144 | +- Maintain a clear visual hierarchy with appropriate spacing between sections. |
| 145 | +- Use tables for comparing multiple items or presenting structured data. |
| 146 | +- For complex procedures, consider using a numbered list with clear, concise steps. |
| 147 | +
|
| 148 | +### Document review checklist |
| 149 | +
|
| 150 | +Before submitting your contribution, review it against this checklist: |
| 151 | +
|
| 152 | +- [ ] Content is accurate and up-to-date |
| 153 | +- [ ] Spelling and grammar are correct |
| 154 | +- [ ] Formatting is consistent with the guidelines |
| 155 | +- [ ] Links work correctly |
| 156 | +- [ ] Images display properly |
| 157 | +- [ ] Code examples are functional and follow best practices |
| 158 | +- [ ] Tone is consistent with Port's documentation style |
| 159 | +- [ ] Content is organized logically |
| 160 | +- [ ] Technical terms are explained or linked to definitions |
| 161 | +- [ ] No unnecessary jargon or marketing language |
0 commit comments