diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Text/Pandoc/Readers/Ipynb.hs | 6 | ||||
-rw-r--r-- | src/Text/Pandoc/Writers/Ipynb.hs | 6 |
2 files changed, 0 insertions, 12 deletions
diff --git a/src/Text/Pandoc/Readers/Ipynb.hs b/src/Text/Pandoc/Readers/Ipynb.hs index 0bcde1990..2497e6a0a 100644 --- a/src/Text/Pandoc/Readers/Ipynb.hs +++ b/src/Text/Pandoc/Readers/Ipynb.hs @@ -72,14 +72,8 @@ 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) -> diff --git a/src/Text/Pandoc/Writers/Ipynb.hs b/src/Text/Pandoc/Writers/Ipynb.hs index 257edc613..c9d71e180 100644 --- a/src/Text/Pandoc/Writers/Ipynb.hs +++ b/src/Text/Pandoc/Writers/Ipynb.hs @@ -38,7 +38,6 @@ import Prelude import Control.Monad.State import qualified Data.Map as M import Data.Maybe (catMaybes, fromMaybe) -import Data.List (isPrefixOf) import Text.Pandoc.Options import Text.Pandoc.Definition import Data.Ipynb as Ipynb @@ -79,11 +78,6 @@ pandocToNotebook opts (Pandoc meta blocks) = do let inlineWriter ils = T.stripEnd <$> writeMarkdown opts{ writerTemplate = Nothing } (Pandoc nullMeta [Plain ils]) metadata' <- metaToJSON' blockWriter inlineWriter $ - (Meta . - M.mapKeys (\k -> if "jupyter_" `isPrefixOf` k - then drop 8 k - else k) . - unMeta) $ B.deleteMeta "nbformat" $ B.deleteMeta "nbformat_minor" $ meta let metadata = case fromJSON metadata' of |