Skip to content

Latest commit

 

History

History
207 lines (160 loc) · 4.61 KB

File metadata and controls

207 lines (160 loc) · 4.61 KB

Examples

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.yml

Grab any example folder, tweak the YAML, and re-render to see your changes.


Simple example

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

:::

::::


Document configuration

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

:::

::::


Scoped text styles

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

::::


Document variables

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

:::

::::


PDF backgrounds

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

::::


YMPrint blocks

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

:::

::::