You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: source/developers/documentation/standards.markdown
+54-4
Original file line number
Diff line number
Diff line change
@@ -25,25 +25,25 @@ To ensure that the documentation for Home Assistant is consistent and easy to fo
25
25
* Configuration variables must document the requirement status.
26
26
* Configuration variables must document the default value, if any.
27
27
* Configuration variables must document the accepted value types.
28
-
*Use `[string, int]` for configuration variables that accept multiple types.
28
+
*For configuration variables that accept multiple types, separate the types with a comma (i.e. `string, int`).
29
29
* Use YAML sequence syntax in the sample code if it is supported.
30
30
* All examples should be formatted to be included in `configuration.yaml` unless explicitly stated.
31
31
* Use capital letters and `_` to indicate that the value needs to be replaced. E.g., `api_key: YOUR_API_KEY` or `api_key: REPLACE_ME`.
32
-
* If you know that the API key or value contains [control characters](https://en.wikipedia.org/wiki/YAML#Syntax), e.g., `#`, `[`, `?`, etc., wrap it in quotes and add a note.
32
+
* If you know that the API key or value contains [control characters](https://en.wikipedia.org/wiki/YAML#Syntax), e.g., `#`, `[`, `?`, etc., wrap it in quotes and add a note.
33
33
* Component and platform names should be a link to their respective documentation pages.
34
34
35
35
## {% linkable_title Templates %}
36
36
37
37
* All examples containing Jinja2 templates should be wrapped **outside** of the code markdown with the {% raw %}`{% raw %}`{% endraw %} tag.
38
38
* Do not use `states.switch.source.state` in templates. Instead use `states()` and `is_state()`.
39
-
* Use double quotes (`"`) for:
39
+
* Use double quotes (`"`) for ([more information](#single-vs-double-quotation-marks)):
40
40
*`friendly_name`
41
41
* Single-line templates:
42
42
*`value_template`
43
43
*`level_template`
44
44
*`icon_template`
45
45
* Children of `data_template`
46
-
* Use single quotes (`'`) for:
46
+
* Use single quotes (`'`) for ([more information](#single-vs-double-quotation-marks):
Adding a redirect also applies if you move content around in the [documentation](/docs/).
72
+
73
+
## {% linkable_title Single vs. Double Quotation Marks %}
74
+
75
+
Use single quotes (`'`) for strings inside of a template. It is more obvious to escape a single quote when necessary (i.e. `name` is a possessive noun), because the single quotes that wrap the string are closer in position to the apostrophe inside the string. Use double quotes (`"`) outside of a template (unless it is a multi-line template, in which case outside quotes are not required).
0 commit comments