Skip to content

Commit 0eb9341

Browse files
authored
about integration docs: improve page (#2582)
* about integration docs: improve page - add screenshots showing the configuration variables blocks - add image titles - style tweaks * Fix typo * Fix title * Specify installation
1 parent f4abc07 commit 0eb9341

File tree

1 file changed

+93
-30
lines changed

1 file changed

+93
-30
lines changed

docs/documenting/integration-docs-examples.md

Lines changed: 93 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This page shows examples of the available documentation features (such as inline
66

77
Use this template together with the following documentation:
88

9-
- The integration documentation template on under [/_integrations/_integration_docs_template.markdown](https://github.com/home-assistant/home-assistant.io/tree/current/source/_integrations/_integration_docs_template.markdown).
9+
- 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).
1010
- [Documentation standard](https://developers.home-assistant.io/docs/documenting/standards).
1111
- The documentation rules of the [Integration Quality Scale](https://developers.home-assistant.io/docs/core/integration-quality-scale/rules/).
1212

@@ -16,16 +16,19 @@ This section shows elements you can use within your text.
1616

1717
### My links
1818

19-
To indicate a location in the UI, you can use a [My link](https://www.home-assistant.io/docs/tools/quick-bar/#my-links). If the reader selects that link, that page opens in their installation. For example: `"Go to {% my integrations title="**Settings** > **Devices & services**" %} and select your integration."`
19+
To indicate a location in the UI, you can use a [My link](https://www.home-assistant.io/docs/tools/quick-bar/#my-links). Selecting a My link opens that page in their own Home Assistant installation.
2020

21-
Screenshot showing the styling of my links:
21+
For example: `"Go to {% my integrations title="**Settings** > **Devices & services**" %} and select your integration."`
2222

23+
<p class='img'>
2324
<img class='invertDark'
2425
src='/img/en/documentation/my-links_formatting.png'
2526
alt='Screenshot showing the styling of my links'
2627
/>
28+
Screenshot showing the styling of my links
29+
</p>
2730

28-
Here are a few examples:
31+
#### Examples
2932

3033
```markdown
3134
- {% my areas title="**Settings** > **Areas, labels & zones**" %}
@@ -48,14 +51,15 @@ To identify a My link, in Home Assistant, open the page of interest and press th
4851

4952
Some Home Assistant terms and concepts are explained in a Glossary. If you add a reference to the definition of such a term, the term definition is shown as a tooltip.
5053

51-
Screenshot showing the styling of a glossary term tooltip:
52-
54+
<p class='img'>
5355
<img class='invertDark'
5456
src='/img/en/documentation/glossary-term_tooltip.png'
5557
alt='Screenshot showing the styling of a glossary term tooltip'
5658
/>
59+
Screenshot showing the styling of a glossary term tooltip
60+
</p>
5761

58-
For example:
62+
#### Examples
5963

6064
```markdown
6165
{% term integration %}
@@ -72,14 +76,15 @@ If possible, try to avoid using abbreviations and acronyms.
7276

7377
If you want to use an acronym or abbreviation, you can add an abbreviation tag to show the full term as a tooltip.
7478

75-
Screenshot showing the styling of an abbreviation tooltip:
76-
79+
<p class='img'>
7780
<img class='invertDark'
7881
src='/img/en/documentation/abbreviation_tooltip.png'
7982
alt='Screenshot showing the styling of an abbreviation tooltip'
8083
/>
84+
Screenshot showing the styling of an abbreviation tooltip
85+
</p>
8186

82-
Here a few examples:
87+
#### Examples
8388

8489
```markdown
8590
<abbr title="Audio & video">A/V</abbr>,
@@ -99,14 +104,15 @@ or <abbr title="USB-On-The-Go">USB-OTG</abbr>.
99104

100105
To refer to an icon in the UI, you can use icons from the [Iconify library](https://icon-sets.iconify.design/mdi/).
101106

102-
Screenshot showing some inline icons:
103-
107+
<p class='img'>
104108
<img class='invertDark'
105109
src='/img/en/documentation/inline_icons.png'
106110
alt='Screenshot showing some inline icons'
107111
/>
112+
Screenshot showing some inline icons
113+
</p>
108114

109-
Here are some examples:
115+
#### Examples
110116

111117
```markdown
112118
- Three dots menu: {% icon "mdi:dots-vertical" %}
@@ -131,14 +137,15 @@ Here are some examples:
131137

132138
Use a details block to make a text block collapsible:
133139

134-
Screenshot showing a collapsible text block:
135-
140+
<p class='img'>
136141
<img class='invertDark'
137142
src='/img/en/documentation/collapsible_text_block.webp'
138143
alt='Screenshot showing a collapsible text block'
139144
/>
145+
Screenshot showing a collapsible text block
146+
</p>
140147

141-
Example:
148+
### Example
142149

143150
```markdown
144151
{% details "Generate Client ID and Client Secret" %}
@@ -152,16 +159,22 @@ Example:
152159

153160
## Text boxes
154161

155-
Screenshot showing text boxes:
156-
157-
<img class='invertDark'
158-
src='/img/en/documentation/text_boxes.png'
159-
alt='Screenshot showing text boxes'
160-
/>
162+
<p class='img'>
163+
<img class='invertDark'
164+
src='/img/en/documentation/text_boxes.png'
165+
alt='Screenshot showing text boxes'
166+
/>
167+
Screenshot showing text boxes:
168+
</p>
161169

162-
Example:
170+
### Examples
163171

164172
```markdown
173+
174+
{% tip %}
175+
You can use a tip to feature a recommendation.
176+
{% endtip %}
177+
165178
{% note %}
166179
You can use a note to highlight a section.
167180
{% endnote %}
@@ -177,22 +190,69 @@ For some topics, there are predefined text elements that you can reuse.
177190

178191
### Configuration
179192

180-
Screenshot showing the predefined configuration text block:
181-
193+
<p class='img'>
182194
<img class='invertDark'
183195
src='/img/en/documentation/config_flow.png'
184196
alt='Screenshot showing predefined configuration text block'
185197
/>
198+
Screenshot showing the predefined configuration text block
199+
</p>
186200

187201
To use this element, add the following line:
188202

189203
```markdown
190204
{% include integrations/config_flow.md %}
191205
```
192206

207+
#### Configuration_basic block
208+
209+
Use the `configuration_basic` block to describe configuration options if your integration is set up via a config flow.
210+
211+
<p class='img'>
212+
<img class='invertDark'
213+
src='/img/en/documentation/configuration_variables_ui.png'
214+
alt='Screenshot showing a configuration variable block for integrations that are set up in the UI'
215+
/>
216+
Screenshot showing a configuration variable block for integrations that are set up in the UI
217+
</p>
218+
219+
```markdown
220+
{% configuration_basic %}
221+
Host:
222+
description: "The IP address of your bridge. You can find it in your router or in the Integration app under **Bridge Settings** > **Local API**."
223+
Local access token:
224+
description: "The local access token for your bridge. You can find it in the Integration app under **Bridge Settings** > **Local API**."
225+
{% endconfiguration_basic %}
226+
```
227+
228+
#### Configuration block for YAML integrations
229+
230+
Use the `configuration` block to describe configuration options if your integration is set up via YAML only.
231+
232+
<p class='img'>
233+
<img class='invertDark'
234+
src='/img/en/documentation/configuration_variables_yaml.png'
235+
alt='Screenshot showing a configuration variable block for YAML integrations'
236+
/>
237+
Screenshot showing a configuration variable block for YAML integrations
238+
</p>
239+
240+
```markdown
241+
{% configuration %}
242+
Host:
243+
description: "The IP address of your bridge. You can find it in your router or in the Integration app under **Bridge Settings** > **Local API**."
244+
required: false
245+
type: string
246+
Local access token:
247+
description: "The local access token for your bridge. You can find it in the Integration app under **Bridge Settings** > **Local API**."
248+
required: false
249+
type: string
250+
{% endconfiguration %}
251+
```
252+
193253
## Images
194254

195-
You can use an image to illustrate a step:
255+
In general, use the Markdown syntax to add images. For example, when adding an image to illustrate a step:
196256

197257
<img class='invertDark'
198258
src='/img/en/documentation/image_in_step.png'
@@ -207,7 +267,7 @@ Markdown syntax to add an image:
207267
2. Then do this ...
208268
```
209269

210-
You can add an image with caption:
270+
To add an image with caption, you can use HTML syntax:
211271

212272
<img class='invertDark'
213273
src='/img/en/documentation/image_with_legend.png'
@@ -230,14 +290,17 @@ Use the following syntax to reference a video from Youtube. Use `videoStartAt` t
230290
<lite-youtube videoid="ZgoaoTpIhm8" videoStartAt="3907" videotitle="Introducing the Home Assistant Voice Preview Edition - Voice: Chapter 8"></lite-youtube>
231291
```
232292

293+
<p class='img'>
233294
<img class='invertDark'
234295
src='/img/en/documentation/youtube_ref_start_at.webp'
235-
alt='Screencast showing a refernce to Youtube to start at a specific time'
296+
alt='Screencast showing a reference to Youtube to start at a specific time'
236297
/>
298+
Screencast showing a reference to Youtube to start at a specific time
299+
</p>
237300

238-
## Document structure with example text
301+
## Document structure
239302

240-
This section outlines the document structure. To view example text, refer to the integration documentation template in the `homeassistant.io` repository under `/_integrations/_integration_docs_template.md`. The example text includes some reusable text blocks (includes) such as `include integrations/config_flow.md` and styling elements such as `configuration_basic`.
303+
This section outlines the high-level document structure. To view example text, refer to the integration documentation template in the `homeassistant.io` repository under `/_integrations/_integration_docs_template.md`. The example text includes some reusable text blocks (includes) such as `include integrations/config_flow.md` and styling elements such as `configuration_basic`.
241304

242305
The examples are taken from the [Integration Quality Scale](/docs/core/integration-quality-scale/).
243306

0 commit comments

Comments
 (0)