Skip to content
GitHub

Markdown syntax

Most content in the documentation projects are written in Markdown. This page touches on some high-level Markdown topics. For more information on Markdown syntax, see:

Frontmatter YAML is used to define metadata such as a title and description.

Escape a character by adding a backslash before the character.

For example, to show {client_domain/jwks.json} in plain text (as shown here), without Starlight giving you an error, you’d need to format it like this:

\{client_domain/jwks.json}

Most files require a title in their frontmatter.

---
title: Remember to set this
---

One scenario in which a title is not required is when the file is a partial.

Check the full list of frontmatter configuration for more fun options.

Images in Starlight use Astro’s built-in optimized asset support.

We standardise our image location for every project to be in the /public/img folder. Start with /img/ when calling an image.

/// src/content/docs/introduction/architecture.md
![Architecture diagram](/img/rafiki-architecture.png)

You may want to further organise the img folder with subfolders if the project has a lot of images.

Starlight automatically uses your page title as a top-level heading and includes an “Overview” heading at top of each page’s table of contents. Starlight doesn’t provide a native way hide “Overview” or change the wording. However, we do have the RemoveOverview component.

Using headings in Markdown will automatically give you anchor links so you can link directly to certain sections of your page:

Level 2 (<h2>) and Level 3 (<h3>) headings automatically appear in a page’s table of contents. Starlight allows you to override this behavior.

Starlight uses Astro’s Markdown and MDX renderer built on remark and rehype. You can add support for custom syntax and behavior by adding remarkPlugins or rehypePlugins in your Astro config file. See “Configuring Markdown and MDX” in the Astro docs to learn more.

Use our custom Mermaid component to add Mermaid diagrams to the docs.

$currencyAmount = \frac{value}{10^{assetScale}}$