Skip to content

Mermaid options, redirects and announcements are new.See the diagrams

ZenithDocs
English

Markdown

Standard Markdown, GitHub Flavored Markdown and a few extensions.

On this page

Pages are written in Markdown or MDX. ZenithDocs supports GitHub Flavored Markdown out of the box: tables, task lists, strikethrough, autolinks and footnotes.

Text formatting

You can use bold, italic, strikethrough, inline code and links. Keyboard keys use the HTML element: press Ctrl + K.

Blockquotes are useful to quote other sources.

  • Unordered lists
    • can be nested
  • and turned into task lists
  • like this one
  1. Ordered lists
  2. work too

Callouts

Use a container directive to highlight important information. The label between brackets replaces the default title.

GitHub alerts, the blockquote syntax GitHub uses for callouts, work too. Files render the same on GitHub and on your site:

The six types are note, tip, important, success, warning and danger. Aliases keep their own title: info is a note, idea a tip, check a success, warn a warning, and caution and error are dangers.

Headings

Headings from level 2 to 3 are listed in the table of contents, and each one gets an anchor link. Set a custom id by ending the heading with [#your-id].

A heading with a custom id

This heading can be linked to with #custom-id.

Diagrams

Code blocks whose language is mermaid are drawn as SVG when the site is built, with the colors of the site, so they follow dark mode. No diagram library is sent to the browser.

```mermaid
graph LR
  A[Markdown] --> B{Sätteri} --> C[HTML]
  B --> D[llms.txt]
```
Markdown Sätteri HTML llms.txt

Flowcharts, sequence, state, class and ER diagrams, and XY charts are supported. Other diagram types are shown as code, with a warning in the build output. Set mermaid.fallback to 'error' to fail the build instead.

Spacing and title

A keyword after mermaid sets the room between the nodes: compact, normal or wide. title adds a caption below the diagram.

```mermaid wide title="Build pipeline"
graph LR
  A[Markdown] --> B{Sätteri} --> C[HTML]
  B --> D[llms.txt]
```
Markdown Sätteri HTML llms.txt
Build pipeline
Markdown Sätteri HTML llms.txt

Colors and default spacing

The mermaid option changes the defaults for every diagram, and the colors the diagrams are drawn with.

astro.config.mjs
zenith({
  mermaid: {
    spacing: 'wide',
    colors: { line: 'var(--text-2)', surface: 'var(--background)' },
  },
});

Math

Turn on math to write TeX between $ for inline math and $$ for blocks:

astro.config.mjs
zenith({
  math: true,
});
The identity $e^{i\pi} + 1 = 0$ links five constants.

$$
\int_0^1 x^2 \, dx = \frac{1}{3}
$$

The identity eiπ+1=0e^{i\pi} + 1 = 0 links five constants.

∫01x2 dx=13\int_0^1 x^2 \, dx = \frac{1}{3}

Math is rendered with KaTeX to MathML, which browsers lay out natively: it costs no stylesheet, font or script. It is off by default because it gives dollar signs a meaning, so prices in existing content would become math.

Footnotes

Footnotes are collected at the end of the page.1

Footnotes

  1. Like this one. ↩

Last updated on