Markdown
Extensions
In this section, we'll look at at the Markdown extensions and components available to you when writing documentation.
Header Anchors
Header tags such as # Heading 1
, ## Heading 2
, and so on will automatically include
anchor tags. When clicked the browser will jump to that heading. Try hovering over any heading
on this page and clicking the #
.
Links
Links will be mapped to the correct slug and can be set in any of the following ways:
Frontmatter
YAML frontmatter is supported.
Table of Contents
The following will output a list containing all the headings on the page.
GitHub Tables
Admonitions
Note
This is a note.
Info
This is informational.
Tip
This is a tip.
Warning
This is a warning.
Danger
This is dangerous.
Experimental
This is experimental.
Emojis
You can find a list of all available emojis here.
Emojis are awesome 🎉
Yes/No
You should do this.
You should NOT do this.
Steps
Step 1
This is a description for step 1.
Step 2
This is a description for step 2 with markdown syntax
code
.
Vertical Orientaton
Step 1
This is a description for step 1.
Code Fence
You can find all supported languages here.
Default
Title
Slot
Terminal
Copy
Line Numbers
Line Highlights
You can highlight specified lines of your code blocks by adding line markers to your fenced code blocks.
- Single Line:
{1}
- Line Ranges:
{2-6}
- Multiple Lines:
{2,4-10,12,14,16-20}
Copy Highlight
Copy Steps
This will step through the code line by line, highlight it and copy it. Each time you tap the copy button it'll move to the next line.
Copy Highlight Steps
This will step through each of the highlighted ranges and copy them one by one. Each time you tap the copy button it'll move to the next highlighted range.
Multiple Options
Provide multiple options by separating them with a vertical bar |
:
Imported Code Fence
You can import code blocks from files with the following syntax:
If you want to partially import the file:
The code language is inferred from the file extension, however, you can specify it like so:
In fact, the second part inside the []
will be treated as the mark of the code fence, so it
supports all the syntax mentioned above: