Each example below is a complete, runnable report from the
Examples/ directory.
Every preview on this page is the actual rendered PDF — produced by running:
ym convert report.ymlGrab any example folder, tweak the YAML, and re-render to see your changes.
The essentials: headings from keys, word-wrapped paragraphs, a sub-heading, nested bullets, an ordered list, and a table. Start here, then read Document structure.
:language: yaml
::::{grid} 1 2 2 2 :gutter: 3
:::{grid-item}
:alt: Simple example, page 1
:class: ym-page-shot
+++
Page 1
::::::{grid-item}
:alt: Simple example, page 2
:class: ym-page-shot
+++
Page 2
:::::::
Override the body font, heading font, heading colour, and typographic ratio with a _style
block in the document front matter. See Configuration.
:language: yaml
::::{grid} 1 2 2 2 :gutter: 3
:::{grid-item}
:alt: Document configuration, page 1
:class: ym-page-shot
+++
Page 1
::::::{grid-item}
:alt: Document configuration, page 2
:class: ym-page-shot
+++
Page 2
:::::::
Define named text styles under _style.styles, then switch the active family part-way through
the document with the _textstyle block. Here a fine-print style (smaller, grey) and a
callout style (larger, blue, centred) are switched in and out — each swap restyles the body,
headings, and lists that follow it, and reverts when the section ends. See
Configuration → Named text styles.
:language: yaml
::::{container} ym-single-shot
:alt: Scoped text styles — default, fine-print, and callout families switched within one document
:class: ym-page-shot
::::
Define _vars, render them into text with Jinja ({{ "{{var}}" }}), and reach into nested
values. See Variables.
:language: yaml
::::{grid} 1 2 2 2 :gutter: 3
:::{grid-item}
:alt: Document variables, page 1
:class: ym-page-shot
+++
Page 1
::::::{grid-item}
:alt: Document variables, page 2
:class: ym-page-shot
+++
Page 2
:::::::
Overlay the document onto a designed PDF template and auto-populate its form fields from
_vars (here: field_a, field_b, field_c, field_d). See
PDF backgrounds.
:language: yaml
::::{container} ym-single-shot
:alt: PDF backgrounds — content overlaid on a custom template with populated form fields
:class: ym-page-shot
::::
The full block catalogue in one document: images, admonitions, block quotes, page breaks,
horizontal rules, spacers, executable _py, a non-executable _code block, and _loadjson.
See the Blocks reference.
:language: yaml
::::{grid} 1 2 2 2 :gutter: 3
:::{grid-item}
:alt: YMPrint blocks, page 1
:class: ym-page-shot
+++
Page 1 — images & admonitions
::::::{grid-item}
:alt: YMPrint blocks, page 2
:class: ym-page-shot
+++
Page 2 — quotes, rules & spacers
::::::{grid-item}
:alt: YMPrint blocks, page 3
:class: ym-page-shot
+++
Page 3 — executable Python
::::::{grid-item}
:alt: YMPrint blocks, page 4
:class: ym-page-shot
+++
Page 4 — code & JSON variables
:::::::