mirror of
https://github.com/lightbend/config.git
synced 2025-03-14 19:30:25 +08:00
doc ToC ordering
This commit is contained in:
parent
e5910b8739
commit
94dd4c97bd
36
HOCON.md
36
HOCON.md
@ -22,11 +22,11 @@
|
||||
- [Note: Arrays without commas or newlines](#note-arrays-without-commas-or-newlines)
|
||||
- [Path expressions](#path-expressions)
|
||||
- [Paths as keys](#paths-as-keys)
|
||||
- [Conditional expressions](#conditional-expressions)
|
||||
- [Substitutions](#substitutions)
|
||||
- [Self-Referential Substitutions](#self-referential-substitutions)
|
||||
- [The `+=` field separator](#the--field-separator)
|
||||
- [Examples of Self-Referential Substitutions](#examples-of-self-referential-substitutions)
|
||||
- [Conditional expressions](#conditional-expressions)
|
||||
- [Includes](#includes)
|
||||
- [Include syntax](#include-syntax)
|
||||
- [Include semantics: merging](#include-semantics-merging)
|
||||
@ -720,23 +720,6 @@ resolving an optional substitution (i.e. the `${?foo}` syntax).
|
||||
If `${?foo}` refers to itself then it's as if it referred to a
|
||||
nonexistent value.
|
||||
|
||||
### Conditional expressions
|
||||
|
||||
Conditional expressions allow for a block of configuration to be
|
||||
included or omitted based on the value of a substitution.
|
||||
|
||||
Example conditional expression:
|
||||
|
||||
- `if [${a} == "a"] { b: true }`
|
||||
|
||||
In this case, if the substitution ${a} was equal to the string "a"
|
||||
then the object { b: true } would be merged into the object that
|
||||
the conditional expression was declared inside. If it was not
|
||||
equal to "a" nothing would be merged.
|
||||
|
||||
The left hand side substitution cannot be optional. Currently, only equality comparisons are supported. The right hand side
|
||||
of the expression can be any string, quoted or unquoted, or a boolean.
|
||||
|
||||
#### The `+=` field separator
|
||||
|
||||
Fields may have `+=` as a separator rather than `:` or `=`. A
|
||||
@ -913,6 +896,23 @@ rather than by the path inside the `${}` expression, because
|
||||
substitutions may be resolved differently depending on their
|
||||
position in the file.
|
||||
|
||||
### Conditional expressions
|
||||
|
||||
Conditional expressions allow for a block of configuration to be
|
||||
included or omitted based on the value of a substitution.
|
||||
|
||||
Example conditional expression:
|
||||
|
||||
- `if [${a} == "a"] { b: true }`
|
||||
|
||||
In this case, if the substitution ${a} was equal to the string "a"
|
||||
then the object { b: true } would be merged into the object that
|
||||
the conditional expression was declared inside. If it was not
|
||||
equal to "a" nothing would be merged.
|
||||
|
||||
The left hand side substitution cannot be optional. Currently, only equality comparisons are supported. The right hand side
|
||||
of the expression can be any string, quoted or unquoted, or a boolean.
|
||||
|
||||
### Includes
|
||||
|
||||
#### Include syntax
|
||||
|
Loading…
Reference in New Issue
Block a user