qwik-docs supports authoring content in .md and .mdx files, with frontmatter YAML to define metadata such as a title and description.
Content is compiled with MDX and the remark / rehype ecosystem.
The remark stage runs remark-gfm (GitHub Flavored Markdown) and remark-frontmatter.
The rehype stage runs syntax highlighting through Expressive Code, heading slugs, and heading anchor links.
This guide covers the syntax those stages support.
Append your own plugins to either stage with markdown.remarkPlugins and markdown.rehypePlugins; see Advanced Markdown and MDX configuration.
Frontmatter
Customize an individual page by setting values in its frontmatter.
Frontmatter is set at the top of the file between --- separators:
---
title: My page title
---
Page content follows the second `---`.
Every page must include a title.
When title is absent, qwik-docs derives one from the file name.
See the frontmatter reference for all available fields.
Unlike Astro Starlight, there is no slug frontmatter field.
A page's slug comes from its file path and its collection's URL prefix.
See Pages.
Inline styles
Text can be bold, italic, or strikethrough.
Text can be **bold**, _italic_, or ~~strikethrough~~.
Link to another page.
You can [link to another page](/docs/getting-started/).
Highlight inline code with backticks.
You can highlight `inline code` with backticks.
Images
Markdown and MDX support the Markdown syntax for displaying images, including alt-text for screen readers and assistive technology.


Astro Starlight resolves relative image paths and optimizes local assets through Astro's image() helper.
qwik-docs has no image() helper.
Reference images by an absolute URL, or by a path under the app's public/ directory so Vite serves them as static assets.
Headings
Structure content with a heading. Headings in Markdown are indicated by a number of # at the start of the line.
How to structure page content
qwik-docs uses the page title as the top-level heading and adds an "Overview" entry at the top of each page's table of contents.
Start each page with regular paragraph text and use on-page headings from <h2> and down:
---
title: Markdown Guide
description: How to use Markdown in qwik-docs
---
This page describes how to use Markdown in qwik-docs.
## Inline styles
## Headings
Automatic heading anchor links
Headings in Markdown get anchor links automatically, so you can link directly to sections of a page. qwik-docs generates a slug for each heading with rehype-slug and adds the anchor link with rehype-autolink-headings.
---
title: My page of content
description: How to use built-in anchor links
---
## Introduction
I can link to [my conclusion](#conclusion) lower on the same page.
## Conclusion
`https://my-site.com/page1/#introduction` navigates directly to my Introduction.
Level 2 (<h2>) and Level 3 (<h3>) headings appear in the page table of contents by default.
Adjust the range with the tableOfContents frontmatter field.
Asides
Asides (also known as "admonitions" or "callouts") display secondary information alongside a page's main content.
Astro Starlight provides a custom ::: Markdown syntax for asides.
qwik-docs does not wire up that syntax — there is no remark-directive plugin in the pipeline.
Use the <Aside> component instead.
Import it, then wrap your content.
An aside can be of type note, tip, caution, or danger.
You can nest any other content inside an aside, but asides are best suited to short and concise chunks of content.
Note aside
import { Aside } from '@qwik-docs/components/qwik/Aside';
<Aside type="note">
qwik-docs is a documentation website toolkit built with [Qwik](https://qwik.dev/). You can get started with this command:
```sh
npm create qwik@latest
```
</Aside>
Custom aside titles
Set a custom title with the title prop.
<Aside type="tip" title="Did you know?">
Qwik resumes the application on the client instead of hydrating it.
</Aside>
Custom aside icons
Set a custom icon with the icon prop.
The icon name must be the name of one of the built-in icons.
<Aside type="tip" icon="rocket">
Qwik resumes the application on the client instead of hydrating it.
</Aside>
More aside types
Caution and danger asides draw a reader's attention to details that may trip them up.
<Aside type="caution">
If you are not sure you want an awesome docs site, think twice before using qwik-docs.
</Aside>
<Aside type="danger">
qwik-docs ships several helpful features.
- Clear navigation
- User-configurable colour theme
- Full-text search through Pagefind
</Aside>
Blockquotes
This is a blockquote, which is commonly used when quoting another person or document.
Blockquotes are indicated by a
>at the start of each line.
> This is a blockquote, which is commonly used when quoting another person or document.
>
> Blockquotes are indicated by a `>` at the start of each line.
Code blocks
A code block is indicated by a block with three backticks ``` at the start and end. Name the programming language after the opening backticks.
// Javascript code with syntax highlighting.
var fun = function lang(l) {
dateformat.i18n = require('./lang/' + l);
return true;
};
```js
// Javascript code with syntax highlighting.
var fun = function lang(l) {
dateformat.i18n = require('./lang/' + l);
return true;
};
```
Syntax highlighting
qwik-docs highlights code blocks with Expressive Code, the same highlighter Astro Starlight uses. Highlighting is driven by the language identifier on the opening line. The underlying Shiki engine supports the languages in its built-in grammar set.
Expressive Code reads meta after the language identifier to mark lines, frame the block, add a title, and show inserted and deleted lines.
Line and range markers
Highlight lines with a comma-separated list of line numbers and ranges in braces.
```js {1, 4-5}
function demo() {
console.log('unmarked');
console.log('unmarked');
console.log('marked');
console.log('marked');
}
```
Inserted and deleted lines
Mark lines as inserted or deleted with ins= and del=, using the same line-number-and-range syntax. Expressive Code renders + and − gutters.
```js ins={2} del={3}
function demo() {
console.log('added line');
console.log('removed line');
}
```
A code block whose language is diff renders +/− line prefixes directly.
```diff
- const old = 1;
+ const next = 2;
```
Text and regular expression markers
Mark occurrences of a term by quoting it, or match with a regular expression between slashes. Combine markers with ins/del to color the marked text.
```js "return true" ins=/oldValue|newValue/
function demo() {
return true;
}
```
Titles and frames
Set a title with title="…". A title renders a file-name tab on a code frame; on a sh, bash, or other shell block it renders a terminal window title.
```js title="src/demo.js"
console.log('titled block');
```
Control the frame with frame. Values are code, terminal, none, and auto (the default). Use frame="none" to drop the window decoration.
```sh frame="none"
npm run build
```
Code theme
Expressive Code uses a dark and light theme derived from qwik-docs' color palette by default.
Set your own theme with markdown.shikiTheme in qwik-docs.config.ts. Pass a single Shiki theme name for both modes, or a { light, dark } pair.
// qwik-docs.config.ts
import { defineConfig } from '@qwik-docs/framework';
export default defineConfig({
markdown: {
shikiTheme: { light: 'github-light', dark: 'github-dark' },
},
});
To render highlighted code from a variable or an external source rather than a fenced block, use the <Code> component.
Details
Details (also known as "disclosures" or "accordions") hide content that is not immediately relevant. Readers click a short summary to expand and view the full content.
Use the standard HTML <details> and <summary> elements in your content to create a disclosure widget.
You can nest any other content inside a <details> element.
Where and when is the Andromeda constellation most visible?
The Andromeda constellation is most visible in the night sky during the month of November at latitudes between +90° and −40°.
<details>
<summary>Where and when is the Andromeda constellation most visible?</summary>
The Andromeda constellation is most visible in the night sky during the month of November.
</details>
Footnotes
Footnotes add brief references or clarifications without interrupting the flow of your content. They appear as numbered superscript links that jump to referenced text collected at the bottom of the page. remark-gfm renders them.
Define a footnote using square brackets with a caret and numbered reference:
Here is a footnote[^1] with some additional text after it.
[^1]: My reference.
Tables and task lists
remark-gfm renders GitHub Flavored Markdown tables and task lists:
| Feature | Supported |
| --------- | --------- |
| Tables | yes |
| Footnotes | yes |
- [x] Written
- [ ] Reviewed
remark-gfm also autolinks bare URLs like https://qwik.dev/.
Other common Markdown features
qwik-docs supports the rest of standard Markdown authoring syntax, such as ordered and unordered lists. See the Markdown Cheat Sheet from The Markdown Guide for a quick overview of all the Markdown syntax elements.
Components in MDX
.mdx files can import and render qwik-docs components — for example <Tabs>, <Card>, <Steps>, and <FileTree>.
Import from @qwik-docs/components/qwik/<Name>.
See Using Components.
Advanced Markdown and MDX configuration
qwik-docs runs a built-in remark and rehype pipeline defined in the framework's Vite plugin.
Extend it with your own plugins through the markdown config in qwik-docs.config.ts.
markdown.remarkPlugins run after the built-in remark stage; markdown.rehypePlugins run after the built-in rehype stage.
// qwik-docs.config.ts
import { defineConfig } from '@qwik-docs/framework';
import remarkMath from 'remark-math';
import rehypeKatex from 'rehype-katex';
export default defineConfig({
markdown: {
remarkPlugins: [remarkMath],
rehypePlugins: [rehypeKatex],
},
});
A plugin entry accepts the plugin function or a [plugin, options] tuple, matching the unified convention.