qmk-firmware/docs/documentation_best_practices.md

78 lines
2.3 KiB
Markdown
Raw Normal View History

2017-07-03 10:30:36 +02:00
# Documentation Best Practices
This page exists to document best practices when writing documentation for QMK. Following these guidelines will help to keep a consistent tone and style, which will in turn help other people more easily understand QMK.
# Page Opening
Your documentation page should generally start with an H1 heading, followed by a 1 paragrah description of what the user will find on this page. Keep in mind that this heading and paragraph will sit next to the Table of Contents, so keep the heading short and avoid long strings with no whitespace.
Example:
```
# My Page Title
This page covers my super cool feature. You can use this feature to make coffee, squeeze fresh oj, and have an egg mcmuffin and hashbrowns delivered from your local macca's by drone.
```
# Headings
Your page should generally have multiple "H1" headings. Only H1 and H2 headings will included in the Table of Contents, so plan them out appropriately. Excess width should be avoided in H1 and H2 headings to prevent the Table of Contents from getting too wide.
# Styled Hint Blocks
You can have styled hint blocks drawn around text to draw attention to it.
```
{% hint style='info' %}
This uses `hint style='info'`
{% endhint %}
```
### Examples:
2017-07-03 10:30:36 +02:00
{% hint style='info' %}
2017-07-03 20:35:29 +02:00
This uses `hint style='info'`
2017-07-03 10:30:36 +02:00
{% endhint %}
{% hint style='tip' %}
2017-07-03 20:35:29 +02:00
This uses `hint style='tip'`
2017-07-03 10:30:36 +02:00
{% endhint %}
{% hint style='danger' %}
2017-07-03 20:35:29 +02:00
This uses `hint style='danger'`
2017-07-03 10:30:36 +02:00
{% endhint %}
{% hint style='working' %}
2017-07-03 20:35:29 +02:00
This uses `hint style='working'`
2017-07-03 10:30:36 +02:00
{% endhint %}
# Styled Terminal Blocks
You can present styled terminal blocks by including special tokens inside your text block.
```
\`\`\`
**[terminal]
**[prompt foo@joe]**[path ~]**[delimiter $ ]**[command ./myscript]
Normal output line. Nothing special here...
But...
You can add some colors. What about a warning message?
**[warning [WARNING] The color depends on the theme. Could look normal too]
What about an error message?
**[error [ERROR] This is not the error you are looking for]
\`\`\`
```
### Example
```
**[terminal]
**[prompt foo@joe]**[path ~]**[delimiter $ ]**[command ./myscript]
Normal output line. Nothing special here...
But...
You can add some colors. What about a warning message?
**[warning [WARNING] The color depends on the theme. Could look normal too]
What about an error message?
**[error [ERROR] This is not the error you are looking for]
```