Nieuw: versie 0.0.99 is beschikbaar. Lees de release notes.

Op deze pagina
Deze pagina is nog niet vertaald. Je leest de originele versie. Bekijk originele pagina

Using Markdown

Pages are written in Markdown. Every example on this page renders live.

Syntax-highlighted code blocks ​

Highlighting uses grammar-based tokenization1 for about 65 bundled languages:

csharp
public sealed record Order(string Id, decimal Total)
{
    public bool IsLarge => Total > 1000m;
}
python
def fibonacci(n: int) -> int:
    if n < 2:
        return n
    return fibonacci(n - 1) + fibonacci(n - 2)
java
public class Greeter {
    public String greet(String name) {
        return "Hello, " + name + "!";
    }
}
rust
fn main() {
    let nums = vec![1, 2, 3];
    println!("{:?}", nums.iter().sum::<i32>());
}
sql
SELECT id, title FROM pages WHERE published = true ORDER BY title;

Aliases resolve to full grammar IDs: c#, cs and dotnet for C#, f# for F#, c++ for C++. Unknown languages render without highlighting.

Title bars ​

[filename] in the fence info string renders a title bar instead of the language badge:

md
```json [src/appsettings.json]
{
    "Hello": "world"
}
```

Renders as:

src/appsettings.json
json
{
    "Hello": "world"
}

Line highlighting ​

{n,m-o} in the fence info string highlights lines:

ts
function add(a: number, b: number) {
  return a + b; // this line is highlighted
}

A trailing // [!code highlight] comment also highlights a line; the comment is removed from output:

ts
const cache = new Map();
const ttlMs = 60_000;

Diff notation ​

ts
const port = 3000;
const port = process.env.PORT ?? 3000;

Focus ​

ts
function setup() {
  loadConfig();
  startServer();
}

Line numbers ​

ts
const a = 1;
const b = 2;
const c = a + b;

Code groups ​

This example:

md
::: code-group
```sh [npm]
npm install
```
```sh [pnpm]
pnpm install
```
```sh [c# icon:sharp]
dotnet restore
```
:::

Renders as:

sh
npm install
sh
pnpm install
sh
dotnet restore

[label] sets the tab title. Labels matching a Simple Icons name display that icon. [label icon:slug] sets the icon explicitly, for example [csharp icon:dotnet].

Alerts ​

GitHub-style alerts use > [!TYPE]:

Note

Important context.

Tip

Helpful advice.

Important

Required for success.

Warning

Immediate attention needed.

Caution

Potential negative risks.

Custom containers ​

Blocks delimited by ::: with a type: note, tip, info, warning, danger or details. details takes an optional summary text and renders as a disclosure.

Note

This is a note container.

TIP

This is a tip container.

INFO

This is an info container.

WARNING

This is a warning container.

DANGER

This is a danger container.

Click to expand

Hidden content goes here.

Containers render as <div class="TYPE custom-block">. Raw HTML (HyperText Markup Language) passes through, so the div can be written directly, for example to add an inline style:

md
<div class="tip custom-block">

Quick setup: [Getting Started](/guide/getting-started).

</div>

Renders as:

Quick setup: Getting Started.

A blank line is required after the opening <div> and before the closing </div>; otherwise the content is treated as raw HTML (HyperText Markup Language) and Markdown inside is not rendered.

Cards ​

::: cards renders a Markdown list as a grid of bordered cards. Each list item is one card.

Item content Card output
Leading link [Title](/path) Card title. The card is a link to /path.
Leading bold text **Title** Card title. The card has no link.
Remaining text and blocks Card body.

The optional argument sets the column count: ::: cards 3. Accepted values: 1 to 6. Other values are ignored.

  • If no argument is set: the content width sets the column count. Minimum card width: 260px.
  • If the viewport is narrower than 640px: the grid has one column.
md
::: cards 2
- [๐Ÿ™‹ How to ask for help](/guide/getting-started)
  Read this guide to learn how to ask for help.
- [๐Ÿงฉ Configuration](/guide/configuration)
  Every `config.json` option.
- **๐Ÿ“– No link**
  A card without a target.
:::

Renders as:

Badges ​

Inline labels written as HTML (HyperText Markup Language); <badge> is styled by the Bark stylesheet. See Badge.

md
Hello world <Badge type="tip">3.0+</Badge>

Renders as:

Hello world 3.0+

Types match the alert colors: info (blue), tip (green, default), warning (amber), danger (red).

info tip warning danger

DANGER

The closing tag is required: <Badge type="tip">text</Badge>. HTML (HyperText Markup Language) ignores /> on unknown elements, so <Badge text="x" /> stays open and absorbs the rest of the paragraph.

Definition lists ​

Terms followed by lines starting with : and a space produce a definition list.

Term 1
Definition of term 1.
Term 2
Definition of term 2.
Another definition of term 2.

Math ​

Inline: E=mc2E = mc^2

Block:

โˆ‘i=1ni=n(n+1)2\sum_{i=1}^{n} i = \frac{n(n+1)}{2}

Abbreviations ​

Abbreviation definitions at the end of a document wrap matching terms in <abbr>:

md
The spec is written by the WHATWG and served here over HTTP.

*[WHATWG]: Web Hypertext Application Technology Working Group
*[HTTP]: HyperText Transfer Protocol

Renders as:

The spec is written by the WHATWG (Web Hypertext Application Technology Working Group) and served here over HTTP (HyperText Transfer Protocol).

A definition applies to every occurrence on the page. Terms render with a dotted underline; the expansion appears on hover, and on tap on touch devices.

Citations ​

Text wrapped in doubled quotes ("") renders as a <cite> element:

The Art of Computer Programming

Standard Markdown ​

Tables, task lists and footnotes are supported:

Feature Supported
Tables โœ…
Task lists โœ…
Footnotes โœ…
  • Done
  • Not done yet

A sentence with a footnote.2

{target="_blank" rel="noopener"} after a link sets its attributes:

md
[Bark on GitHub](https://github.com/org/bark){target="_blank" rel="noopener"}

Video and media ​

Image syntax pointing at a video, audio or embed URL renders a native player. Media files are stored in docs/assets/:

md
![Demo clip](/assets/video.mp4)


  1. TextMateSharp.↩

  2. The footnote text.↩

Laatst bijgewerkt: 2026-10-29