Getting started

Your first document

Write a small invoice template in Markdown, give it JSON data and CSS, and render it to a PDF with German number formats and page numbers.

On this page

Community

This page builds the invoice from the home page. You need three files in one folder.

Every render needs a licence key. If you have none, get a free trial key as described in Installation, then set it:

export BREVIER_LICENCE_KEY="<your-licence-key>"

1. Write the data

The data is plain JSON. Money stays a number; Brevier formats it later.

rechnung.json
{
  "firma": { "name": "Muster Versicherung AG", "anschrift": "Hauptstraße 1, 10115 Berlin" },
  "kunde": { "name": "Erika Mustermann", "strasse": "Beispielweg 7", "ort": "50667 Köln" },
  "rechnung": {
    "nummer": "R-2026-0142",
    "datum": "2026-09-25",
    "positionen": [
      { "pos": 1, "text": "Berufsunfähigkeitsversicherung", "betrag": 84.2 },
      { "pos": 2, "text": "Haftpflichtversicherung", "betrag": 7.9 }
    ],
    "summe": 92.1
  }
}

2. Write the template

The template is Markdown with {{ }} tags. Each tag names a field in the data. {{#each}} repeats a table row for every item in a list.

rechnung.md
---
style: rechnung.css
---

{{ firma.name }}, {{ firma.anschrift }}

An: {{ kunde.name }}, {{ kunde.strasse }}, {{ kunde.ort }}

# Beitragsrechnung {{ rechnung.nummer }}

Datum: {{ rechnung.datum | date }}

| Pos. | Leistung | Betrag |
| --- | --- | ---: |
{{#each rechnung.positionen}}
| {{ pos }} | {{ text }} | {{ betrag | money }} |
{{/each}}

**Summe {{ rechnung.summe | money }}**

| date prints 25.09.2026. | money prints 84,20 €.

3. Style the page

The stylesheet sets the paper size, the margins and a page counter.

rechnung.css
@page {
  size: A4;
  margin: 25mm 20mm 25mm 25mm;
  @bottom-right {
    content: "Seite " counter(page) " von " counter(pages);
  }
}
body { font: 10pt/1.4 sans-serif; }
table { width: 100%; border-collapse: collapse; }
td:last-child, th:last-child { text-align: right; }

4. Render

brevier pdf rechnung.md --data rechnung.json -o rechnung.pdf

Open rechnung.pdf. It has your data, German number formats and a page counter at the bottom.

Run brevier preview rechnung.md --data rechnung.json --open to preview the invoice in your browser with live reload while you edit the files. Change a value in rechnung.json and the browser reloads instantly.