quarto-dev / quarto-dev/quarto-cli
Expose all LUA variables to Quarto meta shortcode
@cscheid is already working on this.
Since Mar 11, 2023.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
As originally discussed in #2249, here is a separate issue to discuss exposing LUA variables.
Currently, users do not have access to all LUA variables (from Quarto and Pandoc) which could be useful.
With that in mind I wrote a LUA filter/shortcode (https://github.com/mcanouil/quarto-lua-env) to expose the following objects recursively, or at least the scalar variables.
lua-env:
quarto: "quarto"
pandoc:
PANDOC_STATE: "PANDOC_STATE"
FORMAT: "FORMAT"
PANDOC_READER_OPTIONS: "PANDOC_READER_OPTIONS"
PANDOC_WRITER_OPTIONS: "PANDOC_WRITER_OPTIONS"
PANDOC_VERSION: "PANDOC_VERSION"
PANDOC_API_VERSION: "PANDOC_API_VERSION"
PANDOC_SCRIPT_FILE: "PANDOC_SCRIPT_FILE"
Variables can be accessed using:
{{< lua-env pandoc.PANDOC_VERSION >}}{{< meta lua-env.pandoc.PANDOC_VERSION >}}{{< lua-env quarto.doc.input_file >}}{{< meta lua-env.quarto.doc.input_file >}}
This could be integrated into Quarto if deemed useful to have such behaviour as exposing "all" LUA variables to shortcode for use in Quarto document and possibly in code cells in the future.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.