Update SYNTAX.md

pull/628/head
Adi Eyal 2023-08-28 11:21:32 +02:00 committed by GitHub
parent 5351517a66
commit 39c06b3040
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -56,7 +56,7 @@ You can add weights to options to control their relative frequency. To do this,
`{0.5::summer|0.1::autumn|0.3::winter|0.1::spring}`
```
The weights are relative and do not have to add up to 1. If you omit a weight, it is assumed to be 1.
The weights are relative and do not have to add up to 1. If you omit a weight, it is assumed to be 1. Weights are also possible in YAML wildcard files, [see below](#weighted-options-in-yaml).
### Choosing Multiple Values
@ -295,6 +295,17 @@ artists:
The last two entries are ignore since they don't store arrays.
##### Weighted options in YAML
A handy feature of YAML files is that they provide an easy way to add weights to wildcards, something which isn't possible using standard text files. Here is an example:
```yaml
{
2::red
| 3::blue
| 1:: green
}
```
#### JSON files
Similiar to YAML, you can use json files as well: