Skip to content

Commit 620a00a

Browse files
authored
add julia engine section to params docs (#1780)
1 parent b8606b1 commit 620a00a

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

docs/computations/_parameters.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This article describes how to define and use computational parameters with Quart
1111

1212
## Definition
1313

14-
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.
14+
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.
1515

1616
### Jupyter
1717

@@ -56,6 +56,29 @@ params$alpha
5656
```
5757
````
5858

59+
### Julia
60+
61+
For the Julia engine, parameters are defined via the `params` YAML option.
62+
63+
``` yaml
64+
---
65+
engine: julia
66+
params:
67+
alpha: 0.1
68+
ratio: 0.1
69+
---
70+
```
71+
72+
Each key is evaluated as a constant and can be accessed under that name.
73+
Note that this means only keys that are valid Julia variable names are allowed.
74+
For example, `some_key` is valid while `some-key` isn't, even though the latter is a valid YAML key.
75+
76+
````julia
77+
```{{julia}}
78+
alpha
79+
```
80+
````
81+
5982
## Rendering
6083

6184
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):

0 commit comments

Comments
 (0)