aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Error.hs
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2019-01-13 07:56:55 -0800
committerJohn MacFarlane <jgm@berkeley.edu>2019-01-22 21:45:59 -0800
commit395ea03069167568f8fccb018c794bd43a787b94 (patch)
tree6b42b2f5daec10b5f5bc5e62b42efc88f7a1053b /src/Text/Pandoc/Error.hs
parent5ddd7b121e1aea061b3e7b831dabbd13311929ff (diff)
downloadpandoc-395ea03069167568f8fccb018c794bd43a787b94.tar.gz
Support ipynb (Jupyter notebook) as input and output format.
[API change] * Depend on ipynb library. * Add `ipynb` as input and output format. * Added Text.Pandoc.Readers.Ipynb (supports both nbformat v3 and v4). * Added Text.Pandoc.Writers.Ipynb (supports nbformat v4). * Added ipynb readers and writers to T.P.Readers, T.P.Writers, and T.P.Extensions. Register the file extension .ipynb for this format. * Add `PandocIpynbDecodingError` constructor to Text.Pandoc.Error.Error. * Note: there is no template for ipynb.
Diffstat (limited to 'src/Text/Pandoc/Error.hs')
-rw-r--r--src/Text/Pandoc/Error.hs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Error.hs b/src/Text/Pandoc/Error.hs
index e4a5bb092..62843dbd2 100644
--- a/src/Text/Pandoc/Error.hs
+++ b/src/Text/Pandoc/Error.hs
@@ -70,6 +70,7 @@ data PandocError = PandocIOError String IOError
| PandocEpubSubdirectoryError String
| PandocMacroLoop String
| PandocUTF8DecodingError String Int Word8
+ | PandocIpynbDecodingError String
deriving (Show, Typeable, Generic)
instance Exception PandocError
@@ -124,6 +125,8 @@ handleError (Left e) =
"UTF-8 decoding error in " ++ f ++ " at byte offset " ++ show offset ++
" (" ++ printf "%2x" w ++ ").\n" ++
"The input must be a UTF-8 encoded text."
+ PandocIpynbDecodingError w -> err 93 $
+ "ipynb decoding error: " ++ w
err :: Int -> String -> IO a
err exitCode msg = do