Skip to main content

Module document

Module document 

Source
Expand description

The context of a document template: what core sends the document plugin (the html and pdf formats) in a format write request’s template, and the Jinja environment the plugin builds from it. Rendering happens in the plugin; core only runs the queries and sends this.

The plugin builds its environment with environment, so var(), run.*, target.name, the date functions and the number filters behave exactly as in core’s own templates (one implementation, no copy to drift), and results.<query> is the same value messages read.

Structs§

Check
What validate sends the plugin for an html or pdf output, so dre validate checks its template: the file, the project root, and the output’s queries (what results.<name> may name), in order.
Context
A format write request’s template for the html and pdf formats.
RunInfo
run.* and target.name, as plain values.

Constants§

FORMATS
The formats rendered from a document template, which get a Context in every write.

Functions§

environment
A Jinja environment with everything core’s templates read: var(), run.*, target.name, the date functions and the number filters. Undefined values are errors. The caller adds its loader, escaping and its own filters.
query_result
One query’s result from its Arrow batches, as results.<query> holds it (every row).
results_value
results: each query’s result by name, iterating in the order given (the YAML’s).