Replies: 2 comments 8 replies
-
Nothing has changed. You can use environment variables instead with the corresponding file and shortcode.
Alternatively, parameters are designed for computations: https://quarto.org/docs/computations/parameters.html |
Beta Was this translation helpful? Give feedback.
8 replies
-
The The The order is:
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description
I am trying to make a quarto document that contains tutorials for a software package, and I'd like to make the document generic with the ability to change customer-specific settings -- like the connection URL for a database -- and evaluate and render the code with these installation specific settings interpolated in. So, I am trying to define these settings in
_variables.yml
. However, it seems_variables.yml
quarto document
I would like this to render and show the user the actual command for them to run, e.g.
However, I found that this variable was not substituted before the code chunk was executed, producing errors. Are the variables in
_variables.yml
only designed to work in Markdown text outside of code blocks? I had at first thought they were substituted by a Lua pre-processing step that occurred prior to code evaluation. However, according to a comment from a couple years ago, the order is opposite:#6768 (comment)
Is this still the case? If so, there is a different method recommended to have some sort of "macro" system to templatize code blocks before execution? One brute force solution would be for me to use jinja2 templates (though the syntax overlaps with Quarto variable/metadata syntax and might make it hard to use the latter at all); but is there a Quarto-native alternative?
Beta Was this translation helpful? Give feedback.
All reactions