From 23e44186f9d7c67f17b96c965e733fc584dac1d6 Mon Sep 17 00:00:00 2001 From: Julius Krumbiegel <22495855+jkrumbiegel@users.noreply.github.com> Date: Fri, 26 Sep 2025 15:11:34 +0200 Subject: [PATCH] add julia engine section to params docs (#1780) (cherry picked from commit 620a00a914e9ed0959737b448ca543c74eca6a40) --- docs/computations/_parameters.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/docs/computations/_parameters.md b/docs/computations/_parameters.md index bbcc054d02..0d7242c0c7 100644 --- a/docs/computations/_parameters.md +++ b/docs/computations/_parameters.md @@ -11,7 +11,7 @@ This article describes how to define and use computational parameters with Quart ## Definition -Adding parameter definitions to a {{< meta document >}} works differently depending on whether you are using the [Jupyter](https://jupyter.org) or [Knitr](https://yihui.name/knitr) engine. +Adding parameter definitions to a {{< meta document >}} works differently depending on whether you are using the [Jupyter](https://jupyter.org), [Knitr](https://yihui.name/knitr) or Julia engine. ### Jupyter @@ -56,6 +56,29 @@ params$alpha ``` ```` +### Julia + +For the Julia engine, parameters are defined via the `params` YAML option. + +``` yaml +--- +engine: julia +params: + alpha: 0.1 + ratio: 0.1 +--- +``` + +Each key is evaluated as a constant and can be accessed under that name. +Note that this means only keys that are valid Julia variable names are allowed. +For example, `some_key` is valid while `some-key` isn't, even though the latter is a valid YAML key. + +````julia +```{{julia}} +alpha +``` +```` + ## Rendering To render using different parameters you can pass them on the command line using the `-P` flag (this works for both `.ipynb` or `.qmd` files):