What is the best way to pass pipeline parameters to Quarto, that could be accessed by the QMD and Python ? #13789
-
What I want to do:I am building some reports using a pipeline with different parameters. I want to print these parameters inside the LaTeX, QMD file, and also access them within the Python blocks. My method so far:
What I want to know?
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I suggest to see the other discussions labelled with "parameters". |
Beta Was this translation helpful? Give feedback.
-
For this part, the way would be to expose the parameter you want as metadata block so that you can use the See an example for R inside : https://quarto-dev.github.io/quarto-r/articles/dynamic-metadata.html Idea is that you will need to produce a YAML metadata block ---
title: "Test"
format: html
keep-md: true
---
Some content in the doc
```{python}
xyz = 3
```
Another part
```{python}
#| echo: false
#| output: asis
from IPython.display import Markdown
display(Markdown("---"))
display(Markdown(f"xyz: {xyz}"))
display(Markdown("---"))
```
the value of `xyz` is {{< meta xyz >}}
We don't have yet helpers tool with some wrappers in it, but you can already leverage this. |
Beta Was this translation helpful? Give feedback.

I suggest to see the other discussions labelled with "parameters".