diff options
Diffstat (limited to 'src/Text/Pandoc/Readers')
-rw-r--r-- | src/Text/Pandoc/Readers/Ipynb.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Ipynb.hs b/src/Text/Pandoc/Readers/Ipynb.hs index 2497e6a0a..0bcde1990 100644 --- a/src/Text/Pandoc/Readers/Ipynb.hs +++ b/src/Text/Pandoc/Readers/Ipynb.hs @@ -72,8 +72,14 @@ notebookToPandoc :: (PandocMonad m, FromJSON (Notebook a)) notebookToPandoc opts notebook = do let cells = notebookCells notebook let (fmt,fmtminor) = notebookFormat notebook + let jupyterMetaFields :: [String] + jupyterMetaFields = ["kernelspec", "language_info", "toc"] let m = M.insert "nbformat" (MetaString $ show fmt) $ M.insert "nbformat_minor" (MetaString $ show fmtminor) $ + -- mark jupyter fields specially so it doesn't trigger toc + M.mapKeys (\k -> if k `elem` jupyterMetaFields + then "jupyter_" <> k + else k) $ jsonMetaToMeta (notebookMetadata notebook) let lang = case M.lookup "kernelspec" m of Just (MetaMap ks) -> |