Examples

Examples guide

Understand every bundled document fixture and how to render it.

View Markdown source

examples/ is now a folder of document spec files, not Rust programs.

For the full user docs, start with ../docs/README.md.

Every complete example declares spec version 1. Generate the authoring schema with cargo run -- schema, and use cargo run -- migrate FILE --check to enforce the version in CI.

You can also browse visual previews in ../docs/gallery.md.

Each example renders to:

  • .docx files in generated/
  • .pdf previews in rendered/

All examples inherit styling from config. The easiest way to tweak it is:

cargo run -- config wizard --level basic

That updates the user config at ~/rusdox/config.toml. If you want this repo only to use a local override, run:

cargo run -- config wizard --path ./rusdox.toml --level basic

Local ./rusdox.toml overrides the user config.

Render one example:

cargo run -- examples/board_report.yaml

Render every example in the folder:

cargo run -- examples

Verify every example and generate DOCX/PDF parity evidence:

cargo run -- verify examples --output-root target/parity

Create your own starter document file:

cargo run -- init-doc mydoc.yaml

Example files:

  • board_report.yaml
  • client_proposal.yaml
  • configured_studio.yaml
  • dual_output_contract.yaml
  • executive_dashboard.yaml
  • formatting_showcase.yaml
  • hello_world.yaml
  • invoice.yaml
  • international_scripts.yaml
  • meeting_notes.yaml
  • named_styles_showcase.yaml
  • product_launch_brief.yaml
  • project_brief.yaml
  • table_report.yaml
  • talent_profile.yaml
  • visual_assets_showcase.yaml
  • yaml_composition_showcase.yaml

Operator configuration is intentionally separated from document inputs: config/hosted-limits.toml is a complete service-owned resource profile and is not included when rusdox verify examples discovers top-level documents.

Showcase examples:

  • executive_dashboard.yaml: multi-section KPI summary with shaded metric cards and status tables
  • board_report.yaml: two-page leadership report using a cover page and page break
  • client_proposal.yaml: styled proposal with phases, pricing, and delivery plan
  • product_launch_brief.yaml: launch narrative, milestones, readiness checks, and metrics
  • talent_profile.yaml: polished resume/profile style document with experience and skills sections
  • named_styles_showcase.yaml: reusable paragraph, run, and table styles with inheritance and stable style ids
  • visual_assets_showcase.yaml: focused regression example for logos, raster images, signatures, and SVG chart assets
  • yaml_composition_showcase.yaml: variables, fragment includes, repeat blocks, and first-class document metadata in one example
  • dual_output_contract.yaml: executable contract for shared page setup, headers/footers, fields, links, bookmarks, footnotes, breaks, row pagination, merged/rich cells, and nested tables
  • international_scripts.yaml: Latin, Arabic/RTL, Hebrew, CJK, emoji, and mixed-script coverage with the renderer boundaries documented in the compatibility matrix

Benchmark note:

  • The generated YAML stress spec lives at examples/stress/stress_1000_pages.yaml
  • Regenerate it with ./scripts/generate_stress_yaml.sh
  • Run the full stress flow with ./scripts/run_stress_yaml.sh