summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAlex Gaynor <alex.gaynor@gmail.com>2016-11-23 09:52:14 -0600
committerAlex Gaynor <alex.gaynor@gmail.com>2016-11-23 09:52:14 -0600
commit1d24d4d2ab6656bba29e949cdf5ffe15b98429cb (patch)
tree7aa053eaa9b53d9bbd4f25779affb01ecc75def7 /examples
parent6db69c72d4823a95c8feddaaa4380d13cf02939c (diff)
downloadlibyaml-git-1d24d4d2ab6656bba29e949cdf5ffe15b98429cb.tar.gz
added an examples directory with a few yaml examples
Diffstat (limited to 'examples')
-rw-r--r--examples/anchors.yaml10
-rw-r--r--examples/array.yaml2
-rw-r--r--examples/json.yaml1
-rw-r--r--examples/mapping.yaml2
-rw-r--r--examples/numbers.yaml1
-rw-r--r--examples/strings.yaml7
-rw-r--r--examples/tags.yaml6
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