This document 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. For detailed information about specific subsystems, see:
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 a variety of formats such as HTML, PDF, EPUB, and RevealJS presentations.
Key capabilities include:
The system is implemented in TypeScript for the Deno runtime and orchestrates external binaries including Pandoc and Typst.
Sources: README.md10-24 src/quarto.ts122-140
Quarto CLI is organized into layered subsystems centered around command processing, document execution, rendering, and output generation. The system is built on Deno and uses monkey-patching early in the lifecycle to enhance compatibility and path management.
| Component | Description | Code Location |
|---|---|---|
| CLI Entry Point | The main function quarto() responsible for CLI initialization, argument parsing, and command dispatch. | src/quarto.ts src/quarto.ts122-140 |
| Command Registry | Collection of available CLI commands (render, preview, serve, etc.). | src/command/command.ts src/command/command.ts35-63 |
| Project System | Manages different project types such as websites, books, and extensions for shared configuration and rendering. | src/project/types/register.ts src/quarto.ts49-50 |
| Language Handlers | Engine discovery and management for computational languages (Python, R, Julia). | src/core/handlers/handlers.ts src/quarto.ts46-47 |
| Format Registry | Registers output formats and rendering templates to support HTML, PDF, RevealJS, and others. | src/format/imports.ts src/quarto.ts52-53 |
| Binary Passthrough | Direct invocation of bundled binaries like Pandoc and Typst when appropriate. | src/quarto.ts src/quarto.ts85-120 |
| Execution Engines | Abstraction for computational code execution engines such as Jupyter, Knitr, and Observable JS. | src/execute/engine.ts src/command/render/render-files.ts37-38 |
| Logging & Console | Multi-level logging, progress bars, and console output management. | src/core/log.ts, src/core/console.ts |
Sources: src/quarto.ts43-56 src/quarto.ts122-140 src/command/command.ts35-63 src/command/render/render.ts69-72 src/command/render/pandoc.ts207
This diagram illustrates the association between conceptual subsystems and key source code entities within Quarto CLI, helping bridge understanding from the domain vocabulary to the codebase.
Sources: src/quarto.ts122-126 src/command/command.ts35 src/command/run/run.ts14 src/core/log.ts49 src/command/render/pandoc.ts207 src/execute/engine.ts27-29 src/core/handlers/base.ts24-27
Quarto CLI uses the cliffy framework for defining its command-line interface. The entry point is responsible for environment setup, validation of version requirements, and possible reconfiguration before dispatching to specific command handlers.
| Command | Handler | Description |
|---|---|---|
render | renderCommand | Renders documents or projects to specified output formats. |
preview | previewCommand | Provides live preview with hot-reloading during editing. |
serve | serveCommand | Serves projects over HTTP for local testing and sharing. |
create | createCommand | Helps create new projects or documents with templates. |
run | runCommand | Runs code scripts (TypeScript, R, Python, Julia). |
inspect | inspectCommand | Outputs metadata information for projects or files as JSON. |
cliffy.For details, see CLI Commands and Entry Points.
Sources: src/quarto.ts122-218 src/command/command.ts35-63 src/command/inspect/cmd.ts16-24
The document processing pipeline covers the end-to-end flow from raw input documents to their rendered outputs. The workflow includes computational execution, format recipe resolution, AST transformations, filtering via Lua, and final rendering.
.qmd files to preprocess content before AST parsing.For details, see Document Processing Pipeline.
Sources: src/command/render/render-files.ts122-215 src/command/render/output.ts58-100 src/command/render/pandoc.ts207
Quarto CLI delivers a modular, extensible platform for scientific and technical document publishing. Its architecture bridges declarative project management, computational code execution, and complex document rendering built on a robust integration with Pandoc and other tooling. This modular design facilitates advanced publishing workflows with support for custom filters, engines, and output formats.
Sources: src/quarto.ts1-60 README.md10-24
Refresh this wiki
This wiki was recently refreshed. Please wait 1 day to refresh again.