Markdown
DocAnvil renders Markdown using comrak with GitHub Flavored Markdown (GFM) extensions enabled. Everything you'd expect from standard Markdown works, plus tables, task lists, strikethrough, footnotes, and front matter.
Text Formatting
Bold text is wrapped in double asterisks: **bold**
Italic text uses single asterisks: *italic*
Strikethrough uses double tildes: ~~strikethrough~~
You can combine them: bold and italic, bold strikethrough
Highlighted text uses double equals: ==highlighted==
Superscript uses carets: X2 is written as X^2^
Subscript uses single tildes: H2O is written as H~2~O
Emoji shortcodes like :smile: are converted to their Unicode equivalents: 😄
Headings
# Heading 1 ## Heading 2 ### Heading 3 #### Heading 4
Heading 1 gets a colored bottom border. Heading 2 gets a subtle separator line. Headings 3 and 4 are unstyled dividers.
Custom Heading IDs
By default, headings get auto-generated IDs based on their text. You can override this with a custom ID using {#id} at the end of the heading line:
### API Reference {#api-ref}
This renders as <h3 id="api-ref">API Reference</h3> instead of the auto-generated api-reference.
Links and Images
Standard Markdown links: [text](url)
Images: 
For linking between documentation pages, use wiki-links instead — they resolve automatically and warn on broken references.
Lists
Both unordered and ordered lists support nesting and task-list checkboxes.
Unordered
- First item
- Second item
- Nested item
- Another nested item
- Third item
Ordered
- Step one
- Step two
- Step three
- Sub-step
- Another sub-step
Task Lists
- Write the documentation
- Add code examples
- Review and publish
- Celebrate
Task lists render as checkboxes. Use - [x] for checked and - [ ] for unchecked items.
Tables
| Feature | Syntax | Rendered |
|---|---|---|
| Bold | **text** |
text |
| Italic | *text* |
text |
| Code | `code` |
code |
| Strikethrough | ~~text~~ |
Tables support column alignment with colons in the separator row:
| Left | Center | Right | |:-----|:------:|------:| | a | b | c |
Code Blocks
Inline code uses single backticks: let x = 42;
Fenced code blocks use triple backticks with an optional language identifier:
fn main() { println!("Hello from DocAnvil!"); }
const greet = (name) => { console.log(`Hello, ${name}!`); };
Blockquotes
Blockquotes are rendered with a colored left border and a subtle background.
They can span multiple paragraphs.
Use > at the start of each line.
Footnotes
DocAnvil supports footnotes1 using the standard syntax. Reference them inline with [^name] and define them anywhere in the document.
Here's another example with a longer footnote2.
Front Matter
Pages can include JSON front matter between --- delimiters at the top of the file. Front matter lets you set custom page titles, descriptions, author info, and dates — which DocAnvil uses for navigation labels, search, and SEO meta tags.
--- { "title": "My Page Title", "description": "A brief summary for search engines", "author": "Jane Doe", "date": "2024-01-15" } --- # Page Content
See Front Matter for the full list of supported fields and examples.
Horizontal Rules
Three or more hyphens, asterisks, or underscores create a horizontal rule:
---
Inline Attributes
DocAnvil supports a post-processing pass for inline attributes. Place {.class #id} on the line immediately after an element to inject HTML attributes:
## My Section {#custom-id .highlighted}
This renders as <h2 id="custom-id" class="highlighted">My Section</h2>.
Supported shorthand:
| Syntax | Result |
|---|---|
.classname |
class="classname" |
#idname |
id="idname" |
key="value" |
key="value" |
Multiple classes can be combined: {.first .second #my-id}
Related Pages
- Front Matter — page metadata, titles, and SEO meta tags
- Wiki-links — double-bracket links and inline popovers
- Components — notes, warnings, tabs, and code groups
Powered by comrak
DocAnvil uses comrak for Markdown rendering with unsafe mode enabled, so raw HTML in your Markdown is passed through to the output.