From: Alex Gaynor Date: Wed, 23 Nov 2016 15:52:14 +0000 (-0600) Subject: added an examples directory with a few yaml examples X-Git-Tag: upstream/0.2.1^2~55 X-Git-Url: http://andersk.mit.edu/gitweb/libyaml.git/commitdiff_plain/1d24d4d2ab6656bba29e949cdf5ffe15b98429cb?ds=sidebyside added an examples directory with a few yaml examples --- 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