@@ -77,9 +77,14 @@ pandocToNotebook opts (Pandoc meta blocks) = do
77 opts{ writerTemplate = Nothing } (Pandoc nullMeta bs)
77 opts{ writerTemplate = Nothing } (Pandoc nullMeta bs)
78 let inlineWriter ils = T.stripEnd <$> writeMarkdown
78 let inlineWriter ils = T.stripEnd <$> writeMarkdown
79 opts{ writerTemplate = Nothing } (Pandoc nullMeta [Plain ils])
79 opts{ writerTemplate = Nothing } (Pandoc nullMeta [Plain ils])
81+ case lookupMeta "jupyter" meta of
82+ Just (MetaMap m) -> (Meta m <> B.deleteMeta "jupyter" meta)
80 metadata' <- metaToJSON' blockWriter inlineWriter $
84 metadata' <- metaToJSON' blockWriter inlineWriter $
81 B.deleteMeta "nbformat" $
85 B.deleteMeta "nbformat" $
82− B.deleteMeta "nbformat_minor" $ meta
86+ B.deleteMeta "nbformat_minor" $ jupyterMeta
87+ -- convert from a Value (JSON object) to a M.Map Text Value:
83 let metadata = case fromJSON metadata' of
88 let metadata = case fromJSON metadata' of
84 Error _ -> mempty -- TODO warning here? shouldn't happen
89 Error _ -> mempty -- TODO warning here? shouldn't happen
85 Success x -> x
90 Success x -> x