Quarto Manual
A guide to creating and using Quarto Manuals
0.1 What Is A Quarto Manual?
A Quarto Manual is an executable operations manual for a software or research workflow.
Use a Quarto Manual when a workflow is too long, fragile, or context-specific for a README, but too visible and judgment-heavy to hide behind a single CLI.
A manual gives the user ordered .qmd pages that:
- explain one step at a time;
- run the code for that step;
- verify whether the step worked;
- make dependencies between steps explicit.
In practice, Quarto Manuals are best understood as operator-facing procedure books for software and research workflows.
0.2 Core Idea
The central design rule is simple:
A Quarto Manual is an ordered set of independent executable pages.
Each Page is a contract with three parts:
prereq: prove that the page is allowed to run;procedure: do one or more pieces of work;check: prove that the work succeeded.
Pages should share a project, not a notebook kernel1.
If page 3 depends on page 2, page 3 should deliberately enforce that dependency in its prerequisite block by checking visible project state:
- required files exist;
- required directories exist;
- a previous test suite passes;
- a required tool is installed;
- a prior configuration file contains the expected values.
That allows a manual to orchestrate setup and operation without relying on hidden cross-page state.
For more complex, non-linear dependencies, Quarto Manuals may reach their limit. In that case, consider moving directly to a DAG-based workflow orchestrator such as Snakemake or Nextflow, and injecting that into the Manual as a single page that runs the orchestrator.
0.3 Why This Shape?
This structure keeps responsibility local.
- The page owns its own setup conditions.
- The page owns the work it performs.
- The page owns the test that proves the result.
This is close to familiar software design patterns:
- Design by contract:
prereqacts like a precondition andcheckacts like a postcondition. - Arrange / Act / Assert:
prereqarranges the required state,procedureacts, andcheckasserts the result. - Idempotent infrastructure steps: inspect current state, apply a change, then verify the target state. Once it’s been run, you don’t have to run it again, and doing so won’t break anything.
0.4 Page Contract
Every manual page should contain:
- exactly one
.manual-prereqblock; - one or more
.manual-procedureblocks; - exactly one
.manual-checkblock.
The Quarto Manual filter can validate that structure and render those blocks as semantic callouts.
See Manual Pages for the fuller authoring template.
0.5 The Backend: quarto-emit
quarto-emit is an extension to Quarto that can materialize reusable files from a Quarto page by wrapping the text of a code block in a file write operation. It is optional, but becomes quite powerful when combined with the Quarto Manual structure.
Quarto Manual and quarto-emit have different jobs.
- Quarto Manual defines the structure of an executable manual page.
quarto-emitoptionally materializes reusable files from those pages.
You do not need quarto-emit to write a manual.
Use quarto-emit when a page should produce conventional project artifacts such as:
src/modules;tests/suites;scripts/;config/files.
That being said, you can use any Quarto extension you’d like to extend the functionality of a Quarto Manual.
0.7 Operator Workflow
To use an existing manual:
- Find the repository for the procedure manual.
- Run
quarto use template <ORG>/<PROCEDURE>_manual. - Open the manual locally.
- Work through the pages in order.
- Let each page’s prerequisite and check blocks tell you whether you can proceed.
As you read through this website documentation, though, keep in mind that the operator workflow is to have cloned the manual and be reading the pages in VSCode, Jupyter, or whatever editor they prefer, while also actively running the code in the procedure blocks. The rendered website is a documentation artifact to help readers consume the content.
0.8 Scope Of This Project
This project is intentionally narrow.
Quarto Manual should only extend Quarto in one functional way:
- give manual pages semantic structure with
prereq,procedure, andcheckblocks.
Everything else should be optional, but frictionless to add, thanks to quarto-emit:
- emitted source files;
- emitted test suites;
- helper modules;
- workflow-specific libraries.
0.9 Examples On This Site
This site includes three example manuals that scale in sophistication:
- a simple data-staging workflow;
- an intermediate ERA5 acquisition and aggregation workflow;
- an advanced RSE workbench environment workflow.
Each example is intentionally more complete than the shipped template, with more creative (and hopefully more elegant) implementations and problem solving strategies involving real-world use cases.
A notebook kernel is a program that runs code in a specific programming language, such as Python or R. It allows users to test out code iteratively in a Read-Eval-Print Loop (REPL) workflow. REPL workflows are great for exploration, and arguably were the foundational technology behind the rise of accessible data science. One of the main criticisms of notebooks, however, is that they can hide the state of your code (see here), which makes it hard to reason about your project. Quarto Manuals avoid that problem primarily by using Quarto Markdown, which is plain text, and secondarily by encouraging page independence in its design. Any interdependence is made explicit through side-effects that Manual Authors must deliberately insert.↩︎