]> andersk Git - libyaml.git/commitdiff
added an examples directory with a few yaml examples
authorAlex Gaynor <alex.gaynor@gmail.com>
Wed, 23 Nov 2016 15:52:14 +0000 (09:52 -0600)
committerAlex Gaynor <alex.gaynor@gmail.com>
Wed, 23 Nov 2016 15:52:14 +0000 (09:52 -0600)
examples/anchors.yaml [new file with mode: 0644]
examples/array.yaml [new file with mode: 0644]
examples/json.yaml [new file with mode: 0644]
examples/mapping.yaml [new file with mode: 0644]
examples/numbers.yaml [new file with mode: 0644]
examples/strings.yaml [new file with mode: 0644]
examples/tags.yaml [new file with mode: 0644]

diff --git a/examples/anchors.yaml b/examples/anchors.yaml
new file mode 100644 (file)
index 0000000..8755853
--- /dev/null
@@ -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 (file)
index 0000000..18efd12
--- /dev/null
@@ -0,0 +1,2 @@
+- member
+- member2
diff --git a/examples/json.yaml b/examples/json.yaml
new file mode 100644 (file)
index 0000000..7822ddc
--- /dev/null
@@ -0,0 +1 @@
+{"key": ["value", 3]}
diff --git a/examples/mapping.yaml b/examples/mapping.yaml
new file mode 100644 (file)
index 0000000..53d2567
--- /dev/null
@@ -0,0 +1,2 @@
+key: value
+other-key: other-value
diff --git a/examples/numbers.yaml b/examples/numbers.yaml
new file mode 100644 (file)
index 0000000..45d2bf0
--- /dev/null
@@ -0,0 +1 @@
+[100, 12.5, -130, 1.3e+9]
diff --git a/examples/strings.yaml b/examples/strings.yaml
new file mode 100644 (file)
index 0000000..31b641f
--- /dev/null
@@ -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 (file)
index 0000000..3d31538
--- /dev/null
@@ -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
This page took 0.0354 seconds and 5 git commands to generate.