diff --git a/docs/config/README.md b/docs/config/README.md index f8899751..2bdd0dea 100644 --- a/docs/config/README.md +++ b/docs/config/README.md @@ -65,7 +65,7 @@ You can use texts, variables and text groups in a format string. #### Variable A variable contains a `$` symbol followed by the name of the variable. -The name of a variable only contains letters, numbers and `_`. +The name of a variable can only contain letters, numbers and `_`. For example: @@ -112,21 +112,13 @@ For example: - When `$all` is a shortcut for `\[$a$b\] `, `($all)` will show nothing only if `$a` and `$b` are both `None`. This works the same as `(\[$a$b\] )`. -#### Escapable characters +#### Special characters -The following symbols have special usage in a format string. -If you want to print the following symbols, you have to escape them with a backslash (`\`). +The following symbols have special usage in a format string and must be escaped: `$ \ [ ] ( )`. -- \$ -- \\ -- [ -- ] -- ( -- ) - -Note that `toml` has [its own escape syntax](https://github.com/toml-lang/toml#user-content-string). -It is recommended to use a literal string (`''`) in your config. -If you want to use a basic string (`""`), pay attention to escape the backslash `\`. +Note that TOML has [both basic strings and literal strings](https://toml.io/en/v1.0.0#string). +It is recommended to use a literal string (surrounded by single quotes) in your config. +If you want to use a basic string (surrounded by double quotes), you must escape the backslash itself (i.e. use `\\`). For example, when you want to print a `$` symbol on a new line, the following configs for `format` are equivalent: