From db892f5b3414770c83fa74d575f9feed8451b50c Mon Sep 17 00:00:00 2001 From: Jon Harper Date: Thu, 22 May 2014 10:44:39 +0200 Subject: [PATCH] YAML: oops, fix according to help-lint --- extra/yaml/yaml-docs.factor | 46 +++++++++++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/extra/yaml/yaml-docs.factor b/extra/yaml/yaml-docs.factor index 978fd5d1a7..5a02f9da29 100644 --- a/extra/yaml/yaml-docs.factor +++ b/extra/yaml/yaml-docs.factor @@ -167,6 +167,7 @@ ARTICLE: "yaml" "YAML serialization" "yaml-config" } { $examples + { $heading "Input" } { $example "USING: prettyprint yaml ;" "\"- true - null @@ -179,8 +180,49 @@ ARTICLE: "yaml" "YAML serialization" - 4.2e1\" yaml> ." "{ t f \"42\" \"42\" 42 42 42 42.0 42.0 }" } - { $example "USING: yaml ;" -"""{ t 32 "foobar" { "nested" "list" } H{ { "nested" "assoc" } } } >yaml print""" +{ $heading "Output -- human readable" } + { $example "USING: yaml yaml.config ;" +"t implicit-tags set +t implicit-start set +t implicit-end set ++libyaml-default+ emitter-canonical set ++libyaml-default+ emitter-indent set ++libyaml-default+ emitter-width set ++libyaml-default+ emitter-line-break set +t emitter-unicode set +" +"""{ + H{ + { "name" "Mark McGwire" } + { "hr" 65 } + { "avg" 0.278 } + } + H{ + { "name" "Sammy Sosa" } + { "hr" 63 } + { "avg" 0.288 } + } +} >yaml print""" + "- name: Mark McGwire + hr: 65 + avg: 0.278 +- name: Sammy Sosa + hr: 63 + avg: 0.288 +" + } +{ $heading "Output -- verbose" } + { $example "USING: yaml yaml.config ;" +"""f implicit-tags set +f implicit-start set +f implicit-end set ++libyaml-default+ emitter-canonical set ++libyaml-default+ emitter-indent set ++libyaml-default+ emitter-width set ++libyaml-default+ emitter-line-break set +t emitter-unicode set + +{ t 32 "foobar" { "nested" "list" } H{ { "nested" "assoc" } } } >yaml print""" "--- !!seq\n- !!bool true\n- !!int 32\n- !!str foobar\n- !!seq\n - !!str nested\n - !!str list\n- !!map\n !!str nested: !!str assoc\n...\n" } }