Skip to content

Commit b39b7da

Browse files
authored
Move general style guide to its own page (#2647)
1 parent 742f2e9 commit b39b7da

File tree

4 files changed

+40
-26
lines changed

4 files changed

+40
-26
lines changed
+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: "General style guide"
3+
---
4+
5+
Documentation should follow the [Microsoft Style Guide](https://learn.microsoft.com/style-guide/welcome/).
6+
7+
A few of the most common cases picked up in reviews are listed below:
8+
9+
- The language of the documentation should be American-English.
10+
- Don't put two spaces after a period.
11+
- Use a serial comma (also known as the Oxford comma) before the conjunction in a list of three or more items. For example, "Through the use of additional adapters, Home Assistant allows the use of Zigbee, Z-Wave, and other protocols".
12+
- There is no limit for the line length. You are allowed to write in a flowing text style. This will make it easier to use the GitHub online editor in the future.
13+
- Be objective and not gender favoring, polarizing, race related or religion inconsiderate. Contributions which do not follow this may be in breach of our [Code of Conduct](https://github.com/home-assistant/core/blob/master/CODE_OF_CONDUCT.md).
14+
- The case of brand names, services, protocols, integrations, and platforms must match their respective counterparts. For example, "Z-Wave" _not_ "Zwave", "Z-wave", "Z Wave", or "ZWave". Also, "Input Select" _not_ "input select" or "Input select".
15+
- Do not use ALL CAPITALS for emphasis - use _italics_ instead.
16+
- Use [sentence-style capitalization](https://learn.microsoft.com/en-us/style-guide/capitalization), also in headings.
17+
- Use **bold** to markup UI strings, for example:
18+
- Under **Settings**, select the three dots menu. Then, select **Restart Home Assistant** > **Quick reload**.
19+
- Don't use "e.g.". Instead, use _for example_, _such as_, or _like_.
20+
- All examples containing Jinja2 templates should be wrapped _outside_ of the code markdown with the `{% raw %}` tag.
21+
22+
## Tables
23+
24+
- Avoid the use of tables. Use lists instead. If you cannot avoid a table, minimize the number of columns and keep the amount of text as short as possible:
25+
- Tables that are too wide can be difficult to browse on handheld devices.
26+
- Less content makes tables easier to read.
27+
- When limiting the amount of text is not possible, consider using other data structures for representing the information. For example, lists or `{% configuration_basic %}` can be used.
28+
29+
## YAML and templates
30+
31+
We have a separate styling guide for YAML and the use of Jinja2 templates
32+
inside that YAML.
33+
34+
[YAML Style Guide](documenting/yaml-style-guide.md)

docs/documenting/integration-docs-examples.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@ This page shows examples of the available documentation features (such as inline
77
Use this template together with the following documentation:
88

99
- The integration documentation template in the home-assistant.io repository under [/_integrations/_integration_docs_template.markdown](https://github.com/home-assistant/home-assistant.io/tree/current/source/_integrations/_integration_docs_template.markdown).
10-
- [Documentation standard](https://developers.home-assistant.io/docs/documenting/standards).
11-
- The documentation rules of the [Integration Quality Scale](https://developers.home-assistant.io/docs/core/integration-quality-scale/).
10+
- [Documentation standard](/docs/documenting/standards).
11+
- [General style guide](/docs/documenting/general-style-guide).
12+
- The documentation rules of the [Integration Quality Scale](/docs/core/integration-quality-scale/).
1213

1314
## Inline text elements
1415

docs/documenting/standards.md

+2-24
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,9 @@ title: "Standards"
44

55
To ensure that the documentation for Home Assistant is consistent and easy to follow for both novice and expert users, we ask that you follow a very strict set of standards for developing the documentation.
66

7-
## General documentation
7+
## Style guide
88

9-
Broadly speaking, documentation should be written following the [Microsoft Style Guide](https://learn.microsoft.com/style-guide/welcome/).
10-
11-
A few of the most common cases picked up in reviews are listed below:
12-
13-
- The language of the documentation should be American-English.
14-
- Don't put two spaces after a period.
15-
- Use a serial comma (also known as the Oxford comma) before the conjunction in a list of three or more items. For example, "Through the use of additional adapters, Home Assistant allows the use of Zigbee, Z-Wave, and other protocols".
16-
- There is no limit for the line length. You are allowed to write in a flowing text style. This will make it easier to use the GitHub online editor in the future.
17-
- Be objective and not gender favoring, polarizing, race related or religion inconsiderate. Contributions which do not follow this may be in breach of our [Code of Conduct](https://github.com/home-assistant/core/blob/master/CODE_OF_CONDUCT.md).
18-
- The case of brand names, services, protocols, integrations, and platforms must match their respective counterparts. For example, "Z-Wave" _not_ "Zwave", "Z-wave", "Z Wave", or "ZWave". Also, "Input Select" _not_ "input select" or "Input select".
19-
- Do not use ALL CAPITALS for emphasis - use _italics_ instead.
20-
- Use [sentence-style capitalization](https://learn.microsoft.com/en-us/style-guide/capitalization), also in headings.
21-
- Use **bold** to markup UI strings, for example:
22-
- Under **Settings**, select the three dots menu. Then, select **Restart Home Assistant** > **Quick reload**.
23-
- Don't use "e.g.". Instead, use _for example_, _such as_, or _like_.
24-
- All examples containing Jinja2 templates should be wrapped _outside_ of the code markdown with the `{% raw %}` tag.
9+
Documentation should follow the [Microsoft Style Guide](https://learn.microsoft.com/style-guide/welcome/). For more details, refer to the section [General style guide](documenting/general-style-guide.md) and the [YAML style guide](documenting/yaml-style-guide.md).
2510

2611
## Integration and platform pages
2712

@@ -54,13 +39,6 @@ some_key:
5439

5540
- For describing **UI Variables** the `{% configuration_basic %}` section can be used.
5641

57-
### Tables
58-
59-
- Avoid the use of tables. Use lists instead. If you cannot avoid a table, minimize the number of columns and keep the amount of text as short as possible:
60-
- Tables that are too wide can be difficult to browse on handheld devices.
61-
- Less content makes tables easier to read.
62-
- When limiting the amount of text is not possible, consider using other data structures for representing the information. For example, lists or `{% configuration_basic %}` can be used.
63-
6442
## YAML and templates
6543

6644
We have a separate styling guide for YAML and the use of Jinja2 templates

sidebars.js

+1
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ module.exports = {
297297
items: [
298298
"documenting",
299299
"documenting/standards",
300+
"documenting/general-style-guide",
300301
"documenting/yaml-style-guide",
301302
"documenting/create-page",
302303
"documenting/integration-docs-examples",

0 commit comments

Comments
 (0)