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".
This commit is contained in:
parent
6aa1087b97
commit
e6bf1626d2
1 changed files with 10 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue