diff options
author | Alex Gaynor <alex.gaynor@gmail.com> | 2016-11-23 09:52:14 -0600 |
---|---|---|
committer | Alex Gaynor <alex.gaynor@gmail.com> | 2016-11-23 09:52:14 -0600 |
commit | 1d24d4d2ab6656bba29e949cdf5ffe15b98429cb (patch) | |
tree | 7aa053eaa9b53d9bbd4f25779affb01ecc75def7 /examples | |
parent | 6db69c72d4823a95c8feddaaa4380d13cf02939c (diff) | |
download | libyaml-git-1d24d4d2ab6656bba29e949cdf5ffe15b98429cb.tar.gz |
added an examples directory with a few yaml examples
Diffstat (limited to 'examples')
-rw-r--r-- | examples/anchors.yaml | 10 | ||||
-rw-r--r-- | examples/array.yaml | 2 | ||||
-rw-r--r-- | examples/json.yaml | 1 | ||||
-rw-r--r-- | examples/mapping.yaml | 2 | ||||
-rw-r--r-- | examples/numbers.yaml | 1 | ||||
-rw-r--r-- | examples/strings.yaml | 7 | ||||
-rw-r--r-- | examples/tags.yaml | 6 |
7 files changed, 29 insertions, 0 deletions
diff --git a/examples/anchors.yaml b/examples/anchors.yaml new file mode 100644 index 0000000..8755853 --- /dev/null +++ b/examples/anchors.yaml @@ -0,0 +1,10 @@ +base: &base + name: Everyone has same name + +foo: &foo + <<: *base + age: 10 + +bar: &bar + <<: *base + age: 20 diff --git a/examples/array.yaml b/examples/array.yaml new file mode 100644 index 0000000..18efd12 --- /dev/null +++ b/examples/array.yaml @@ -0,0 +1,2 @@ +- member +- member2 diff --git a/examples/json.yaml b/examples/json.yaml new file mode 100644 index 0000000..7822ddc --- /dev/null +++ b/examples/json.yaml @@ -0,0 +1 @@ +{"key": ["value", 3]} diff --git a/examples/mapping.yaml b/examples/mapping.yaml new file mode 100644 index 0000000..53d2567 --- /dev/null +++ b/examples/mapping.yaml @@ -0,0 +1,2 @@ +key: value +other-key: other-value diff --git a/examples/numbers.yaml b/examples/numbers.yaml new file mode 100644 index 0000000..45d2bf0 --- /dev/null +++ b/examples/numbers.yaml @@ -0,0 +1 @@ +[100, 12.5, -130, 1.3e+9] diff --git a/examples/strings.yaml b/examples/strings.yaml new file mode 100644 index 0000000..31b641f --- /dev/null +++ b/examples/strings.yaml @@ -0,0 +1,7 @@ +unqouted: string +literal-block: | + This entire block of text will be the value of the 'literal-block' key, + with line breaks being preserved. +folded: > + This entire block of text will be the value of 'folded', but this + time, all newlines will be replaced with a single space. diff --git a/examples/tags.yaml b/examples/tags.yaml new file mode 100644 index 0000000..3d31538 --- /dev/null +++ b/examples/tags.yaml @@ -0,0 +1,6 @@ +gif_file: !!binary | + R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5 + OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+ + +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC + AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= +explicit_string: !!str 0.5 |