Examples
Values from this very render.
Every value below was read out of the render that produced this page. The filter is enabled in this site’s _quarto.yml:
filters:
- lua-envPandoc
| Source | Value |
|---|---|
{{< lua-env pandoc.FORMAT >}} |
html |
{{< lua-env pandoc.PANDOC_VERSION >}} |
3.10 |
{{< lua-env pandoc.PANDOC_API_VERSION >}} |
1.23.1.2 |
Render the same document to another format and pandoc.FORMAT changes with it.
Quarto
| Source | Value |
|---|---|
{{< lua-env quarto.version >}} |
1.10.18 |
Through the meta shortcode
Everything sits under the lua-env metadata key as well, so Quarto’s own shortcode reaches it without the extension’s own:
| Source | Value |
|---|---|
{{< meta lua-env.pandoc.FORMAT >}} |
html |
The two shortcodes are not interchangeable. meta prints scalars, and reports ?invalid meta type for anything else, so a path such as lua-env.quarto.version, which is a list of three numbers, needs the extension’s own shortcode.
Exporting to JSON
This site leaves the export off, since it would write host paths into a file the site then publishes:
extensions:
lua-env:
json: falseTurning it on writes lua-env.json beside the source document, so add it to .gitignore:
extensions:
lua-env:
json: trueNarrow it to what you actually want, and the file stays readable:
extensions:
lua-env:
json: true
json-include:
- pandoc.FORMAT
- quarto.versionOr keep everything except one noisy branch:
extensions:
lua-env:
json: true
json-exclude:
- quarto._quartojson-exclude-sensitive defaults to true and drops the input file, the output file, the project directories, and the Pandoc script path. Leave it on unless the file stays on your own machine.
Source
The repository ships a short, standalone starting point you can copy: example.qmd.