quarto-dev / quarto-dev/quarto-cli
[Question/Feature Request] Parameterised notebooks within projects
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6k
- Forks
- 458
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 41
Description
Hi everyone,
I have a question regarding a somewhat advanced use case:
If I have created a project that contains a simple notebook (e.g. introduction.qmd) and a parameterised notebook (e.g. report_by_state.qmd) whose output is required multiple times with different parameter values is it possible to render the whole project using quarto render?
Say I want to render introduction.qmd and report_by_state.qmd for state 1, 2, and 3. If using html outputs this should result in
introduction.htmlreport_state_1.htmlreport_state_2.htmlreport_state_3.html
It is of course possible to write a shell script to render reports in this way, but I think it would be nice if there was something like this
project:
render:
- introduction.qmd
- input: report_by_state.qmd
params:
state: 1
output: report_state_1.html
- input: report_by_state.qmd
params:
state: 2
output: report_state_2.html
- input: report_by_state.qmd
params:
state: 3
output: report_state_3.html
and being able to render everything with a single quarto render.
Except writing a custom shell script, is there currently a method which makes it possible to achieve something like this?
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.
Research direction
Start with the project render configuration and the quarto render command described in the issue, then check whether repeated inputs with different parameters and output names are supported. Done means rendering one project produces introduction.html plus the three state-specific HTML reports without a custom shell script.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system, cli
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100