From 985d23a52b76593a120adff5381c2df3a80fe298 Mon Sep 17 00:00:00 2001 From: HairyFotr Date: Wed, 23 Aug 2017 10:14:39 +0200 Subject: Fix a bunch of typos --- yaml.html.markdown | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'yaml.html.markdown') diff --git a/yaml.html.markdown b/yaml.html.markdown index 95adbd83..3b32a069 100644 --- a/yaml.html.markdown +++ b/yaml.html.markdown @@ -27,7 +27,7 @@ another_key: Another value goes here. a_number_value: 100 scientific_notation: 1e+12 # The number 1 will be interpreted as a number, not a boolean. if you want -# it to be intepreted as a boolean, use true +# it to be interpreted as a boolean, use true boolean: true null_value: null key with spaces: value @@ -132,7 +132,7 @@ python_complex_number: !!python/complex 1+2j # We can also use yaml complex keys with language specific tags ? !!python/tuple [5, 7] : Fifty Seven -# Would be {(5, 7): 'Fifty Seven'} in python +# Would be {(5, 7): 'Fifty Seven'} in Python #################### # EXTRA YAML TYPES # -- cgit v1.2.3 From 7cd43d8ad42b61948d2c571c202ee9b3d210e153 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ingy=20d=C3=B6t=20Net?= Date: Thu, 25 Jan 2018 13:51:15 -0800 Subject: [yaml/en] Use preferred style; add missing uses * YAML allows literal tabs in content, but not indentation. * Two space indent always preferred. * Note: YAML dumpers always use 2 space by default. * '- ...' doesn't need extra indentation. * Note: YAML dumpers don't use extra indentation. * There was no mention of single quoted strings. They are preferred and should be used except when double quote semantics are actually required. (Best practice). * Add flow form example for sets: `{a, b, c}` * Show collapsed form of seq-in-seq: `- - - foo`. --- yaml.html.markdown | 81 +++++++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 37 deletions(-) (limited to 'yaml.html.markdown') diff --git a/yaml.html.markdown b/yaml.html.markdown index 3b32a069..52658453 100644 --- a/yaml.html.markdown +++ b/yaml.html.markdown @@ -2,8 +2,8 @@ language: yaml filename: learnyaml.yaml contributors: - - ["Adam Brenecki", "https://github.com/adambrenecki"] - - ["Suhas SG", "https://github.com/jargnar"] +- [Adam Brenecki, 'https://github.com/adambrenecki'] +- [Suhas SG, 'https://github.com/jargnar'] --- YAML is a data serialisation language designed to be directly writable and @@ -11,7 +11,7 @@ readable by humans. It's a strict superset of JSON, with the addition of syntactically significant newlines and indentation, like Python. Unlike Python, however, -YAML doesn't allow literal tab characters at all. +YAML doesn't allow literal tab characters for indentation. ```yaml # Comments in YAML look like this. @@ -32,8 +32,10 @@ boolean: true null_value: null key with spaces: value # Notice that strings don't need to be quoted. However, they can be. -however: "A string, enclosed in quotes." -"Keys can be quoted too.": "Useful if you want to put a ':' in your key." +however: 'A string, enclosed in quotes.' +'Keys can be quoted too.': "Useful if you want to put a ':' in your key." +single quotes: 'have ''one'' escape pattern' +double quotes: "have many: \", \0, \t, \u263A, \x0d\x0a == \r\n, and more." # Multiple-line strings can be written either as a 'literal block' (using |), # or a 'folded block' (using '>'). @@ -59,12 +61,12 @@ folded_style: > # COLLECTION TYPES # #################### -# Nesting is achieved by indentation. +# Nesting uses indentation. 2 space indent is preferred (but not required). a_nested_map: - key: value - another_key: Another Value - another_nested_map: - hello: hello + key: value + another_key: Another Value + another_nested_map: + hello: hello # Maps don't have to have string keys. 0.25: a float key @@ -72,8 +74,8 @@ a_nested_map: # Keys can also be complex, like multi-line objects # We use ? followed by a space to indicate the start of a complex key. ? | - This is a key - that has multiple lines + This is a key + that has multiple lines : and this is its value # YAML also allows mapping between sequences with the complex key syntax @@ -83,22 +85,26 @@ a_nested_map: - Real Madrid : [ 2001-01-01, 2002-02-02 ] -# Sequences (equivalent to lists or arrays) look like this: +# Sequences (equivalent to lists or arrays) look like this +# (note that the '-' counts as indentation): a_sequence: - - Item 1 - - Item 2 - - 0.5 # sequences can contain disparate types. - - Item 4 - - key: value - another_key: another_value - - - - This is a sequence - - inside another sequence +- Item 1 +- Item 2 +- 0.5 # sequences can contain disparate types. +- Item 4 +- key: value + another_key: another_value +- + - This is a sequence + - inside another sequence +- - - Nested sequence indicators + - can be collapsed # Since YAML is a superset of JSON, you can also write JSON-style maps and # sequences: json_map: {"key": "value"} json_seq: [3, 2, 1, "takeoff"] +and quotes are optional: {key: [3, 2, 1, takeoff]} ####################### # EXTRA YAML FEATURES # @@ -111,15 +117,15 @@ other_anchor: *anchor_name # Anchors can be used to duplicate/inherit properties base: &base - name: Everyone has same name + name: Everyone has same name foo: &foo - <<: *base - age: 10 + <<: *base + age: 10 bar: &bar - <<: *base - age: 20 + <<: *base + age: 20 # foo and bar would also have name: Everyone has same name @@ -147,22 +153,23 @@ date: 2002-12-14 # The !!binary tag indicates that a string is actually a base64-encoded # representation of a binary blob. 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= + R0lGODlhDAAMAIQAAP//9/X17unp5WZmZgAAAOfn515eXvPz7Y6OjuDg4J+fn5 + OTk6enp56enmlpaWNjY6Ojo4SEhP/++f/++f/++f/++f/++f/++f/++f/++f/+ + +f/++f/++f/++f/++f/++SH+Dk1hZGUgd2l0aCBHSU1QACwAAAAADAAMAAAFLC + AgjoEwnuNAFOhpEMTRiggcz4BNJHrv/zCFcLiwMWYNG84BwwEeECcgggoBADs= # YAML also has a set type, which looks like this: set: - ? item1 - ? item2 - ? item3 + ? item1 + ? item2 + ? item3 +or: {item1, item2, item3} # Like Python, sets are just maps with null values; the above is equivalent to: set2: - item1: null - item2: null - item3: null + item1: null + item2: null + item3: null ``` ### More Resources -- cgit v1.2.3 From dba905ffd2929ac78509d019bc8b609699ee11cb Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Fri, 26 Oct 2018 03:25:48 +0530 Subject: Fix YAML, closes #3172 (#3329) * Fix yamllint errors * Fix link --- yaml.html.markdown | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) (limited to 'yaml.html.markdown') diff --git a/yaml.html.markdown b/yaml.html.markdown index 52658453..ab0f9d55 100644 --- a/yaml.html.markdown +++ b/yaml.html.markdown @@ -14,6 +14,8 @@ significant newlines and indentation, like Python. Unlike Python, however, YAML doesn't allow literal tab characters for indentation. ```yaml +--- # document start + # Comments in YAML look like this. ################ @@ -83,22 +85,22 @@ a_nested_map: # An example ? - Manchester United - Real Madrid -: [ 2001-01-01, 2002-02-02 ] +: [2001-01-01, 2002-02-02] # Sequences (equivalent to lists or arrays) look like this # (note that the '-' counts as indentation): a_sequence: -- Item 1 -- Item 2 -- 0.5 # sequences can contain disparate types. -- Item 4 -- key: value - another_key: another_value -- - - This is a sequence - - inside another sequence -- - - Nested sequence indicators - - can be collapsed + - Item 1 + - Item 2 + - 0.5 # sequences can contain disparate types. + - Item 4 + - key: value + another_key: another_value + - + - This is a sequence + - inside another sequence + - - - Nested sequence indicators + - can be collapsed # Since YAML is a superset of JSON, you can also write JSON-style maps and # sequences: @@ -170,9 +172,11 @@ set2: item1: null item2: null item3: null + +... # document end ``` ### More Resources + [YAML official website](http://yaml.org/) -+ [Online YAML Validator](http://codebeautify.org/yaml-validator) ++ [Online YAML Validator](http://www.yamllint.com/) -- cgit v1.2.3 From 62e9ea6b71d7c2cbb7b408f17fba32d355ea43ba Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Sat, 27 Oct 2018 18:16:06 +0530 Subject: Explain regexp, closes #2197 --- yaml.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'yaml.html.markdown') diff --git a/yaml.html.markdown b/yaml.html.markdown index ab0f9d55..d51b2147 100644 --- a/yaml.html.markdown +++ b/yaml.html.markdown @@ -121,6 +121,10 @@ other_anchor: *anchor_name base: &base name: Everyone has same name +# The regexp << is called Merge Key Language-Independent Type. It is is used to +# indicate that all the keys of one or more specified maps should be inserted +# into the current map. + foo: &foo <<: *base age: 10 -- cgit v1.2.3 From 699ab98187ba01da8cf2874ef9048139a6727b5f Mon Sep 17 00:00:00 2001 From: Divay Prakash Date: Sat, 27 Oct 2018 18:32:40 +0530 Subject: Correct wording, closes #3098 --- yaml.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'yaml.html.markdown') diff --git a/yaml.html.markdown b/yaml.html.markdown index d51b2147..8683971e 100644 --- a/yaml.html.markdown +++ b/yaml.html.markdown @@ -171,7 +171,7 @@ set: ? item3 or: {item1, item2, item3} -# Like Python, sets are just maps with null values; the above is equivalent to: +# Sets are just maps with null values; the above is equivalent to: set2: item1: null item2: null -- cgit v1.2.3 From ef4106486f94fb8273e27a8aab0babc4324a3e20 Mon Sep 17 00:00:00 2001 From: Rohith Reddy Kumbharkar <5032439+rohith@users.noreply.github.com> Date: Fri, 7 Dec 2018 20:48:37 +0530 Subject: Removed duplicate **is** --- yaml.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'yaml.html.markdown') diff --git a/yaml.html.markdown b/yaml.html.markdown index 8683971e..09c5dfc5 100644 --- a/yaml.html.markdown +++ b/yaml.html.markdown @@ -121,7 +121,7 @@ other_anchor: *anchor_name base: &base name: Everyone has same name -# The regexp << is called Merge Key Language-Independent Type. It is is used to +# The regexp << is called Merge Key Language-Independent Type. It is used to # indicate that all the keys of one or more specified maps should be inserted # into the current map. -- cgit v1.2.3 From f2b4df9a8e57406212101fc17be05c1a5858a1b3 Mon Sep 17 00:00:00 2001 From: Peter Uithoven Date: Fri, 5 Jul 2019 17:09:05 +0200 Subject: UTF-8/16/32 characters need to be encoded --- yaml.html.markdown | 2 ++ 1 file changed, 2 insertions(+) (limited to 'yaml.html.markdown') diff --git a/yaml.html.markdown b/yaml.html.markdown index 09c5dfc5..f1393c09 100644 --- a/yaml.html.markdown +++ b/yaml.html.markdown @@ -38,6 +38,8 @@ however: 'A string, enclosed in quotes.' 'Keys can be quoted too.': "Useful if you want to put a ':' in your key." single quotes: 'have ''one'' escape pattern' double quotes: "have many: \", \0, \t, \u263A, \x0d\x0a == \r\n, and more." +# UTF-8/16/32 characters need to be encoded +Superscript two: \u00B2 # Multiple-line strings can be written either as a 'literal block' (using |), # or a 'folded block' (using '>'). -- cgit v1.2.3 From 5864aba42d2cf57dfe96049568b3a9689ea6a813 Mon Sep 17 00:00:00 2001 From: Leigh Brenecki Date: Thu, 13 Feb 2020 10:38:29 +1030 Subject: Purge my deadname --- yaml.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'yaml.html.markdown') diff --git a/yaml.html.markdown b/yaml.html.markdown index f1393c09..4f10a128 100644 --- a/yaml.html.markdown +++ b/yaml.html.markdown @@ -2,7 +2,7 @@ language: yaml filename: learnyaml.yaml contributors: -- [Adam Brenecki, 'https://github.com/adambrenecki'] +- [Leigh Brenecki, 'https://leigh.net.au'] - [Suhas SG, 'https://github.com/jargnar'] --- -- cgit v1.2.3 From 7d6d0311893226559a1ab57609971ed190672bcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B0=AD=E4=B9=9D=E9=BC=8E?= <109224573@qq.com> Date: Tue, 20 Oct 2020 16:56:44 +0800 Subject: [yaml/en] Remove unused anchor --- yaml.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'yaml.html.markdown') diff --git a/yaml.html.markdown b/yaml.html.markdown index 4f10a128..6dc5905e 100644 --- a/yaml.html.markdown +++ b/yaml.html.markdown @@ -127,11 +127,11 @@ base: &base # indicate that all the keys of one or more specified maps should be inserted # into the current map. -foo: &foo +foo: <<: *base age: 10 -bar: &bar +bar: <<: *base age: 20 @@ -184,5 +184,5 @@ set2: ### More Resources -+ [YAML official website](http://yaml.org/) ++ [YAML official website](https://yaml.org/) + [Online YAML Validator](http://www.yamllint.com/) -- cgit v1.2.3