Home

stencila compile

Compile a document

Usage

stencila compile [OPTIONS] <INPUT>

Examples

# Compile a document to check for errors
stencila compile document.md

# Compile and cache document
stencila compile temp.md --cache

Arguments

NameDescription
<INPUT>The path of the document to compile.

Options

NameDescription
--no-saveDo not save the document after compiling it. Possible values: true, false.
--cacheCache the document after compiling it. Possible values: true, false.
-f, --fromThe format of the input/s.
--fineUse fine decoding if available for input format. Possible values: true, false.
--coarseUse coarse decoding if available for input format. Possible values: true, false.
--pagesPages to include when decoding multi-page documents.
--exclude-pagesPages to exclude when decoding multi-page documents.
--ignore-artifactsIgnore cached artifacts and force re-processing. Possible values: true, false.
--no-artifactsPrevent creating artifacts during decoding. Possible values: true, false.
--island-wrapWrap specified environments in Island nodes during decoding. Default value: figure,table,longtable,landscape.
--no-island-wrapDisable automatic Island wrapping of environments. Possible values: true, false.
--island-styleStyle to apply to auto-created Island nodes.
--input-lossesAction when there are losses decoding from input files. Default value: debug.
--include-structuringStructuring operations to include (comma-separated).
--exclude-structuringStructuring operations to exclude (comma-separated).
--citation-styleThe citation style to assume for text-to-citation structuring.

Possible values of --citation-style

ValueDescription
author-yearAuthor-year citations like (Smith, 2023)
bracketed-numericBracketed numeric citations like [1]
parenthetic-numericParenthetic numeric citations like (1)
superscripted-numericSuperscripted numeric citations like ¹

Possible values of --include-structuring, --exclude-structuring

ValueDescription
noneNo structuring operations
allAll structuring operations
sections-to-keywordsExtract keywords from the "Keywords" section
sections-to-abstractExtract abstract from the "Abstract" section
sections-to-referencesExtract references from "References" section
headings-to-titleExtract document title from the first heading
heading1-to-titleExtract document title from the very first level 1 heading
heading1-to-title-singleExtract document title from a single level 1 heading (conservative)
headings-decrementDecrement all heading levels by 1 (H2→H1, H3→H2, etc.)
headings-primary-level1Ensure that all "primary" headings have level 1
headings-to-sectionsCreate a section for each heading
headings-to-paragraphsTransform headings to paragraphs if appropriate
paragraphs-to-keywordsExtract keywords from paragraphs starting with "Keywords"
paragraphs-to-headingsTransform paragraphs to headings if appropriate
paragraphs-to-sentencesSplit paragraphs into individual sentences
figures-with-captionsCombine an image with a figure caption before or after it
tables-with-captionsCombine a table caption with the following table or datatable
table-images-to-rowsConvert table images to table rows using OCR
tables-to-datatablesTransform tables into datatables if possible
unwrap-media-objectsUnwrap media objects from paragraphs to block level
unwrap-quote-blocksUnwrap quote blocks containing more than two child blocks
text-to-citationsConvert text to structured citations
text-to-linksConvert URL text to structured links
math-to-citationsConvert math to structured citations
math-images-to-texConvert math images to TeX code using OCR
links-to-citationsConvert links to citations
normalize-citationsNormalize citation formatting and grouping
remove-pre-primaryRemove content before the first primary heading
remove-frontmatter-duplicatesRemove front matter that duplicates article metadata
remove-empty-headingsRemove empty headings
remove-empty-tablesRemove empty tables and datatables
remove-empty-listsRemove empty lists
remove-empty-paragraphsRemove empty paragraphs
remove-empty-textRemove empty text

Note

Compiling a document checks for source path errors in include and call blocks and prepares the document for execution without actually running any code.

© 2026 Stencila