-
-
Notifications
You must be signed in to change notification settings - Fork 6
Quarto Mode
Command: apex --mode quarto document.qmd
Quarto mode targets Pandoc/Quarto markdown for HTML output. It is a unified-family mode with Quarto-specific preprocessors enabled by default.
apex document.qmd --mode quarto --standalone
apex document.qmd --mode quarto --standalone --script mermaidMetadata:
---
title: My Doc
mode: quarto
---Compared to unified mode, Quarto mode:
- Enables Quarto callouts, fenced divs, and bracketed spans
- Enables Pandoc/Quarto preprocessors (raw content, lists, code fence attrs, diagrams, shortcodes)
- Disables Marked-specific extensions, wiki links, and index syntax
- Keeps
unsafeHTML enabled (required for raw content and diagram blocks)
| Feature | Syntax | Notes |
|---|---|---|
| Callouts | ::: {.callout-note} |
See Callouts |
| Bracketed spans | [text]{.smallcaps} |
Semantic CSS in standalone output |
| fig-alt | {fig-alt="Alt"} |
Maps alt text to <img alt>
|
| Raw content |
```{=html} / `{=html}`
|
Requires unsafe |
| Example lists | (@) Item |
Pandoc example list markers |
| Roman lists | i) Item |
lower-roman styling |
| Line blocks | | Line |
Preserves spacing |
| Code fence attrs | ```{.python filename="x.py"} |
data-* on <pre>
|
| Diagrams |
```{mermaid} / {dot}
|
<pre class="mermaid">; auto mermaid.js in standalone |
| Shortcodes |
{{< pagebreak >}}, {{< kbd >}}, {{< include >}}
|
Thin core shim; kbd uses Plugins |
| Cross-refs |
@fig-id, @sec-id
|
Wrapped in <span class="quarto-xref"> (display only; no resolution) |
| Hidden divs | ::: {.hidden} |
Hidden via standalone CSS |
Apex does not implement Quarto's full engine. These remain out of scope:
- Cell execution, project/site rendering, conditional content
- Cross-ref resolution (
@fig-…is marked up, not linked) - CSL/bibliography pipeline (use Apex citations separately if needed)
- PDF/Typst/Word multi-format output (use Pandoc Integration)
Individual preprocessors can be toggled in YAML:
quarto-extensions: true
quarto-raw: true
quarto-list-continuation: true
quarto-line-blocks: true
quarto-roman-lists: true
quarto-code-attrs: true
quarto-diagrams: true
quarto-shortcodes: true
quarto-callouts: true
quarto-xrefs: true
quarto-strict-lists: falseSet a key to false to disable that preprocessor while keeping --mode quarto.
Core converts a small set of Quarto shortcodes before parsing:
-
{{< pagebreak >}}→ page break HTML -
{{< kbd ... >}}→{% kbd ... %}(render with the kbd plugin) -
{{< include file.md >}}→<<[file.md]>include syntax
Other shortcodes (e.g. {{< video >}}) should be handled by plugins. Unknown shortcodes pass through unchanged; set APEX_VERBOSE=1 for warnings.
Examples live under tests/fixtures/quarto/ in the Apex repository:
-
smoke.md— integration smoke test -
callouts.md,spans.md,raw-content.md,lists.md,code-attrs.md,diagrams.md,shortcodes.md
- Modes — all processor modes
-
Command Line Options —
--mode quarto - Callouts — Quarto callout syntax
- Plugins — extending shortcodes and syntax
Copyright 2025 Brett Terpstra, All Rights Reserved | MIT License
- Getting Started - Your first steps with Apex
- Installation - How to build and install Apex
- Usage - Basic usage examples
- Syntax - Complete syntax reference for unified mode
- Callouts - All supported callout formats and flag requirements
- Tables - Complete table syntax reference including rowspan, colspan, alignment, and captions
- Inline Attribute Lists - IALs and ALDs guide with examples
- Modes - Understanding processor modes
-
Quarto Mode - Pandoc/Quarto markdown (
--mode quarto) - Command Line Options - All CLI flags explained
-
Rendering Markdown in the Terminal - Terminal output formats (
-t terminal,-t terminal256),--width,--theme, and theming -
Generating Man Pages - Generate man pages from Markdown using
apex -t man -
Multi-file Documents - Combining multiple files with
--combine,--mmd-merge, and includes - Citations - Citations and bibliography guide
- Indices - Index generation with mmark and TextIndex syntax
-
Metadata Transforms - Transform metadata values with
[%key:transform] - Integrating with Pandoc - Use Apex with Pandoc for DOCX, PDF, and more
- Using Apex with Jekyll - Use the apex-ruby gem as Jekyll’s Markdown converter (untested; feedback welcome)
- Header IDs - How header IDs are generated
- C API - Programmatic API documentation
- Writing Tests - How to add tests for new features
- Xcode Integration - Using Apex in Xcode projects
- Examples - Practical usage examples
- Plugins - Plugin system, examples, and recipes
- Filters - AST filters (Pandoc-style JSON), examples, and usage
- Troubleshooting - Common issues and solutions
- Credits - Acknowledgments and links to related projects