aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorKolen Cheung <christian.kolen@gmail.com>2021-09-10 18:33:24 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2021-09-10 21:11:28 -0700
commite6bf1626d2088d95827e8cce43fddd6bbd422e74 (patch)
treefc87574468807ae6a0bda7caedc54829919002ef /src/Text/Pandoc/Readers
parent6aa1087b97466bd733e10c8e826c522e6acf874b (diff)
downloadpandoc-e6bf1626d2088d95827e8cce43fddd6bbd422e74.tar.gz
feat(ipynb reader): add more Jupyter's "Raw NBConvert Format"
This adds most of the available formats selectable from Jupyter's interface "Raw NBConvert Format".
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r--src/Text/Pandoc/Readers/Ipynb.hs16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Ipynb.hs b/src/Text/Pandoc/Readers/Ipynb.hs
index dc2c61f56..dbb58fbe5 100644
--- a/src/Text/Pandoc/Readers/Ipynb.hs
+++ b/src/Text/Pandoc/Readers/Ipynb.hs
@@ -97,12 +97,16 @@ cellToBlocks opts lang c = do
let format = fromMaybe "ipynb" $ lookup "format" kvs
let format' =
case format of
- "text/html" -> "html"
- "text/latex" -> "latex"
- "application/pdf" -> "latex"
- "text/markdown" -> "markdown"
- "text/x-rst" -> "rst"
- _ -> format
+ "text/html" -> "html"
+ "slides" -> "html"
+ "text/latex" -> "latex"
+ "application/pdf" -> "latex"
+ "pdf" -> "latex"
+ "text/markdown" -> "markdown"
+ "text/x-rst" -> "rst"
+ "text/restructuredtext" -> "rst"
+ "text/asciidoc" -> "asciidoc"
+ _ -> format
return $ B.divWith ("",["cell","raw"],kvs) $ B.rawBlock format' source
Ipynb.Code{ codeOutputs = outputs, codeExecutionCount = ec } -> do
outputBlocks <- mconcat <$> mapM outputToBlock outputs