Transformer plugins modify your content during the build process. They parse frontmatter, transform Markdown syntax, add features like syntax highlighting and LaTeX support, and process links.
Transformers operate on the content using the unified ecosystem:
textTransform - Modify raw text before parsing
markdownPlugins - Transform Markdown AST (using remark )
htmlPlugins - Transform HTML AST (using rehype )
Transformers run sequentially in the order they’re defined in quartz.config.ts.
FrontMatter
Parses YAML or TOML frontmatter from Markdown files.
Configuration
Example Frontmatter
Plugin . FrontMatter ({
delimiters: "---" , // or "+++" for TOML
language: "yaml" , // or "toml"
})
delimiters
string | [string, string]
default: "---"
Delimiter characters for frontmatter blocks
language
yaml | toml
default: "yaml"
Frontmatter language parser
Supported Fields:
Page title (fallback to filename if not provided)
Tags for categorization (supports comma-separated string or array)
Alternative URLs that redirect to this page
Mark page as draft (filtered by RemoveDrafts plugin)
Creation date (ISO format or YYYY-MM-DD)
Image for social media previews
Page description for SEO and previews
SyntaxHighlighting
Adds syntax highlighting to code blocks using rehype-pretty-code .
Plugin . SyntaxHighlighting ({
theme: {
light: "github-light" ,
dark: "github-dark" ,
},
keepBackground: false ,
})
theme
{ light: string, dark: string }
Keep the theme’s background color
Usage Example:
```typescript title="example.ts" {2,4-6}
function hello ( name : string ) {
console . log ( `Hello, ${ name } !` ) // highlighted
return {
message: name , // highlighted range
}
}
```
Features:
Line highlighting: {2,4-6}
File titles: title="filename.ts"
Line numbers
Copy button support
GitHubFlavoredMarkdown
Enables GitHub Flavored Markdown features: tables, strikethrough, task lists, and autolinks.
Plugin . GitHubFlavoredMarkdown ({
enableSmartyPants: true ,
linkHeadings: true ,
})
Convert straight quotes to curly quotes, dashes to em-dashes, etc.
Add anchor links to headings
GFM Features:
Tables
Task Lists
Strikethrough
Autolinks
| Syntax | Description |
| ------ | ----------- |
| Header | Title |
| List | Item |
- [ x ] Completed task
- [ ] Incomplete task
- [ ] Another task
https://example.com automatically becomes a link
ObsidianFlavoredMarkdown
Supports Obsidian-specific Markdown syntax.
Plugin . ObsidianFlavoredMarkdown ({
enableInHtmlEmbed: false ,
enableYouTubeEmbed: true ,
enableVideoEmbed: true ,
enableCallouts: true ,
enableMermaid: true ,
enableCheckboxToggle: false ,
enableParseTags: true ,
enableParseArrows: true ,
enableParseBracketedTags: true ,
})
Obsidian Features:
[[Internal Link]]
[[Link|Display Text]]
[[ Note#Heading ]]
[[ Note#^block-id ]]
> [ !note ] Note Title
> This is a note callout
> [ !warning ]
> Warning without title
> [ !tip ]- Collapsible Tip
> Collapsed by default
Supported types: note, abstract, info, todo, tip, success, question, warning, failure, danger, bug, example, quote
![[ image.png ]]
![[ document.pdf ]]
![[ note ]] # Embed another note
![[ video.mp4 ]]
Mermaid diagrams with triple backticks:
Use mermaid language tag
Supports flowcharts, sequence diagrams, etc.
Renders interactive diagrams
Latex
Renders LaTeX math expressions using KaTeX, MathJax, or Typst.
Plugin . Latex ({
renderEngine: "katex" ,
customMacros: {
" \\ RR" : " \\ mathbb{R}" ,
" \\ NN" : " \\ mathbb{N}" ,
},
})
renderEngine
katex | mathjax | typst
default: "katex"
Math rendering engine
Usage:
Inline Math
Block Math
With Macros
The equation $E = mc^2$ is famous.
$$
\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}
$$
The real numbers $\RR$ and natural numbers $\NN$.
KaTeX is recommended for faster builds and smaller bundle size.
TableOfContents
Generates table of contents from headings.
Plugin . TableOfContents ({
maxDepth: 3 ,
minEntries: 1 ,
showByDefault: true ,
collapseByDefault: false ,
})
maxDepth
1 | 2 | 3 | 4 | 5 | 6
default: 3
Maximum heading depth to include
Minimum number of headings required to show TOC
Show TOC by default on all pages
Per-page Control:
---
enableToc : true # Override default
---
CrawlLinks
Processes internal and external links.
Plugin . CrawlLinks ({
markdownLinkResolution: "shortest" ,
prettyLinks: true ,
openLinksInNewTab: false ,
lazyLoad: false ,
externalLinkIcon: true ,
})
markdownLinkResolution
shortest | absolute | relative
default: "absolute"
Strategy for resolving Markdown links
Display only filename in link text instead of full path
Open external links in new tab
Lazy load images and media
Add icon to external links
CreatedModifiedDate
Extract creation and modification dates from various sources.
Plugin . CreatedModifiedDate ({
priority: [ "frontmatter" , "git" , "filesystem" ],
})
priority
string[]
default: ["frontmatter","git","filesystem"]
Order of sources to check for dates
Date Sources:
frontmatter - created and modified fields
git - Git commit history
filesystem - File creation/modification time
Description
Generates page descriptions from content.
Plugin . Description ({
descriptionLength: 150 ,
})
Extracts the first descriptionLength characters as page description if not specified in frontmatter.
Citations
Process citations and bibliography.
Plugin . Citations ({
bibliographyFile: "./references.bib" ,
csl: "apa" ,
})
MissingLinks
Detect and report missing internal links.
Logs warnings for broken internal links during build.
HardLineBreaks
Convert single line breaks to <br> tags.
Useful for poetry or when you want single newlines to create line breaks.
RoamFlavoredMarkdown
Support Roam Research Markdown syntax.
Plugin . RoamFlavoredMarkdown ()
Parse Frontmatter First
Always first - other plugins may depend on frontmatter data
Date Processing
Plugin . CreatedModifiedDate ({ priority: [ "frontmatter" , "git" ] })
Early in pipeline - used by other plugins
Syntax Processing
Plugin . SyntaxHighlighting ({ ... })
Plugin . ObsidianFlavoredMarkdown ({ ... })
Plugin . GitHubFlavoredMarkdown ()
Process syntax before link crawling
Content Processing
Plugin . TableOfContents ()
Plugin . CrawlLinks ({ ... })
Plugin . Latex ({ ... })
Process content structure and special syntax
Final Processing
Plugin . MissingLinks ()
Plugin . Description ()
Plugin . HardLineBreaks ()
Final transformations and validation
Complete Example
const config : QuartzConfig = {
plugins: {
transformers: [
// 1. Parse metadata
Plugin . FrontMatter (),
Plugin . CreatedModifiedDate ({
priority: [ "frontmatter" , "git" , "filesystem" ],
}),
// 2. Syntax highlighting
Plugin . SyntaxHighlighting ({
theme: {
light: "github-light" ,
dark: "github-dark" ,
},
keepBackground: false ,
}),
// 3. Markdown syntax support
Plugin . ObsidianFlavoredMarkdown ({ enableInHtmlEmbed: false }),
Plugin . GitHubFlavoredMarkdown (),
// 4. Content processing
Plugin . TableOfContents (),
Plugin . CrawlLinks ({ markdownLinkResolution: "shortest" }),
Plugin . MissingLinks (),
Plugin . Description (),
// 5. Special syntax
Plugin . Latex ({ renderEngine: "katex" }),
Plugin . HardLineBreaks (),
],
// ... filters and emitters
},
}
See Also
Plugin Overview Understanding the plugin system
Filter Plugins Control content publishing
Emitter Plugins Generate output files
Unified Ecosystem Plugin system foundation