diff options
author | John MacFarlane <jgm@berkeley.edu> | 2018-09-15 14:32:06 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-15 14:32:06 -0700 |
commit | 6bd8037b8dc3a6e9d820d412d23fff99ec0c21a6 (patch) | |
tree | a58c10319121ad847f1c39e0c22cee9863fbfb70 /test | |
parent | f736dea4ba71f81b37ff28a218115871249b35ec (diff) | |
parent | 5347e9454fae70cd2b534ad8e3c02d1cea8c2d93 (diff) | |
download | pandoc-6bd8037b8dc3a6e9d820d412d23fff99ec0c21a6.tar.gz |
Merge pull request #4604 from mb21/yaml-file
Introduce --metadata-file option
Diffstat (limited to 'test')
-rw-r--r-- | test/command/yaml-metadata-blocks.md | 63 | ||||
-rw-r--r-- | test/command/yaml-metadata.yaml | 4 |
2 files changed, 67 insertions, 0 deletions
diff --git a/test/command/yaml-metadata-blocks.md b/test/command/yaml-metadata-blocks.md new file mode 100644 index 000000000..5b73cff72 --- /dev/null +++ b/test/command/yaml-metadata-blocks.md @@ -0,0 +1,63 @@ +``` +% pandoc -s -t native +--- +foobar_: this should be ignored +foo: + bar_: as should this +--- +^D +Pandoc (Meta {unMeta = fromList [("foo",MetaMap (fromList []))]}) +[] +``` +``` +% pandoc -s -t native +--- +# For precedence, see multiple-metadata-blocks.md and vars-and-metadata.md +# For Bools, see also 4819.md +# For Multiline strings, see yaml-with-chomp.md +int: 7 +float: 1.5 +scientific: 3.7e-5 +bool: true +more: False +nothing: null +emtpy: [] +nested: + int: 8 + float: 2.5 + bool: true + more: False + nothing: null + emtpy: [] + scientific: 3.7e-5 +--- +^D +Pandoc (Meta {unMeta = fromList [("bool",MetaBool True),("emtpy",MetaList []),("float",MetaInlines [Str "1.5"]),("int",MetaInlines [Str "7"]),("more",MetaBool False),("nested",MetaMap (fromList [("bool",MetaBool True),("emtpy",MetaList []),("float",MetaInlines [Str "2.5"]),("int",MetaInlines [Str "8"]),("more",MetaBool False),("nothing",MetaInlines [Str "null"]),("scientific",MetaInlines [Str "3.7e-5"])])),("nothing",MetaInlines [Str "null"]),("scientific",MetaInlines [Str "3.7e-5"])]}) +[] +``` +``` +% pandoc -s -t native +--- +array: + - foo: bar + - bool: True +--- +^D +Pandoc (Meta {unMeta = fromList [("array",MetaList [MetaMap (fromList [("foo",MetaInlines [Str "bar"])]),MetaMap (fromList [("bool",MetaBool True)])])]}) +[] +``` +``` +% pandoc -s -t native --metadata-file command/yaml-metadata.yaml +--- +title: document +--- +^D +Pandoc (Meta {unMeta = fromList [("other",MetaInlines [Emph [Str "markdown"],Space,Str "value"]),("title",MetaInlines [Str "document"])]}) +[] +``` +``` +% pandoc -s -t native --metadata-file command/yaml-metadata.yaml -M title=cmdline +^D +Pandoc (Meta {unMeta = fromList [("other",MetaInlines [Emph [Str "markdown"],Space,Str "value"]),("title",MetaString "cmdline")]}) +[] +``` diff --git a/test/command/yaml-metadata.yaml b/test/command/yaml-metadata.yaml new file mode 100644 index 000000000..9cd0043d3 --- /dev/null +++ b/test/command/yaml-metadata.yaml @@ -0,0 +1,4 @@ +--- +title: file +other: _markdown_ value +--- |