Reference
wf render
Render a .wf template with JSON data
wf render TEMPLATE [options]
Writes: the file --output names.
Renders one template with JSON data, to HTML, a PDF or a slide deck.
$ wf render invoice.wf --data invoice.json -f pdf -o invoice.pdf
$ echo '{"name":"Ada"}' | wf render greeting.wf
$ wf render templates/ --page Receipt --lang ar --data receipt.json
A template is held to the same checks as a build: a component nothing declares, or a flag a component does not take, stops the render. The one difference is that the names a template reads come from its data.
See also: Render a template.
Options
| Option | Type | Meaning |
|---|---|---|
TEMPLATE | path | Template file (.wf or .wfx), or a directory: every template under it as one, components shared |
--data DATA | path | JSON data file (reads stdin if omitted) |
--format -f FORMAT | html | html-fragment | pdf | slides | Output format: "html" (default), "html-fragment", "pdf", or "slides" |
--output -o OUTPUT | path | Output file (stdout if omitted) |
--theme THEME | text | Which |
--token NAME=VALUE | text, repeats | A design token over the theme's, |
--page PAGE | text | The page to render, by name, when the template has several |
--lang LANG | text | The document's language, |