This page provides a high-level introduction to the Quarto CLI system, explaining its purpose as a scientific and technical document publishing system, and outlining the major architectural components and how they interact.
As a PARENT page, this document keeps technical details high-level and points to the comprehensive child pages for deeper exploration:
render, preview, serve, create, check, convert) and their command-line interfaces, explaining how user commands flow through the system.Quarto is an open-source scientific and technical publishing system built on Pandoc. It transforms source documents—including Quarto markdown (.qmd), Jupyter notebooks (.ipynb), and R Markdown (.Rmd) files—into publication-ready outputs in formats such as HTML, PDF, EPUB, Typst, and RevealJS presentations.
Key capabilities coordinated by the CLI include:
The system is implemented in TypeScript for the Deno runtime and orchestrates external binaries including Pandoc and Typst src/quarto.ts85-120
Sources: src/quarto.ts85-120 src/quarto.ts122-140
Quarto CLI is organized into layered subsystems handling command dispatch, project metadata, format configuration, binary passthroughs, and document rendering.
| Component | Description | Code Location |
|---|---|---|
| CLI Entry Point | Main function quarto() responsible for CLI initialization, flags, and command dispatch. | src/quarto.ts src/quarto.ts122-140 |
| Command Registry | Collection of CLI commands (render, preview, serve, etc.). | src/command/command.ts src/command/command.ts63 |
| Project System | Manages project contexts, shared configurations, and file discovery. | src/project/types/register.ts src/quarto.ts49-50 |
| Language Handlers | Discovery and management of execution runtimes (Python, R, Julia). | src/core/handlers/handlers.ts src/quarto.ts46-47 |
| Format Registry | Registers output format definitions, writers, and templates. | src/format/imports.ts src/quarto.ts52-53 |
| Binary Passthrough | Direct invocation of bundled binaries like Pandoc and Typst. | src/quarto.ts src/quarto.ts85-120 |
| Rendering Engine | Orchestrates recipe generation, markdown conversion, and filter pipelines via runPandoc(). | src/command/render/pandoc.ts src/command/render/pandoc.ts207-210 |
Sources: src/quarto.ts43-56 src/quarto.ts122-140 src/command/command.ts63 src/command/render/pandoc.ts207-210
To bridge conceptual subsystems with implementation details, the following diagrams highlight primary code symbols and functions implementing each architectural role.
Sources: src/quarto.ts122-126 src/command/command.ts63 src/command/render/pandoc.ts207-210 src/command/render/output.ts58-60 src/command/render/flags.ts36
Sources: src/command/render/render.ts95-97 src/command/render/filters.ts128-135 src/core/log.ts97-99 src/config/format.ts55-60
Quarto CLI uses the cliffy command-line framework to expose subcommands like render, preview, serve, create, inspect, and run src/quarto.ts12-15 The entry point manages environment setup, version requirements, session temporary directories, and argument routing src/quarto.ts61-83
For complete details on user command lifecycles and options parsing, see CLI Commands and Entry Points.
Sources: src/quarto.ts12-15 src/quarto.ts61-83 src/quarto.ts122-218
The document processing pipeline governs the transformation from source text (.qmd, .ipynb, .Rmd) to target formats. It encompasses code execution via engines (Jupyter, Knitr), recipe and output configuration generation, custom Pandoc preprocessing, and Lua filter transformations src/command/render/render.ts69-211
For a full breakdown of execution, filtering phases, AST modifications, and format generation, see Document Processing Pipeline.
Sources: src/command/render/render.ts69-211 src/command/render/pandoc.ts207-210 src/command/render/output.ts58-110
Refresh this wiki
This wiki was recently refreshed. Please wait 3 days to refresh again.