Markdown basics
DocsLit uses standard GitHub Flavored Markdown (GFM) with one superpower: you can drop web components directly into your Markdown without imports or configuration.
Text formatting
Bold text for emphasis.
Italic text for secondary emphasis.
Strikethrough for removed content.
inline code for code references.
Link text for hyperlinks.
Headings
Use ## and ### headings to structure your content. DocsLit generates a table of contents from these headings automatically.
# (H1) for the page title only.Lists
- First item
- Second item
- Nested item
- Third item
- First step
- Second step
- Third step
Tables
| Feature | Status |
|---|---|
| Markdown | Supported |
| Web components | Supported |
| JSX | Not needed |
For larger or more structured tables, use wc-table (JSON) or wc-asciidoc-table (AsciiDoc syntax with spans, column specs, and CSV/DSV).
Code blocks
Use fenced code blocks with a language identifier for syntax highlighting:
See code blocks for advanced features like filenames, tabs, and editable variables.
Images
Place image files in your docs/ directory and reference them with relative paths. On a site with versioned docs, the build copies media into every version folder, so relative paths work in each version. Non-default versions use the media in your working tree. The first content image on a page loads eagerly with fetchpriority="high" and decoding="auto", so the largest visible image appears sooner. Later images load lazily and decode asynchronously. If you set loading on the first image, DocsLit leaves it alone. Readers can click an image to zoom it, and the build adds width and height so the page does not jump while it loads.
Dark-mode variants
Add #dark= and the path of a second image. DocsLit shows the first in light mode and the second in dark mode:
Turn zoom off or set a size
An image inside a link does not zoom. To turn zoom off for any image, use an HTML img with noZoom. For a fixed width, an alternate dark image or a size without HTML, use the wc-image component:
lazy or eager. The build sets the first content image to eager.async, sync or auto.high, low or auto.Video and other embeds have their own component. See Embeds and media.
Internal links
Link to other pages using the page slug:
DocsLit resolves these links in both dev and static build modes.
Using web components
Drop any <wc-*> tag directly into your Markdown. No imports, no configuration:
Markdown source:
Rendered output:
You can write Markdown inside most components:
You can use bold, italic, code, and even:
- Bullet lists
- Links
- Other components
MDX compatibility
DocsLit recognizes PascalCase component names from Mintlify and MDX projects. Tags like <Tip>, <Card>, <Steps>, and <CardGroup> are automatically rewritten to their wc-* equivalents at parse time. This means most Mintlify projects work without changing source files.
Both styles can be mixed in a single file. The canonical wc-* syntax continues to work unchanged.
Any unmapped PascalCase tag is converted to wc-kebab-case automatically, so a custom <MyWidget> becomes <wc-my-widget>.
docslit validate to get warnings about PascalCase tags that resolve to a component that is not registered.Inline variable references
Use {{VAR_NAME}} in regular Markdown prose for compile-time variable substitution. Values come from global attributes, page frontmatter attributes, and page-local wc-var declarations.
See Variables and precedence for variable resolution rules, and Code blocks for runtime interactive variable workflows.
HTML pass-through
Standard HTML tags work in your Markdown. Use them for layout or styling that Markdown does not cover:
Next steps
- Set up page metadata with frontmatter
- Organize your sidebar with pages and navigation
- Add rich interactions with components