Skip to content

Commit 373bc60

Browse files
committed
Create new section for Documentation and split content
1 parent 3fa78b7 commit 373bc60

File tree

4 files changed

+142
-15
lines changed

4 files changed

+142
-15
lines changed

source/_includes/asides/developers_navigation.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,14 @@ <h1 class="title delta">Development Guide</h1>
107107
<li>{% active_link /developers/server_sent_events/ Server-sent events %}</li>
108108
</ul>
109109
</li>
110+
<li>
111+
{% active_link /developers/documentation/ Website/Documentation %}
112+
<ul>
113+
<li>{% active_link /developers/documentation/standards Standards %}</li>
114+
<li>{% active_link /developers/documentation/create_page Create a new page %}</li>
115+
</ul>
116+
</li>
110117
<li>{% active_link /developers/helpers/ Online helpers %}</li>
111-
<li>{% active_link /developers/website/ Website/Documentation %}</li>
112118
<li>{% active_link /developers/releasing/ Releasing %}</li>
113119
<li>{% active_link /developers/maintenance/ Maintenance %}</li>
114120
<li>
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
---
2+
layout: page
3+
title: "Create a new page"
4+
description: "Create a new page for the documentation"
5+
date: 2015-06-17 08:00
6+
sidebar: true
7+
comments: false
8+
sharing: true
9+
footer: true
10+
---
11+
12+
For a platform or component page, the fastest way is to make a copy of an existing page and edit it. The [Component overview](/components/) and the [Examples section](/cookbook/) are generated automatically, so there is no need to add a link to those pages.
13+
14+
Please honor the Standards we have for the documentation.
15+
16+
If you start from scratch with a page, you need to add a header. Different sections of the documentation may need different headers.
17+
18+
```text
19+
---
20+
layout: page
21+
title: "Awesome Sensor"
22+
description: "home-assistant.io web presence"
23+
date: 2015-06-17 08:00
24+
sidebar: true
25+
comments: false
26+
sharing: true
27+
footer: true
28+
ha_release: "0.38"
29+
ha_category: Sensor
30+
---
31+
32+
Content...Written in markdown.
33+
34+
{% raw %}### {% linkable_title Linkable Header %}{% endraw %}
35+
...
36+
```
37+
38+
There are [pre-definied variables](https://jekyllrb.com/docs/variables/) available but usually, it's not necessary to use them when writing documentation.
39+
40+
A couple of points to remember:
41+
42+
- Document the needed steps to retrieve API keys or access token for the third party service or device if needed.
43+
- If you're adding a new component, for the `ha_release` part of the header, just increment of the current release. If the current release is 0.37, make `ha_release` 0.38. If it's 0.30 or 0.40 please quote it with `" "`.
44+
- `ha_category:` is needed to list the platform or component in the appropriate category on the website.
45+
46+
### {% linkable_title Configuration %}
47+
48+
Every platform page should contain a configuration sample. This sample must contain only the **required** variables to make it easy to copy and paste it for users into their `configuration.yaml` file.
49+
50+
The **Configuration Variables** section must use the {% raw %}`{% configuration %} ... {% endconfiguration %}`{% endraw %} tag.
51+
52+
53+
```text
54+
{% raw %}
55+
{% configuration %}
56+
api_key:
57+
description: The API key to access the service.
58+
required: true
59+
type: string
60+
name:
61+
description: Name to use in the frontend.
62+
required: false
63+
type: string
64+
{% endconfiguration %}
65+
{% endraw %}
66+
```
67+
68+
- **`description:`**: That the variable is about.
69+
- **`required:`**: If the variable is required.
70+
```text
71+
required: true #=> Required
72+
required: false #=> Optional
73+
required: inclusive #=> Inclusive
74+
required: exclusive #=> Exclusive
75+
required: any string here #=> Any string here
76+
```
77+
- **`type:`**: The type of the variable. Allowed entries: `string`, `int` or `map`. For multiple possibilities use `[string, int]`. If you use `map` then you need to define `keys:` (see the [`template` sensor](/components/sensor.template/) for an example).
78+
79+
### {% linkable_title Embedding Code %}
80+
81+
You can use the [default markdown syntax](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code) to generate syntax highlighted code. For inline code wrap your code in {% raw %}`{% endraw %}.
82+
83+
When you're writing code that is to be executed on the terminal, prefix it with `$`.
84+
85+
### {% linkable_title Templates %}
86+
87+
For the [configuration templating](/topics/templating/) is [Jinja](http://jinja.pocoo.org/) used. Check the Documentation Standards for further details.
88+
89+
If you are don't escape templates then they will be rendered and appear blank on the website.
90+
91+
### {% linkable_title HTML %}
92+
93+
The direct usage of HTML is supported but not recommended. The note boxes are an exception.
94+
95+
```html
96+
<p class='note warning'>
97+
You need to enable telnet on your router.
98+
</p>
99+
```
100+
101+
### {% linkable_title Redirects %}
102+
If you rename or move an existing platform or component, create the redirect. Add the old location of the page to the header of the new one.
103+
104+
```text
105+
---
106+
...
107+
redirect_from: /getting-started/android/
108+
---
109+
```
110+
111+
### {% linkable_title Images, icons, and logos %}
112+
113+
The images which are displayed on the pages are stored in various directories according to their purpose. If you want to use a logo and placed `logo:` in the file header then this image should be stored in `source/images/supported_brands`. The background must be transparent.
114+
115+
| Type | Location |
116+
| :----------- |:----------------------------------------------|
117+
| logos | source/images/supported_brands |
118+
| blog | source/images/blog |
119+
| screenshots | source/images/components |
120+
121+
Not everything (product, component, etc.) should have a logo. To show something for internal parts of Home Assistant we are using the [Material Design Icons](https://materialdesignicons.com/).

source/developers/documentation/index.markdown

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
---
22
layout: page
3-
title: "Website home-assistant.io"
4-
description: "home-assistant.io web presence"
3+
title: "Documentation Home Assistant"
4+
description: "home-assistant.io web presence for the documentation"
55
date: 2015-06-17 08:00
66
sidebar: true
77
comments: false
88
sharing: true
99
footer: true
10+
redirect: /developers/website/
1011
---
1112

1213
The website you are reading now is the home of Home Assistant: [https://home-assistant.io](https://home-assistant.io). This is the place where we provide documentation and additional details about Home Assistant for end users and developers.
@@ -142,11 +143,12 @@ redirect_from: /getting-started/android/
142143

143144
### {% linkable_title Images, icons, and logos %}
144145

145-
The images which are displayed on the pages are stored in various directories according to their purpose.
146+
The images which are displayed on the pages are stored in various directories according to their purpose. If you want to use a logo and placed `logo:` in the file header then this image should be stored in `source/images/supported_brands`. The background must be transparent.
146147

147148
| Type | Location |
148149
| :----------- |:----------------------------------------------|
149-
| screenshots | source/images/screenshots |
150150
| logos | source/images/supported_brands |
151+
| blog | source/images/blog |
152+
| screenshots | source/images/components |
151153

152-
Not everything (product, component, etc.) has a logo. To show something for internal parts of Home Assistant we are using the [Material Design Icons](https://materialdesignicons.com/).
154+
Not everything (product, component, etc.) should have a logo. To show something for internal parts of Home Assistant we are using the [Material Design Icons](https://materialdesignicons.com/).

source/developers/documentation/standards.markdown

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,26 +16,23 @@ To ensure that the documentation for Home Assistant is consistent and easy to fo
1616
* The language of the documentation should be American-English.
1717
* Don't put two spaces after a period and avoid the "Oxford comma".
1818
* Be objective and not gender favoring, polarizing, race related or religion inconsiderate.
19-
* The case of brand names, services, protocols, components, and platforms must match its respective counterpart.
20-
* Z-Wave (**not** Zwave, Z-wave, Z Wave or ZWave)
21-
* Zigbee (**not** ZigBee)
22-
* iCloud (**not** Icloud, icloud or ICloud)
23-
* Pushover (**not** PushOver, pushover or push over)
24-
* OwnTracks (**not** Owntracks, ownTracks, owntracks or own tracks)
25-
* Input Select (**not** input select or Input select)
19+
* The case of brand names, services, protocols, components, and platforms must match its respective counterpart. E.g. Z-Wave **not** "Zwave", "Z-wave", "Z Wave" or "ZWave". Also, Input Select **not** "input select" or "Input select".
2620
* All headings should use the {% raw %}`{% linkable_title %}`{% endraw %} tag.
2721

2822
## {% linkable_title Component and Platform Pages %}
2923

30-
* The ***Configuration Variables*** section must use the {% raw %}`{% configuration %}`{% endraw %} tag.
24+
* The **Configuration Variables** section must use the {% raw %}`{% configuration %}`{% endraw %} tag.
3125
* Configuration variables must document the requirement status.
3226
* Configuration variables must document the default value, if any.
3327
* Configuration variables must document the accepted value types.
3428
* Use `[string, int]` for configuration variables that accept multiple types.
3529
* Use YAML sequence syntax in the sample code if it is supported.
3630
* All examples should be formatted to be included in `configuration.yaml` unless explicitly stated.
37-
* All examples containing Jinja2 templates should be wrapped ***outside*** of the code markdown with {% raw %}`{% raw %}`{% endraw %} tag.
3831
* Component and platform names should be a link to their respective documentation pages.
32+
33+
## {% linkable_title Templates %}
34+
35+
* All examples containing Jinja2 templates should be wrapped **outside** of the code markdown with the {% raw %}`{% raw %}`{% endraw %} tag.
3936
* Do not use `states.switch.source.state` in templates. Instead use `states()` and `is_state()`.
4037
* Use double quotes (`"`) for:
4138
* `friendly_name`
@@ -57,3 +54,4 @@ To ensure that the documentation for Home Assistant is consistent and easy to fo
5754
* `platform`
5855
* `condition`
5956
* `service`
57+

0 commit comments

Comments
 (0)