Replies: 10 comments 23 replies
-
See https://quarto.org/docs/computations/parameters.html and/or https://quarto.org/docs/projects/profiles.html. |
Beta Was this translation helpful? Give feedback.
-
@mcanouil I see many versions of "render a This is a worse, DIY version of Quarto projects, that fails to achieve many of the nice-to-haves of Quarto projects (like automatic navbar population based on contents of the project directory and convenient command-line options for freezing/caching output, etc.). I'm not sure whether this is what @joxborrow is after, but I personally would love a way to execute the same For me, the ideal solution would be an extension to the Quarto projects project:
render:
- template: analysis_1.qmd
params: study_1.yml
output: study_1-analysis_1.html
- template: analysis_1.qmd
params: study_2.yml
output: study_2-analysis_1.html
... There are many frameworks that support static site generation like Quarto, and there is precedent for an interface to dynamically specify generating output targets like this. In NextJS, this would be Currently, there are a few ways I can imagine using the Quarto "project" system to achieve this:
Any response would be greatly appreciated! Maybe the Thank you! Quarto is great and I'm thrilled to get to use it. |
Beta Was this translation helpful? Give feedback.
-
Surely I'm missing something but my understanding of profiles is that using multiple profiles will build multiple versions of your entire project into different directories. But the files in one of those directories would have been built without knowledge of the other directories, and thus the auto-generated navbars in the static files in those built directories (via globs or whatever else) would not be able to link to each other. Any additional comments are still so appreciated, learning a lot from this dialogue @mcanouil |
Beta Was this translation helpful? Give feedback.
-
@zachsiegel-capsida did you figure this out? I have the similar (and simpler) question: #7805 |
Beta Was this translation helpful? Give feedback.
-
I think I answered how to do it, by using the |
Beta Was this translation helpful? Give feedback.
-
Hey @f2il-kieranmace I don't love your solution since it requires dynamically generating Instead of generating
title: "USA"
params:
country: USA
title: "UK"
params:
country: UK and then use I have some issues with this method that I will put in a separate message. |
Beta Was this translation helpful? Give feedback.
-
@mcanouil Should I open separate issues for these is this a good place to discuss them?
The only way to specify parameters to For R, the My ideal solution would be able to specify params via a Commentary on whether I'm missing something on this point would be greatly appreciated.
Ideally for me, this would be possible via the command line or via project yaml. Like, maybe in profile:
default-render-all-profiles: true
group:
- [basic, advanced] and then Commentary on whether I'm missing something on this point would be greatly appreciated. @mcanouil I really appreciated your previous comments, additional feedback would be very appreciated! |
Beta Was this translation helpful? Give feedback.
-
Thank you @zachsiegel-capsida for keeping on asking these questions :-) and @mcanouil and @f2il-kieranmace for the solutions you've suggested. I followed this discussion carefully and I second @zachsiegel-capsida's questions. I couldn't make his suggested solution work nor translate the documentation into a different solution so I hope you will have some patience 🙂 I use quarto a lot and enthusiastically but solving this problem also required me to reach to Python, which I don't use that often. My use case follows the more general situation outlined by @zachsiegel-capsida. I want to generate reports for batches of output files, which are dynamically generated in series of simulations, so it is important to be able to render the same document for a new batch of files, each with a unique name, without a lot of manual work. Basically I am trying to use Quarto as a lab notebook to publish summaries of each simulation run. Summaries are all based on one template with the same plots and calculations that I am trying to run multiple times with parameters read from a Based on the suggestions in this thread and this brief one by @mcanouil I reached the following situation:
I hope someone will be able to answer any of these questions. In case it helps, the code is here: https://github.com/MindTheGap-ERC/LMA_utils/tree/automate_execution (just a prototype for now) |
Beta Was this translation helpful? Give feedback.
-
Hi! I´m new to this. I wonder if you know if there is a step by step. I have my notebook Untitled4.ipynb. I´m trying to render the same file with different combinations of params as is possible with R and Rstudio, but I can´t find the way to do it with python and the render on the command line. title: "Probando reportes con varios parámetros" #| tags: [parameters] years = 2022 #| echo: false print(years, provinces, stations) display(Markdown( The params I can use are these: years = [2022, 2023, 2024] I can´t find the way to use --execute params. I have a .txt file with the possible combinations, such as : and I also want the output to have for example {years}{provinces}{stations}.html as is possible in R. When I tried to change params manually :quarto render Untitled4.ipynb -P provinces: 'Provincia B' -P years:2023 -P stations:'Primavera' --output test_1.html the error output was: pandoc: Provincia B: withBinaryFile: does not exist (No such file or directory) and when I deleted -P provinces: 'Provincia B' it ran, but with the parameters set in the notebook (it didn´t take into account the changes). Thanks!!! |
Beta Was this translation helpful? Give feedback.
-
Another possible solution: https://stackoverflow.com/questions/76158024/include-parameters-in-header-and-footer-in-quarto-rmarkdown-pdf#answer-76405809 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is there a way to render a single qmd multiple times using different parameters as part of a quarto project?
Beta Was this translation helpful? Give feedback.
All reactions