Description: This file contains the syntax for commonly used Markdown and MyST markup. Open it in your text editor to quickly copy and paste the markup you need. See the MyST style guide for detailed informatio...

Hide navigation sidebar
Hide table of contents sidebar
Skip to content
Back to top
View this page
Toggle table of contents sidebar

# Markdown/MyST cheat sheet

This file contains the syntax for commonly used Markdown and MyST markup. Open it in your text editor to quickly copy and paste the markup you need.

See the MyST style guide for detailed information and conventions.

Also see the MyST documentation for detailed information on MyST, and the Canonical Documentation Style Guide for general style conventions.

## H2 heading

### H3 heading

#### H4 heading

##### H5 heading

## Inline formatting

- UI element

- `code`

- command

- `Key`

- Italic

- Bold

## Code blocks

Start a code block:

    code:
      - example: true

    # Demonstrate a code block
    code:
      - example: true

    # Demonstrate a code block
    code:
      - example: true

## Links

- Canonical website

- Links

- Link text

- LXD

- Link text

## Navigation

Use the following syntax::

    ```{toctree}
    :hidden:

    sub-page1
    sub-page2
    ```

## Lists

1. Step 1

   - Item 1

     - Sub-item

   - Item 2

     1. Sub-step 1

     2. Sub-step 2

2. Step 2

   1. Sub-step 1

      - Item

   2. Sub-step 2

Term 1

  Definition

Term 2

  Definition

## Tables

## Markdown tables

Header 1 | Header 2
--- | ---
Cell 1 Second paragraph | Cell 2
Cell 3 | Cell 4

Centered:

Header 1 | Header 2
--- | ---
Cell 1 Second paragraph | Cell 2
Cell 3 | Cell 4

## List tables

Header 1 | Header 2
--- | ---
Cell 1 Second paragraph | Cell 2
Cell 3 | Cell 4

Centered:

Header 1 | Header 2
--- | ---
Cell 1 Second paragraph | Cell 2
Cell 3 | Cell 4

## Notes

Note

A note.

Tip

A tip.

Important

Important information

Caution

This might damage your hardware!

## Images

Figure caption

## Reuse

### Keys

Keys can be defined at the top of a file, or in a `myst_substitutions` option in `conf.py`.

This is included text.

This is a substitution that includes a code block: `code block`

### File inclusion

    LXD is free software and released under [AGPL-3.0-only](https://www.gnu.org/licenses/agpl-3.0.en.html) (it may contain some contributions that are licensed under the Apache-2.0 license, see [License and copyright](contributing)).
    It’s an open source project that warmly welcomes community projects, contributions, suggestions, fixes and constructive feedback.

## Tabs

Content Tab 1

Content Tab 2

## Glossary

some term

  Definition of the example term.

some term

## More useful markup

- Added in version X.Y.

- API

## Custom extensions

Related links at the top of the page (surrounded by `---`):

    relatedlinks: https://github.com/canonical/lxd-sphinx-extensions, [RTFM](https://www.google.com)
    discourse: 12345

Terms that should not be checked by the spelling checker: PurposelyWrong

A single-line terminal view that separates input from output:

`root@vampyr:/home/user/directory/#` `command`
`the output`

A multi-line version of the same:

`root@vampyr:/home/user/directory/#` `command 1`
`output 1`
`root@vampyr:/home/user/directory/#` `command 2`
`output 2`

A link to a YouTube video:

▶ Watch on YouTube