git.iko.soy/typeable/pandoc
on master help sign in
Include execution output in ipynb test.
e405d7bJohn MacFarlane
test/Tests/Old.hs+4−2
@@ -192,9 +192,11 @@ tests pandocPath =
192 "org-select-tags.org" "org-select-tags.native"
192 "org-select-tags.org" "org-select-tags.native"
193 ]
193 ]
194 , testGroup "ipynb"
194 , testGroup "ipynb"
195+ [ test' "reader" ["-f", "ipynb-raw_html-raw_tex+raw_attribute",
195− [ test' "reader" ["-f", "ipynb", "-t", "native", "-s"]
196+ "-t", "native", "-s"]
196 "ipynb/simple.ipynb" "ipynb/simple.out.native"
197 "ipynb/simple.ipynb" "ipynb/simple.out.native"
197− , test' "writer" ["-f", "native", "-t", "ipynb", "-s"]
198+ , test' "writer" ["-f", "native", "-t",
199+ "ipynb-raw_html-raw_tex+raw_attribute", "-s"]
198 "ipynb/simple.in.native" "ipynb/simple.ipynb"
200 "ipynb/simple.in.native" "ipynb/simple.ipynb"
199 ]
201 ]
200 ]
202 ]
test/ipynb/simple.in.native+4−2
@@ -6,8 +6,10 @@ Pandoc (Meta {unMeta = fromList [("jupyter",MetaMap (fromList [("nbformat",MetaI
6 [CodeBlock ("",["python"],[]) "print(\"hello\")"]
6 [CodeBlock ("",["python"],[]) "print(\"hello\")"]
7,Div ("",["cell","markdown"],[])
7,Div ("",["cell","markdown"],[])
8 [Header 2 ("pyout",[],[]) [Str "Pyout"]]
8 [Header 2 ("pyout",[],[]) [Str "Pyout"]]
9−,Div ("",["cell","code"],[])
9+,Div ("",["cell","code"],[("execution_count","2")])
10− [CodeBlock ("",["python"],[]) "from IPython.display import HTML\nHTML(\"\"\"\n<script>\nconsole.log(\"hello\");\n</script>\n<b>HTML</b>\n\"\"\")"]
10+ [CodeBlock ("",["python"],[]) "from IPython.display import HTML\nHTML(\"\"\"\n<script>\nconsole.log(\"hello\");\n</script>\n<b>HTML</b>\n\"\"\")"
11+ ,Div ("",["output","execute_result"],[("execution_count","2")])
12+ [RawBlock (Format "html") "<script>\nconsole.log(\"hello\");\n</script>\n<b>HTML</b>\nhello"]]
11,Div ("",["cell","markdown"],[("tags","[\"foo\",\"bar\"]")])
13,Div ("",["cell","markdown"],[("tags","[\"foo\",\"bar\"]")])
12 [Header 2 ("image",[],[]) [Str "Image"]
14 [Header 2 ("image",[],[]) [Str "Image"]
13 ,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."]]]
15 ,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."]]]
test/ipynb/simple.ipynb+17−2
@@ -30,9 +30,24 @@
30 },
30 },
31 {
31 {
32 "cell_type": "code",
32 "cell_type": "code",
33− "execution_count": null,
33+ "execution_count": 2,
34 "metadata": {},
34 "metadata": {},
35− "outputs": [],
35+ "outputs": [
36+ {
37+ "output_type": "execute_result",
38+ "execution_count": 2,
39+ "metadata": {},
40+ "data": {
41+ "text/html": [
42+ "<script>\n",
43+ "console.log(\"hello\");\n",
44+ "</script>\n",
45+ "<b>HTML</b>\n",
46+ "hello"
47+ ]
48+ }
49+ }
50+ ],
36 "source": [
51 "source": [
37 "from IPython.display import HTML\n",
52 "from IPython.display import HTML\n",
38 "HTML(\"\"\"\n",
53 "HTML(\"\"\"\n",
test/ipynb/simple.out.native+4−2
@@ -6,8 +6,10 @@ Pandoc (Meta {unMeta = fromList [("jupyter",MetaMap (fromList [("nbformat",MetaS
6 [CodeBlock ("",["python"],[]) "print(\"hello\")"]
6 [CodeBlock ("",["python"],[]) "print(\"hello\")"]
7,Div ("",["cell","markdown"],[])
7,Div ("",["cell","markdown"],[])
8 [Header 2 ("pyout",[],[]) [Str "Pyout"]]
8 [Header 2 ("pyout",[],[]) [Str "Pyout"]]
9−,Div ("",["cell","code"],[])
9+,Div ("",["cell","code"],[("execution_count","2")])
10− [CodeBlock ("",["python"],[]) "from IPython.display import HTML\nHTML(\"\"\"\n<script>\nconsole.log(\"hello\");\n</script>\n<b>HTML</b>\n\"\"\")"]
10+ [CodeBlock ("",["python"],[]) "from IPython.display import HTML\nHTML(\"\"\"\n<script>\nconsole.log(\"hello\");\n</script>\n<b>HTML</b>\n\"\"\")"
11+ ,Div ("",["output","execute_result"],[("execution_count","2")])
12+ [RawBlock (Format "html") "<script>\nconsole.log(\"hello\");\n</script>\n<b>HTML</b>\nhello"]]
11,Div ("",["cell","markdown"],[("tags","[\"foo\",\"bar\"]")])
13,Div ("",["cell","markdown"],[("tags","[\"foo\",\"bar\"]")])
12 [Header 2 ("image",[],[]) [Str "Image"]
14 [Header 2 ("image",[],[]) [Str "Image"]
13 ,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."]]]
15 ,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."]]]