Skip to content

Commit 8edcc91

Browse files
committed
Document QUARTO_PROJECT_SCRIPT_PROGRESS and QUARTO_PROJECT_SCRIPT_QUIET env vars
Add two new environment variables from quarto-dev/quarto-cli#12444 to the pre/post render scripts documentation and the environment variables reference. These let scripts adapt their output based on progress display availability and quiet mode.
1 parent 15d94ec commit 8edcc91

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

docs/advanced/environment-vars.qmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,9 @@ ENV["QUARTO_DOCUMENT_PATH"]
8989
+--------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
9090
| `QUARTO_EXECUTE_INFO` | `QUARTO_EXECUTE_INFO` holds the path of a file containing a JSON object with [execution information for Quarto engines](./quarto-execute-info.qmd). This is accessible by code in executable code cells. |
9191
+--------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
92+
| `QUARTO_PROJECT_SCRIPT_PROGRESS` | Set to `"1"` when progress output can be shown during [pre/post render scripts](/docs/projects/scripts.qmd) (e.g. rendering multiple files), `"0"` otherwise. |
93+
+--------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
94+
| `QUARTO_PROJECT_SCRIPT_QUIET` | Set to `"1"` when the `--quiet` flag is active during [pre/post render scripts](/docs/projects/scripts.qmd), `"0"` otherwise. |
95+
+--------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
9296

9397
For more information on the JSON object referenced by `QUARTO_EXECUTE_INFO`, see [Quarto engine execution information](./quarto-execute-info.qmd).

docs/projects/scripts.qmd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,10 @@ The following environment variables are passed to pre and post-render scripts (n
6060
| `QUARTO_PROJECT_OUTPUT_DIR` | Output directory |
6161
| `QUARTO_PROJECT_INPUT_FILES` | Newline separated list of all input files being rendered (passed only to `pre-render`) |
6262
| `QUARTO_PROJECT_OUTPUT_FILES` | Newline separated list of all output files rendered (passed only to `post-render`). |
63+
| `QUARTO_PROJECT_SCRIPT_PROGRESS` | Set to `"1"` when progress output can be shown (e.g. rendering multiple files), `"0"` otherwise. |
64+
| `QUARTO_PROJECT_SCRIPT_QUIET` | Set to `"1"` when the `--quiet` flag is active, `"0"` otherwise. |
65+
66+
Scripts can use `QUARTO_PROJECT_SCRIPT_PROGRESS` and `QUARTO_PROJECT_SCRIPT_QUIET` to adapt their output, for example by suppressing progress indicators when running in quiet mode or when progress display is not available.
6367

6468
The project metadata and render list will be re-computed after any pre-render scripts have executed, allowing them to modify this project data.
6569
For example, a pre-render script might generate additional `qmd` files or `ipynb` files that should be rendered.

0 commit comments

Comments
 (0)