2018-05-15 22:30:27 +00:00
|
|
|
---
|
|
|
|
title: Docs smoke test page
|
|
|
|
main_menu: false
|
|
|
|
---
|
|
|
|
|
|
|
|
This page serves two purposes:
|
|
|
|
|
|
|
|
- Demonstrate how the Kubernetes documentation uses Markdown
|
|
|
|
- Provide a "smoke test" document we can use to test HTML, CSS, and template
|
|
|
|
changes that affect the overall documentation.
|
|
|
|
|
|
|
|
## Heading levels
|
|
|
|
|
|
|
|
The above heading is an H2. The page title renders as an H1. The following
|
|
|
|
sections show H3-H6.
|
|
|
|
|
|
|
|
### H3
|
|
|
|
|
|
|
|
This is in an H3 section.
|
|
|
|
|
|
|
|
#### H4
|
|
|
|
|
|
|
|
This is in an H4 section.
|
|
|
|
|
|
|
|
##### H5
|
|
|
|
|
|
|
|
This is in an H5 section.
|
|
|
|
|
|
|
|
###### H6
|
|
|
|
|
|
|
|
This is in an H6 section.
|
|
|
|
|
|
|
|
## Inline elements
|
|
|
|
|
|
|
|
Inline elements show up within the text of paragraph, list item, admonition, or
|
|
|
|
other block-level element.
|
|
|
|
|
|
|
|
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor
|
|
|
|
incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis
|
|
|
|
nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.
|
|
|
|
Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu
|
|
|
|
fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
|
|
|
|
culpa qui officia deserunt mollit anim id est laborum.
|
|
|
|
|
|
|
|
### Inline text styles
|
|
|
|
|
|
|
|
- **bold**
|
|
|
|
- _italic_
|
|
|
|
- ***bold italic***
|
|
|
|
- ~~strikethrough~~
|
|
|
|
- <u>underline</u>
|
|
|
|
- _<u>underline italic</u>_
|
|
|
|
- **<u>underline bold</u>**
|
|
|
|
- ***<u>underline bold italic</u>***
|
|
|
|
- `monospace text`
|
|
|
|
- **`monospace bold`**
|
|
|
|
|
|
|
|
## Lists
|
|
|
|
|
2018-06-06 22:18:25 +00:00
|
|
|
Markdown doesn't have strict rules about how to process lists. When we moved
|
|
|
|
from Jekyll to Hugo, we broke some lists. To fix them, keep the following in
|
|
|
|
mind:
|
|
|
|
|
2020-10-26 08:50:29 +00:00
|
|
|
- Make sure you indent sub-list items **2 spaces**.
|
2018-06-06 22:18:25 +00:00
|
|
|
|
|
|
|
- To end a list and start another, you need a HTML comment block on a new line
|
|
|
|
between the lists, flush with the left-hand border. The first list won't end
|
|
|
|
otherwise, no matter how many blank lines you put between it and the second.
|
|
|
|
|
2018-05-15 22:30:27 +00:00
|
|
|
### Bullet lists
|
|
|
|
|
|
|
|
- This is a list item
|
|
|
|
* This is another list item in the same list
|
|
|
|
- You can mix `-` and `*`
|
2020-10-26 08:50:29 +00:00
|
|
|
- To make a sub-item, indent two spaces.
|
|
|
|
- This is a sub-sub-item. Indent two more spaces.
|
|
|
|
- Another sub-item.
|
2018-05-15 22:30:27 +00:00
|
|
|
|
2018-06-06 22:18:25 +00:00
|
|
|
<!-- separate lists -->
|
2018-05-15 22:30:27 +00:00
|
|
|
|
2018-06-06 22:18:25 +00:00
|
|
|
- This is a new list. With Hugo, you need to use a HTML comment to separate two
|
|
|
|
consecutive lists. **The HTML comment needs to be at the left margin.**
|
2018-05-15 22:30:27 +00:00
|
|
|
- Bullet lists can have paragraphs or block elements within them.
|
|
|
|
|
2020-10-26 08:50:29 +00:00
|
|
|
Indent the content to be the same as the first line of the bullet point.
|
|
|
|
**This paragraph and the code block line up with the first `B` in `Bullet`
|
|
|
|
above.**
|
2018-05-15 22:30:27 +00:00
|
|
|
|
2020-10-26 08:50:29 +00:00
|
|
|
```bash
|
|
|
|
ls -l
|
|
|
|
```
|
2018-06-19 18:01:32 +00:00
|
|
|
|
2020-10-26 08:50:29 +00:00
|
|
|
- And a sub-list after some block-level content
|
2018-06-19 18:01:32 +00:00
|
|
|
|
2018-05-15 22:30:27 +00:00
|
|
|
- A bullet list item can contain a numbered list.
|
2018-06-06 22:18:25 +00:00
|
|
|
1. Numbered sub-list item 1
|
|
|
|
2. Numbered sub-list item 2
|
2018-05-15 22:30:27 +00:00
|
|
|
|
|
|
|
### Numbered lists
|
|
|
|
|
|
|
|
1. This is a list item
|
|
|
|
2. This is another list item in the same list. The number you use in Markdown
|
|
|
|
does not necessarily correlate to the number in the final output. By
|
|
|
|
convention, we keep them in sync.
|
2018-06-06 22:18:25 +00:00
|
|
|
3. {{<note>}}
|
|
|
|
For single-digit numbered lists, using two spaces after the period makes
|
2018-05-15 22:30:27 +00:00
|
|
|
interior block-level content line up better along tab-stops.
|
2018-06-06 22:18:25 +00:00
|
|
|
{{</note>}}
|
2018-05-15 22:30:27 +00:00
|
|
|
|
2018-06-06 22:18:25 +00:00
|
|
|
<!-- separate lists -->
|
2018-05-15 22:30:27 +00:00
|
|
|
|
2018-06-06 22:18:25 +00:00
|
|
|
1. This is a new list. With Hugo, you need to use a HTML comment to separate
|
|
|
|
two consecutive lists. **The HTML comment needs to be at the left margin.**
|
2018-05-15 22:30:27 +00:00
|
|
|
2. Numbered lists can have paragraphs or block elements within them.
|
|
|
|
|
2020-10-26 08:50:29 +00:00
|
|
|
Just indent the content to be the same as the first line of the bullet
|
|
|
|
point. **This paragraph and the code block line up with the `N` in
|
|
|
|
`Numbered` above.**
|
2018-05-15 22:30:27 +00:00
|
|
|
|
2020-10-26 08:50:29 +00:00
|
|
|
```bash
|
|
|
|
ls -l
|
|
|
|
```
|
2018-06-19 18:01:32 +00:00
|
|
|
|
2018-06-06 22:18:25 +00:00
|
|
|
- And a sub-list after some block-level content. This is at the same
|
|
|
|
"level" as the paragraph and code block above, despite being indented
|
|
|
|
more.
|
2018-05-15 22:30:27 +00:00
|
|
|
|
2018-06-19 18:01:32 +00:00
|
|
|
### Tab lists
|
|
|
|
|
|
|
|
Tab lists can be used to conditionally display content, e.g., when multiple
|
|
|
|
options must be documented that require distinct instructions or context.
|
|
|
|
|
|
|
|
{{< tabs name="tab_lists_example" >}}
|
|
|
|
{{% tab name="Choose one..." %}}
|
|
|
|
Please select an option.
|
|
|
|
{{% /tab %}}
|
|
|
|
{{% tab name="Formatting tab lists" %}}
|
|
|
|
|
|
|
|
Tabs may also nest formatting styles.
|
|
|
|
|
|
|
|
1. Ordered
|
|
|
|
1. (Or unordered)
|
|
|
|
1. Lists
|
|
|
|
|
|
|
|
```bash
|
2019-06-11 02:42:16 +00:00
|
|
|
echo 'Tab lists may contain code blocks!'
|
2018-06-19 18:01:32 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
{{% /tab %}}
|
|
|
|
{{% tab name="Nested headers" %}}
|
|
|
|
|
|
|
|
### Header within a tab list
|
|
|
|
|
|
|
|
Nested header tags may also be included.
|
|
|
|
|
|
|
|
{{< warning >}}
|
2018-11-06 19:33:04 +00:00
|
|
|
Headers within tab lists will not appear in the Table of Contents.
|
2018-06-19 18:01:32 +00:00
|
|
|
{{< /warning >}}
|
|
|
|
|
|
|
|
{{% /tab %}}
|
|
|
|
{{< /tabs >}}
|
2018-05-15 22:30:27 +00:00
|
|
|
|
|
|
|
### Checklists
|
|
|
|
|
2018-06-19 18:01:32 +00:00
|
|
|
Checklists are technically bullet lists, but the bullets are suppressed by CSS.
|
2018-06-06 22:18:25 +00:00
|
|
|
|
2018-05-15 22:30:27 +00:00
|
|
|
- [ ] This is a checklist item
|
|
|
|
- [x] This is a selected checklist item
|
|
|
|
|
|
|
|
## Code blocks
|
|
|
|
|
2018-06-06 22:18:25 +00:00
|
|
|
You can create code blocks two different ways by surrounding the code block with
|
|
|
|
three back-tick characters on lines before and after the code block. **Only use
|
|
|
|
back-ticks (code fences) for code blocks.** This allows you to specify the
|
|
|
|
language of the enclosed code, which enables syntax highlighting. It is also more
|
|
|
|
predictable than using indentation.
|
2018-05-15 22:30:27 +00:00
|
|
|
|
2018-06-06 22:18:25 +00:00
|
|
|
```
|
|
|
|
this is a code block created by back-ticks
|
|
|
|
```
|
2018-05-15 22:30:27 +00:00
|
|
|
|
|
|
|
The back-tick method has some advantages.
|
|
|
|
|
2018-06-06 22:18:25 +00:00
|
|
|
- It works nearly every time
|
2018-05-15 22:30:27 +00:00
|
|
|
- It is more compact when viewing the source code.
|
|
|
|
- It allows you to specify what language the code block is in, for syntax
|
|
|
|
highlighting.
|
|
|
|
- It has a definite ending. Sometimes, the indentation method breaks with
|
|
|
|
languages where spacing is significant, like Python or YAML.
|
|
|
|
|
|
|
|
To specify the language for the code block, put it directly after the first
|
|
|
|
grouping of back-ticks:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
ls -l
|
|
|
|
```
|
|
|
|
|
2018-06-06 22:18:25 +00:00
|
|
|
Common languages used in Kubernetes documentation code blocks include:
|
|
|
|
|
|
|
|
- `bash` / `shell` (both work the same)
|
|
|
|
- `go`
|
|
|
|
- `json`
|
|
|
|
- `yaml`
|
|
|
|
- `xml`
|
|
|
|
- `none` (disables syntax highlighting for the block)
|
|
|
|
|
2018-08-06 23:15:57 +00:00
|
|
|
### Code blocks containing Hugo shortcodes
|
|
|
|
|
|
|
|
To show raw Hugo shortcodes as in the above example and prevent Hugo
|
|
|
|
from interpreting them, use C-style comments directly after the `<` and before
|
|
|
|
the `>` characters. The following example illustrates this (view the Markdown
|
|
|
|
source for this page).
|
|
|
|
|
|
|
|
```none
|
|
|
|
{{</* codenew file="pods/storage/gce-volume.yaml" */>}}
|
|
|
|
```
|
2018-06-06 22:18:25 +00:00
|
|
|
|
2018-05-15 22:30:27 +00:00
|
|
|
## Links
|
|
|
|
|
|
|
|
To format a link, put the link text inside square brackets, followed by the
|
|
|
|
link target in parentheses. [Link to Kubernetes.io](https://kubernetes.io/) or
|
|
|
|
[Relative link to Kubernetes.io](/)
|
|
|
|
|
|
|
|
You can also use HTML, but it is not preferred.
|
|
|
|
<a href="https://kubernetes.io/">Link to Kubernetes.io</a>
|
|
|
|
|
|
|
|
## Images
|
|
|
|
|
|
|
|
To format an image, use similar syntax to [links](#links), but add a leading `!`
|
|
|
|
character. The square brackets contain the image's alt text. Try to always use
|
|
|
|
alt text so that people using screen readers can get some benefit from the
|
|
|
|
image.
|
|
|
|
|
2020-10-26 08:50:29 +00:00
|
|
|
![pencil icon](/images/pencil.png)
|
2018-05-15 22:30:27 +00:00
|
|
|
|
2018-06-04 23:59:54 +00:00
|
|
|
To specify extended attributes, such as width, title, caption, etc, use the
|
|
|
|
<a href="https://gohugo.io/content-management/shortcodes/#figure">figure shortcode</a>,
|
|
|
|
which is preferred to using a HTML `<img>` tag. Also, if you need the image to
|
|
|
|
also be a hyperlink, use the `link` attribute, rather than wrapping the whole
|
|
|
|
figure in Markdown link syntax as shown below.
|
|
|
|
|
2020-10-26 08:50:29 +00:00
|
|
|
{{< figure src="/images/pencil.png" title="Pencil icon" caption="Image used to illustrate the figure shortcode" width="200px" >}}
|
2018-06-04 23:59:54 +00:00
|
|
|
|
|
|
|
Even if you choose not to use the figure shortcode, an image can also be a link. This
|
|
|
|
time the pencil icon links to the Kubernetes website. Outer square brackets enclose
|
|
|
|
the entire image tag, and the link target is in the parentheses at the end.
|
2018-05-15 22:30:27 +00:00
|
|
|
|
2020-10-26 08:50:29 +00:00
|
|
|
[![pencil icon](/images/pencil.png)](https://kubernetes.io)
|
2018-05-15 22:30:27 +00:00
|
|
|
|
|
|
|
You can also use HTML for images, but it is not preferred.
|
|
|
|
|
2020-10-26 08:50:29 +00:00
|
|
|
<img src="/images/pencil.png" alt="pencil icon" />
|
2018-05-15 22:30:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Tables
|
|
|
|
|
|
|
|
Simple tables have one row per line, and columns are separated by `|`
|
|
|
|
characters. The header is separated from the body by cells containing nothing
|
|
|
|
but at least three `-` characters. For ease of maintenance, try to keep all the
|
|
|
|
cell separators even, even if you heed to use extra space.
|
|
|
|
|
|
|
|
| Heading cell 1 | Heading cell 2 |
|
|
|
|
|----------------|----------------|
|
|
|
|
| Body cell 1 | Body cell 2 |
|
|
|
|
|
|
|
|
The header is optional. Any text separated by `|` will render as a table.
|
|
|
|
|
|
|
|
Markdown tables have a hard time with block-level elements within cells, such as
|
|
|
|
list items, code blocks, or multiple paragraphs. For complex or very wide
|
|
|
|
tables, use HTML instead.
|
|
|
|
|
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Heading cell 1</th>
|
|
|
|
<th>Heading cell 2</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>Body cell 1</td>
|
|
|
|
<td>Body cell 2</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2020-04-19 01:32:28 +00:00
|
|
|
## Visualizations with Mermaid
|
|
|
|
|
2020-07-27 16:36:27 +00:00
|
|
|
You can use [Mermaid JS](https://mermaidjs.github.io) visualizations.
|
|
|
|
The Mermaid JS version is specified in [/layouts/partials/head.html](https://github.com/kubernetes/website/blob/master/layouts/partials/head.html)
|
2020-04-19 01:32:28 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
{{</* mermaid */>}}
|
|
|
|
graph TD;
|
|
|
|
A-->B;
|
|
|
|
A-->C;
|
|
|
|
B-->D;
|
|
|
|
C-->D;
|
|
|
|
{{</*/ mermaid */>}}
|
|
|
|
```
|
|
|
|
|
|
|
|
Produces:
|
|
|
|
|
|
|
|
{{< mermaid >}}
|
|
|
|
graph TD;
|
|
|
|
A-->B;
|
|
|
|
A-->C;
|
|
|
|
B-->D;
|
|
|
|
C-->D;
|
|
|
|
{{</ mermaid >}}
|
|
|
|
|
|
|
|
```
|
|
|
|
{{</* mermaid */>}}
|
|
|
|
sequenceDiagram
|
|
|
|
Alice ->> Bob: Hello Bob, how are you?
|
|
|
|
Bob-->>John: How about you John?
|
|
|
|
Bob--x Alice: I am good thanks!
|
|
|
|
Bob-x John: I am good thanks!
|
|
|
|
Note right of John: Bob thinks a long<br/>long time, so long<br/>that the text does<br/>not fit on a row.
|
|
|
|
|
|
|
|
Bob-->Alice: Checking with John...
|
|
|
|
Alice->John: Yes... John, how are you?
|
|
|
|
{{</*/ mermaid */>}}
|
|
|
|
```
|
|
|
|
|
|
|
|
Produces:
|
|
|
|
|
|
|
|
{{< mermaid >}}
|
|
|
|
sequenceDiagram
|
|
|
|
Alice ->> Bob: Hello Bob, how are you?
|
|
|
|
Bob-->>John: How about you John?
|
|
|
|
Bob--x Alice: I am good thanks!
|
|
|
|
Bob-x John: I am good thanks!
|
|
|
|
Note right of John: Bob thinks a long<br/>long time, so long<br/>that the text does<br/>not fit on a row.
|
|
|
|
|
|
|
|
Bob-->Alice: Checking with John...
|
|
|
|
Alice->John: Yes... John, how are you?
|
|
|
|
{{</ mermaid >}}
|
|
|
|
|
|
|
|
<br>More [examples](https://mermaid-js.github.io/mermaid/#/examples) from the offical docs.
|
|
|
|
|
2018-05-15 22:30:27 +00:00
|
|
|
## Sidebars and Admonitions
|
|
|
|
|
|
|
|
Sidebars and admonitions provide ways to add visual importance to text. Use
|
|
|
|
them sparingly.
|
|
|
|
|
|
|
|
### Sidebars
|
|
|
|
|
|
|
|
A sidebar offsets text visually, but without the visual prominence of
|
|
|
|
[admonitions](#admonitions).
|
|
|
|
|
|
|
|
> This is a sidebar.
|
|
|
|
>
|
|
|
|
> You can have paragraphs and block-level elements within a sidebar.
|
|
|
|
>
|
|
|
|
> You can even have code blocks.
|
|
|
|
>
|
|
|
|
> ```bash
|
|
|
|
> sudo dmesg
|
|
|
|
> ```
|
|
|
|
>
|
|
|
|
|
|
|
|
### Admonitions
|
|
|
|
|
|
|
|
Admonitions (notes, warnings, etc) use Hugo shortcodes.
|
|
|
|
|
|
|
|
{{< note >}}
|
2018-11-06 19:33:04 +00:00
|
|
|
Notes catch the reader's attention without a sense of urgency.
|
2018-05-15 22:30:27 +00:00
|
|
|
|
|
|
|
You can have multiple paragraphs and block-level elements inside an admonition.
|
|
|
|
|
|
|
|
| Or | a | table |
|
|
|
|
{{< /note >}}
|
|
|
|
|
|
|
|
{{< caution >}}
|
2018-11-06 19:33:04 +00:00
|
|
|
The reader should proceed with caution.
|
2018-05-15 22:30:27 +00:00
|
|
|
{{< /caution >}}
|
|
|
|
|
|
|
|
|
|
|
|
{{< warning >}}
|
2018-11-06 19:33:04 +00:00
|
|
|
Warnings point out something that could cause harm if ignored.
|
2018-05-15 22:30:27 +00:00
|
|
|
{{< /warning >}}
|
2018-06-19 18:01:32 +00:00
|
|
|
|
2018-08-21 18:28:58 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Includes
|
|
|
|
|
|
|
|
To add shortcodes to includes.
|
|
|
|
|
|
|
|
{{< note >}}
|
2019-03-12 20:38:39 +00:00
|
|
|
{{< include "task-tutorial-prereqs.md" >}}
|
2018-08-21 18:28:58 +00:00
|
|
|
{{< /note >}}
|
2018-09-13 22:45:54 +00:00
|
|
|
|
|
|
|
## Katacoda Embedded Live Environment
|
|
|
|
|
|
|
|
{{< kat-button >}}
|