diff options
author | John MacFarlane <jgm@berkeley.edu> | 2019-03-09 14:17:21 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2019-03-09 14:27:34 -0800 |
commit | 873f342f1144111f79f9415abd3dc00d44a7a3c6 (patch) | |
tree | 86619a113dd88ec25cae98afe730ee5af746f99d /test/ipynb | |
parent | bf4a164a6f832bbb8435c4021a6b019f8e1c29f7 (diff) | |
download | pandoc-873f342f1144111f79f9415abd3dc00d44a7a3c6.tar.gz |
Ipynb reader/writer: better handling of cell metadata.
We now handle even complex cell metadata in the Div's attributes.
Simple metadata fields are rendered as a plain string, and complex ones
as JSON.
Diffstat (limited to 'test/ipynb')
-rw-r--r-- | test/ipynb/simple.in.native | 2 | ||||
-rw-r--r-- | test/ipynb/simple.ipynb | 7 | ||||
-rw-r--r-- | test/ipynb/simple.out.native | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/test/ipynb/simple.in.native b/test/ipynb/simple.in.native index 67d0b52f2..b41400195 100644 --- a/test/ipynb/simple.in.native +++ b/test/ipynb/simple.in.native @@ -8,6 +8,6 @@ Pandoc (Meta {unMeta = fromList [("jupyter",MetaMap (fromList [("nbformat",MetaI [Header 2 ("pyout",[],[]) [Str "Pyout"]] ,Div ("",["cell","code"],[]) [CodeBlock ("",["python"],[]) "from IPython.display import HTML\nHTML(\"\"\"\n<script>\nconsole.log(\"hello\");\n</script>\n<b>HTML</b>\n\"\"\")"] -,Div ("",["cell","markdown"],[]) +,Div ("",["cell","markdown"],[("tags","[\"foo\",\"bar\"]")]) [Header 2 ("image",[],[]) [Str "Image"] ,Para [Str "This",Space,Str "image",Space,Image ("",[],[]) [Str "the",Space,Str "moon"] ("lalune.jpg",""),Space,Str "will",Space,Str "be",Space,Str "included",Space,Str "as",Space,Str "a",Space,Str "cell",SoftBreak,Str "attachment."]]] diff --git a/test/ipynb/simple.ipynb b/test/ipynb/simple.ipynb index fdbc709e2..d9f805fb1 100644 --- a/test/ipynb/simple.ipynb +++ b/test/ipynb/simple.ipynb @@ -45,7 +45,12 @@ }, { "cell_type": "markdown", - "metadata": {}, + "metadata": { + "tags": [ + "foo", + "bar" + ] + }, "source": [ "Image\n", "-----\n", diff --git a/test/ipynb/simple.out.native b/test/ipynb/simple.out.native index 50b543f9e..ea96b5917 100644 --- a/test/ipynb/simple.out.native +++ b/test/ipynb/simple.out.native @@ -8,6 +8,6 @@ Pandoc (Meta {unMeta = fromList [("jupyter",MetaMap (fromList [("nbformat",MetaS [Header 2 ("pyout",[],[]) [Str "Pyout"]] ,Div ("",["cell","code"],[]) [CodeBlock ("",["python"],[]) "from IPython.display import HTML\nHTML(\"\"\"\n<script>\nconsole.log(\"hello\");\n</script>\n<b>HTML</b>\n\"\"\")"] -,Div ("",["cell","markdown"],[]) +,Div ("",["cell","markdown"],[("tags","[\"foo\",\"bar\"]")]) [Header 2 ("image",[],[]) [Str "Image"] ,Para [Str "This",Space,Str "image",Space,Image ("",[],[]) [Str "the",Space,Str "moon"] ("lalune.jpg",""),Space,Str "will",Space,Str "be",Space,Str "included",Space,Str "as",Space,Str "a",Space,Str "cell",SoftBreak,Str "attachment."]]] |