quarto-dev / quarto-dev/quarto-cli

[Question/Feature Request] Parameterised notebooks within projects

Open
#864 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

engines-jupyter enhancement parameters projects
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.html
  • report_state_1.html
  • report_state_2.html
  • report_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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.