Skip to content

Commit bede583

Browse files
committed
lead with a more complete example in the readme
1 parent 2f56ecd commit bede583

File tree

1 file changed

+36
-3
lines changed

1 file changed

+36
-3
lines changed

src/_includes/partials/description.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,42 @@
11
<section class="kdl-section" id="description">
22

3-
KDL is a document language with xml-like semantics that looks like you're
4-
invoking a bunch of CLI commands! It's meant to be used both as a
3+
KDL is a small, pleasing document language with xml-like semantics that looks
4+
like you're invoking a bunch of CLI commands! It's meant to be used both as a
55
serialization format and a configuration language, much like JSON, YAML, or
6-
XML.
6+
XML. It looks like this:
7+
8+
```kdl
9+
package {
10+
name "my-pkg"
11+
version "1.2.3"
12+
13+
dependencies {
14+
// Nodes can have standalone values as well as key/value pairs.
15+
lodash "^3.2.1" optional=true alias="underscore"
16+
}
17+
18+
scripts {
19+
// "Raw" and multi-line strings are supported.
20+
build r#"
21+
echo "foo"
22+
node -c "console.log('hello, world!');"
23+
echo "foo" > some-file.txt
24+
"#
25+
}
26+
27+
// `\` breaks up a single node across multiple lines.
28+
the-matrix 1 2 3 \
29+
4 5 6 \
30+
7 8 9
31+
32+
// "Slashdash" comments operate at the node level, with just `/-`.
33+
/-this-is-commented {
34+
this "entire" "node" {
35+
"is" "gone"
36+
}
37+
}
38+
}
39+
```
740

841
There's a living [specification](https://github.com/kdl-org/kdl/blob/main/SPEC.md), as well as various
942
[implementations](#implementations). You can also check out the [FAQ](#faq) to

0 commit comments

Comments
 (0)