Skip to content

Commit 6ea009f

Browse files
committed
Wrap long lines for hugo-shortcodes page
1 parent 517ec92 commit 6ea009f

File tree

1 file changed

+59
-24
lines changed
  • content/en/docs/contribute/style/hugo-shortcodes

1 file changed

+59
-24
lines changed

content/en/docs/contribute/style/hugo-shortcodes/index.md

Lines changed: 59 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ Read more about shortcodes in the [Hugo documentation](https://gohugo.io/content
1212

1313
## Feature state
1414

15-
In a Markdown page (`.md` file) on this site, you can add a shortcode to display version and state of the documented feature.
15+
In a Markdown page (`.md` file) on this site, you can add a shortcode to
16+
display version and state of the documented feature.
1617

1718
### Feature state demo
1819

19-
Below is a demo of the feature state snippet, which displays the feature as stable in the latest Kubernetes version.
20+
Below is a demo of the feature state snippet, which displays the feature as
21+
stable in the latest Kubernetes version.
2022

2123
```
2224
{{</* feature-state state="stable" */>}}
@@ -50,16 +52,22 @@ Renders to:
5052

5153
There are two glossary shortcodes: `glossary_tooltip` and `glossary_definition`.
5254

53-
You can reference glossary terms with an inclusion that automatically updates and replaces content with the relevant links from [our glossary](/docs/reference/glossary/). When the glossary term is moused-over, the glossary entry displays a tooltip. The glossary term also displays as a link.
55+
You can reference glossary terms with an inclusion that automatically updates
56+
and replaces content with the relevant links from [our glossary](/docs/reference/glossary/).
57+
When the glossary term is moused-over, the glossary entry displays a tooltip.
58+
The glossary term also displays as a link.
5459

5560
As well as inclusions with tooltips, you can reuse the definitions from the glossary in
5661
page content.
5762

58-
The raw data for glossary terms is stored at [https://github.com/kubernetes/website/tree/main/content/en/docs/reference/glossary](https://github.com/kubernetes/website/tree/main/content/en/docs/reference/glossary), with a content file for each glossary term.
63+
The raw data for glossary terms is stored at
64+
[the glossary directory](https://github.com/kubernetes/website/tree/main/content/en/docs/reference/glossary),
65+
with a content file for each glossary term.
5966

6067
### Glossary demo
6168

62-
For example, the following include within the Markdown renders to {{< glossary_tooltip text="cluster" term_id="cluster" >}} with a tooltip:
69+
For example, the following include within the Markdown renders to
70+
{{< glossary_tooltip text="cluster" term_id="cluster" >}} with a tooltip:
6371

6472
```
6573
{{</* glossary_tooltip text="cluster" term_id="cluster" */>}}
@@ -85,7 +93,9 @@ which renders as:
8593

8694
## Links to API Reference
8795

88-
You can link to a page of the Kubernetes API reference using the `api-reference` shortcode, for example to the {{< api-reference page="workload-resources/pod-v1" >}} reference:
96+
You can link to a page of the Kubernetes API reference using the
97+
`api-reference` shortcode, for example to the
98+
{{< api-reference page="workload-resources/pod-v1" >}} reference:
8999

90100
```
91101
{{</* api-reference page="workload-resources/pod-v1" */>}}
@@ -94,25 +104,31 @@ You can link to a page of the Kubernetes API reference using the `api-reference`
94104
The content of the `page` parameter is the suffix of the URL of the API reference page.
95105

96106

97-
You can link to a specific place into a page by specifying an `anchor` parameter, for example to the {{< api-reference page="workload-resources/pod-v1" anchor="PodSpec" >}} reference or the {{< api-reference page="workload-resources/pod-v1" anchor="environment-variables" >}} section of the page:
107+
You can link to a specific place into a page by specifying an `anchor`
108+
parameter, for example to the {{< api-reference page="workload-resources/pod-v1" anchor="PodSpec" >}}
109+
reference or the {{< api-reference page="workload-resources/pod-v1" anchor="environment-variables" >}}
110+
section of the page:
98111

99112
```
100113
{{</* api-reference page="workload-resources/pod-v1" anchor="PodSpec" */>}}
101114
{{</* api-reference page="workload-resources/pod-v1" anchor="environment-variables" */>}}
102115
```
103116

104117

105-
You can change the text of the link by specifying a `text` parameter, for example by linking to the {{< api-reference page="workload-resources/pod-v1" anchor="environment-variables" text="Environment Variables">}} section of the page:
118+
You can change the text of the link by specifying a `text` parameter, for
119+
example by linking to the
120+
{{< api-reference page="workload-resources/pod-v1" anchor="environment-variables" text="Environment Variables">}}
121+
section of the page:
106122

107123
```
108124
{{</* api-reference page="workload-resources/pod-v1" anchor="environment-variables" text="Environment Variable" */>}}
109125
```
110126

111-
112-
113127
## Table captions
114128

115-
You can make tables more accessible to screen readers by adding a table caption. To add a [caption](https://www.w3schools.com/tags/tag_caption.asp) to a table, enclose the table with a `table` shortcode and specify the caption with the `caption` parameter.
129+
You can make tables more accessible to screen readers by adding a table caption. To add a
130+
[caption](https://www.w3schools.com/tags/tag_caption.asp) to a table,
131+
enclose the table with a `table` shortcode and specify the caption with the `caption` parameter.
116132

117133
{{< note >}}
118134
Table captions are visible to screen readers but invisible when viewed in standard HTML.
@@ -138,22 +154,34 @@ Parameter | Description | Default
138154
`logLevel` | The log level for log output | `INFO`
139155
{{< /table >}}
140156

141-
If you inspect the HTML for the table, you should see this element immediately after the opening `<table>` element:
157+
If you inspect the HTML for the table, you should see this element immediately
158+
after the opening `<table>` element:
142159

143160
```html
144161
<caption style="display: none;">Configuration parameters</caption>
145162
```
146163

147164
## Tabs
148165

149-
In a markdown page (`.md` file) on this site, you can add a tab set to display multiple flavors of a given solution.
166+
In a markdown page (`.md` file) on this site, you can add a tab set to display
167+
multiple flavors of a given solution.
150168

151169
The `tabs` shortcode takes these parameters:
152170

153171
* `name`: The name as shown on the tab.
154-
* `codelang`: If you provide inner content to the `tab` shortcode, you can tell Hugo what code language to use for highlighting.
155-
* `include`: The file to include in the tab. If the tab lives in a Hugo [leaf bundle](https://gohugo.io/content-management/page-bundles/#leaf-bundles), the file -- which can be any MIME type supported by Hugo -- is looked up in the bundle itself. If not, the content page that needs to be included is looked up relative to the current page. Note that with the `include`, you do not have any shortcode inner content and must use the self-closing syntax. For example, <code>{{</* tab name="Content File #1" include="example1" /*/>}}</code>. The language needs to be specified under `codelang` or the language is taken based on the file name. Non-content files are code-highlighted by default.
156-
* If your inner content is markdown, you must use the `%`-delimiter to surround the tab. For example, `{{%/* tab name="Tab 1" %}}This is **markdown**{{% /tab */%}}`
172+
* `codelang`: If you provide inner content to the `tab` shortcode, you can tell Hugo
173+
what code language to use for highlighting.
174+
* `include`: The file to include in the tab. If the tab lives in a Hugo
175+
[leaf bundle](https://gohugo.io/content-management/page-bundles/#leaf-bundles),
176+
the file -- which can be any MIME type supported by Hugo -- is looked up in the bundle itself.
177+
If not, the content page that needs to be included is looked up relative to the current page.
178+
Note that with the `include`, you do not have any shortcode inner content and must use the
179+
self-closing syntax. For example,
180+
`{{</* tab name="Content File #1" include="example1" /*/>}}`. The language needs to be specified
181+
under `codelang` or the language is taken based on the file name.
182+
Non-content files are code-highlighted by default.
183+
* If your inner content is markdown, you must use the `%`-delimiter to surround the tab.
184+
For example, `{{%/* tab name="Tab 1" %}}This is **markdown**{{% /tab */%}}`
157185
* You can combine the variations mentioned above inside a tab set.
158186

159187
Below is a demo of the tabs shortcode.
@@ -288,13 +316,17 @@ The two most commonly used version parameters are `latest` and `version`.
288316

289317
### `{{</* param "version" */>}}`
290318

291-
The `{{</* param "version" */>}}` shortcode generates the value of the current version of
292-
the Kubernetes documentation from the `version` site parameter. The `param` shortcode accepts the name of one site parameter, in this case: `version`.
319+
The `{{</* param "version" */>}}` shortcode generates the value of the current
320+
version of the Kubernetes documentation from the `version` site parameter. The
321+
`param` shortcode accepts the name of one site parameter, in this case:
322+
`version`.
293323

294324
{{< note >}}
295-
In previously released documentation, `latest` and `version` parameter values are not equivalent.
296-
After a new version is released, `latest` is incremented and the value of `version` for the documentation set remains unchanged. For example, a previously released version of the documentation displays `version` as
297-
`v1.19` and `latest` as `v1.20`.
325+
In previously released documentation, `latest` and `version` parameter values
326+
are not equivalent. After a new version is released, `latest` is incremented
327+
and the value of `version` for the documentation set remains unchanged. For
328+
example, a previously released version of the documentation displays `version`
329+
as `v1.19` and `latest` as `v1.20`.
298330
{{< /note >}}
299331

300332
Renders to:
@@ -313,7 +345,8 @@ Renders to:
313345

314346
### `{{</* latest-semver */>}}`
315347

316-
The `{{</* latest-semver */>}}` shortcode generates the value of `latest` without the "v" prefix.
348+
The `{{</* latest-semver */>}}` shortcode generates the value of `latest`
349+
without the "v" prefix.
317350

318351
Renders to:
319352

@@ -330,8 +363,9 @@ Renders to:
330363

331364
### `{{</* latest-release-notes */>}}`
332365

333-
The `{{</* latest-release-notes */>}}` shortcode generates a version string from `latest` and removes
334-
the "v" prefix. The shortcode prints a new URL for the release note CHANGELOG page with the modified version string.
366+
The `{{</* latest-release-notes */>}}` shortcode generates a version string
367+
from `latest` and removes the "v" prefix. The shortcode prints a new URL for
368+
the release note CHANGELOG page with the modified version string.
335369

336370
Renders to:
337371

@@ -344,3 +378,4 @@ Renders to:
344378
* Learn about [page content types](/docs/contribute/style/page-content-types/).
345379
* Learn about [opening a pull request](/docs/contribute/new-content/open-a-pr/).
346380
* Learn about [advanced contributing](/docs/contribute/advanced/).
381+

0 commit comments

Comments
 (0)