Skip to content

Markdown tips ​

Headings ​

md
# h1 heading

## h2 heading

### h3 heading

#### h4 heading

##### h5 heading

###### h6 heading

Example ​

h1 heading ​

h2 heading ​

h3 heading ​

h4 heading ​

h5 heading ​
h6 heading ​

Horizontal rule ​

md
---

Example ​


Emphasis ​

md
**Bold text**
_Italic text_
~~Strikethrough text~~

Example ​

Bold text

Italic text

Strikethrough text

Quotes ​

md
> Quotes can
>
> > be nested

Example ​

Quotes can

be nested

Lists ​

Unordered ​

md
- Lists
  - can be
    - indented
  - second level

Example ​

  • Lists
    • can be
      • indented
    • second level

Ordered ​

md
1.  It doesn't matter
1.  what number the line
1.  is prepended with

Example ​

  1. It doesn't matter
  2. what number the line
  3. is prepended with

Message containers ​

md
::: tip
This is a tip
:::

::: warning
This is a warning
:::

::: danger
This is a danger warning
:::

Example ​

TIP

This is a tip

WARNING

This is a warning

DANGER

This is a danger warning

You can also customize the title of the block:

md
::: danger STOP
Danger, do not proceed
:::

Example ​

STOP

Danger, do not proceed

md
[External link](https://google.com)

[Link with title](https://google.com 'Title')

[Relative link](/lt/)

[Relative link to a block](/contribute/)

[Relative link to a chapter](/contribute/markdown-tips.md)

[Relative link to a section](/contribute/markdown-tips.md#message-containers)

Example ​

External link

Link with title

Relative link

Relative link to a block

Relative link to a chapter

Relative link to a section

WARNING

Don't forget to close off relative links with a ´/´, otherwise you will get a 404.

Images ​

md
![Alt text](/icons/android-chrome-192x192.png 'Title')

Example ​

Alt text

Code ​

Inline ​

md
Inline `code` on the same line

Example ​

Inline code on the same line

Code block ​

md
```js
var foo = function (bar) {
  return bar++;
};
```

Example ​

js
var foo = function (bar) {
  return bar++;
};

Line highlighting in a code block:

md
```js{2,3}
const foo = bar => {
  bar++;
  console.log(bar);
};
```

Example ​

js
const foo = bar => {
  bar++;
  console.log(bar);
};

Emoji 🎉 ​

md
:tada: :radio:

Example ​

🎉 📻

Vue components ​

In this project it is possible to use Vue components inside markdown files

.vitepress/theme/components/DoubleNumber.vue <<< @/.vitepress/theme/components/DoubleNumber.vue

md
<!-- *.md -->

<DoubleNumber />

Example ​

1

Tables ​

md
| Tables   |      Are      |  Cool |
| -------- | :-----------: | ----: |
| col 3 is | right-aligned | $1600 |
| col 2 is |   centered    |   $12 |

Example ​

TablesAreCool
col 3 isright-aligned$1600
col 2 iscentered$12

MIT Licensed