diff options
author | Kolen Cheung <christian.kolen@gmail.com> | 2021-09-10 18:33:24 -0700 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2021-09-10 21:11:28 -0700 |
commit | e6bf1626d2088d95827e8cce43fddd6bbd422e74 (patch) | |
tree | fc87574468807ae6a0bda7caedc54829919002ef /src/Text/Pandoc/Readers | |
parent | 6aa1087b97466bd733e10c8e826c522e6acf874b (diff) | |
download | pandoc-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.hs | 16 |
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 |