You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/computations/_parameters.md
+24-1Lines changed: 24 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ This article describes how to define and use computational parameters with Quart
11
11
12
12
## Definition
13
13
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.
15
15
16
16
### Jupyter
17
17
@@ -56,6 +56,29 @@ params$alpha
56
56
```
57
57
````
58
58
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
+
59
82
## Rendering
60
83
61
84
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