Skip to content

Examples

Sebastian Skov Nielsen edited this page Aug 1, 2026 · 1 revision

Examples

Academic report

.leafmark/config.json:

{
  "order": ["introduction.md", "method.md", "results.md", "conclusion.md"],
  "metadata": {
    "title": "Research Report",
    "author": ["Alex Morgan"],
    "toc": true,
    "number-sections": true,
    "bibliography": "sources.bib"
  }
}

Build with a classic theme:

pnpx @skxv/leafmark theme use classic
pnpx @skxv/leafmark --html

One-page CV

pnpx @skxv/leafmark init ./cv
cd cv
pnpx @skxv/leafmark theme use cv

Use structured frontmatter described in Themes#cv-theme, place experience entries in the Markdown chapter, and build:

pnpx @skxv/leafmark

Styled KPI card

_frontmatter.md:

---
title: Monthly Dashboard
styles:
  - styles/dashboard.css
---

dashboard.md:

# Dashboard

```html
<section class="kpi-grid">
  <article class="kpi">
    <span class="kpi-label">Revenue</span>
    <strong class="kpi-value">€1.28M</strong>
    <span class="kpi-change positive">+18%</span>
  </article>
</section>
```

styles/dashboard.css:

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

.kpi {
  display: grid;
  gap: 0.5rem;
  padding: 1.5rem;
  border-radius: 0.75rem;
  color: #172033;
  background: #f1f5f9;
}

.kpi-label { color: #64748b; }
.kpi-value { font-size: 2rem; }
.positive { color: #15803d; }

Build and retain the screenshot for inspection:

pnpx @skxv/leafmark --keep-build-files --html

DOCX with a reference document

{
  "pandoc": {
    "docxArgs": ["--reference-doc=assets/reference.docx"]
  }
}
pnpx @skxv/leafmark --output-format docx

Multiple client bundles

portfolio/
├── .leafmark/config.json
├── overview.md
├── acme/
│   ├── .leafmark/config.json
│   └── report.md
└── northwind/
    ├── .leafmark/config.json
    └── report.md
pnpx @skxv/leafmark ./portfolio acme
pnpx @skxv/leafmark ./portfolio northwind

Outputs become dist/acme/acme.pdf and dist/northwind/northwind.pdf.

CI build

See the complete GitHub Actions workflow in Automation and JSON Events#ci-example.

Clone this wiki locally