Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion docs/computations/_parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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):
Expand Down