mirror of https://github.com/kdl-org/kdl.git
small readme improvements
This commit is contained in:
parent
2d4bcd0b51
commit
f767472cab
18
README.md
18
README.md
|
|
@ -156,20 +156,20 @@ node2 "this\nhas\tescapes"
|
||||||
node3 #"C:\Users\zkat\raw\string"#
|
node3 #"C:\Users\zkat\raw\string"#
|
||||||
```
|
```
|
||||||
|
|
||||||
You don't have to quote strings unless they contain whitespace, or if any the
|
You don't have to quote strings unless any the following apply:
|
||||||
following apply:
|
|
||||||
* The string contains any of `[]{}()\/#";`.
|
|
||||||
* The string contains whitespace.
|
* The string contains whitespace.
|
||||||
|
* The string contains any of `[]{}()\/#";`.
|
||||||
* The string is one of `true`, `false`, or `null`.
|
* The string is one of `true`, `false`, or `null`.
|
||||||
* The strings starts with a digit, or `+`/`-` and a digit.
|
* The strings starts with a digit, or `+`/`-`/`.`/`-.`,`+.` and a digit.
|
||||||
* The string contains an equals sign (including unicode equals signs `﹦`,
|
* The string contains an equals sign (including unicode equals signs `﹦`,
|
||||||
`=`, and `🟰`).
|
`=`, and `🟰`).
|
||||||
|
|
||||||
In essence, if it can get confused for other KDL syntax, it needs quotes.
|
In essence, if it can get confused for other KDL or KQL syntax, it needs
|
||||||
|
quotes.
|
||||||
|
|
||||||
Both types of quoted string can be multiline as-is, without a different
|
Both types of quoted string can be multiline as-is, without a different
|
||||||
syntax. Additionally, these multi-line strings will be "dedented" according to
|
syntax. Additionally, common indentation shared with the line containing the
|
||||||
the common indentation that all lines share:
|
closing quote will be stripped/dedented:
|
||||||
|
|
||||||
```kdl
|
```kdl
|
||||||
string "
|
string "
|
||||||
|
|
@ -196,7 +196,7 @@ You can add any number of `#`s before and after the opening and
|
||||||
closing `#` to disambiguate literal closing `#"` sequences:
|
closing `#` to disambiguate literal closing `#"` sequences:
|
||||||
|
|
||||||
```kdl
|
```kdl
|
||||||
other-raw ##"hello"#world"##
|
other-raw ##"hello#"world"##
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Numbers
|
#### Numbers
|
||||||
|
|
@ -248,7 +248,7 @@ hello
|
||||||
```
|
```
|
||||||
|
|
||||||
On top of that, KDL supports `/-` "slashdash" comments, which can be used to
|
On top of that, KDL supports `/-` "slashdash" comments, which can be used to
|
||||||
comment out individual nodes, arguments, or children:
|
comment out individual nodes, arguments, or child blocks:
|
||||||
|
|
||||||
```kdl
|
```kdl
|
||||||
// This entire node and its children are all commented out.
|
// This entire node and its children are all commented out.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue