---
title: Render
---

- `src/command/render/render-files.ts:renderFile`
- `src/command/render/render-files.ts:renderFiles`

## Render

Quarto's `render` command can be subdivided into a number of "phases". At a very high level,
Quarto first executes code cells, and then calls Pandoc to produce the final result:

1. Execute code cells from engine (knitr or jupyter)
1. Run Pandoc

Quarto is more complex than this, but these are the most important steps. We'll add features one by one as
we describe the full the story

## Engines: `.ipynb` and `.qmd` inputs

Quarto can render directly from Jupyter notebook inputs in the form of `.ipynb` files. 
Importantly, engines always produce Markdown as output, but can take different input types. 
Read the [engines documentation](./engines/index.qmd) for more.

1. Execute code cells from engine
   1. `jupyter` takes both `.ipynb` and `.qmd` files as input.
   1. `knitr` takes Markdown as input
1. Run Pandoc

As an additional option, both engines can take script files formatted in a particular way
instead of a regular input. See [Render Scripts](https://quarto.org/docs/computations/render-scripts.html).

## Pandoc: Quarto's filter chain, user filters

Quarto choreographs a large number of Pandoc parameters and settings. 
Read the [Pandoc directory](./pandoc/index.qmd) for more.

1. Execute code cells from engine
   1. `jupyter` takes both `.ipynb` and `.qmd` files as input.
   1. `knitr` takes Markdown as input
1. Determine output format(s)
1. Run Pandoc (one or more times per .qmd file)
   1. Use Quarto's custom `.qmd` reader to support Quarto-specific Markdown syntax
   1. Run Quarto's filter chain and user filters to control the generation of the document

## TypeScript cell handlers and includes

Include shortcodes, mermaid, dot, ojs.

1. Expand include shortcodes in .qmd inputs
1. Execute code cells from engine
   1. `jupyter` takes both `.ipynb` and `.qmd` files as input.
   1. `knitr` takes Markdown as input
1. Run other typescript-specific cell handlers
1. Run Pandoc
   1. Use Quarto's custom `.qmd` reader to support Quarto-specific Markdown syntax
   1. Run Quarto's filter chain and user filters to control the generation of the document

## Postprocessors

There are a number of processing steps that need to happen _after_ the output has been generated by Pandoc.
These are handled in Typescript after Pandoc runs.
See the [Postprocessors documentation](./postprocessors/index.qmd) for more.

1. Expand include shortcodes in .qmd inputs
1. Execute code cells from engine
   1. `jupyter` takes both `.ipynb` and `.qmd` files as input.
   1. `knitr` takes Markdown as input
1. Run other typescript-specific cell handlers
1. Run Pandoc
   1. Use Quarto's custom `.qmd` reader to support Quarto-specific Markdown syntax
   1. Run Quarto's filter chain and user filters to control the generation of the document
1. Post-process outputs

## Output Recipes

Formats like PDF, Typst, and Beamer need an additional step after the postprocessors; this step
is handled in "Output Recipes". 
This is a simple step that either calls the correct binary (`latexmk`, `pdflatex`, `typst` etc) or
does no work (in formats like `html` or `revealjs`)

1. Expand include shortcodes in .qmd inputs
1. Execute code cells from engine
   1. `jupyter` takes both `.ipynb` and `.qmd` files as input.
   1. `knitr` takes Markdown as input
1. Run other typescript-specific cell handlers
1. Run Pandoc
   1. Use Quarto's custom `.qmd` reader to support Quarto-specific Markdown syntax
   1. Run Quarto's filter chain and user filters to control the generation of the document
1. Post-process outputs
1. Generate final output file from output recipe

## Projects vs single-file renders

TBD.

### Books

### Websites