@@ -1,4 +1,4 @@
1−{-# LANGUAGE DeriveDataTypeable #-}
1+{-# LANGUAGE DeriveDataTypeable, DeriveGeneric #-}
22{-
33Copyright (C) 2012-2015 John MacFarlane <jgm@berkeley.edu>
44
@@ -54,6 +54,7 @@ import Text.Pandoc.Highlighting (Style, pygments)
5454import Text.Pandoc.MediaBag (MediaBag)
5555import Data.Data (Data)
5656import Data.Typeable (Typeable)
57+import GHC.Generics (Generic)
5758
5859-- | Individually selectable syntax extensions.
5960data Extension =
@@ -114,7 +115,7 @@ data Extension =
114115 | Ext_line_blocks -- ^ RST style line blocks
115116 | Ext_epub_html_exts -- ^ Recognise the EPUB extended version of HTML
116117 | Ext_shortcut_reference_links -- ^ Shortcut reference links
117− deriving (Show, Read, Enum, Eq, Ord, Bounded, Data, Typeable)
118+ deriving (Show, Read, Enum, Eq, Ord, Bounded, Data, Typeable, Generic)
118119
119120pandocExtensions :: Set Extension
120121pandocExtensions = Set.fromList
@@ -258,7 +259,7 @@ data ReaderOptions = ReaderOptions{
258259 , readerDefaultImageExtension :: String -- ^ Default extension for images
259260 , readerTrace :: Bool -- ^ Print debugging info
260261 , readerTrackChanges :: TrackChanges
261−} deriving (Show, Read, Data, Typeable)
262+} deriving (Show, Read, Data, Typeable, Generic)
262263
263264instance Default ReaderOptions
264265 where def = ReaderOptions{
@@ -280,7 +281,7 @@ instance Default ReaderOptions
280281-- Writer options
281282--
282283
283−data EPUBVersion = EPUB2 | EPUB3 deriving (Eq, Show, Read, Data, Typeable)
284+data EPUBVersion = EPUB2 | EPUB3 deriving (Eq, Show, Read, Data, Typeable, Generic)
284285
285286data HTMLMathMethod = PlainMath
286287 | LaTeXMathML (Maybe String) -- url of LaTeXMathML.js
@@ -290,18 +291,18 @@ data HTMLMathMethod = PlainMath
290291 | MathML (Maybe String) -- url of MathMLinHTML.js
291292 | MathJax String -- url of MathJax.js
292293 | KaTeX String String -- url of stylesheet and katex.js
293− deriving (Show, Read, Eq, Data, Typeable)
294+ deriving (Show, Read, Eq, Data, Typeable, Generic)
294295
295296data CiteMethod = Citeproc -- use citeproc to render them
296297 | Natbib -- output natbib cite commands
297298 | Biblatex -- output biblatex cite commands
298− deriving (Show, Read, Eq, Data, Typeable)
299+ deriving (Show, Read, Eq, Data, Typeable, Generic)
299300
300301-- | Methods for obfuscating email addresses in HTML.
301302data ObfuscationMethod = NoObfuscation
302303 | ReferenceObfuscation
303304 | JavascriptObfuscation
304− deriving (Show, Read, Eq, Data, Typeable)
305+ deriving (Show, Read, Eq, Data, Typeable, Generic)
305306
306307-- | Varieties of HTML slide shows.
307308data HTMLSlideVariant = S5Slides
@@ -310,13 +311,13 @@ data HTMLSlideVariant = S5Slides
310311 | DZSlides
311312 | RevealJsSlides
312313 | NoSlides
313− deriving (Show, Read, Eq, Data, Typeable)
314+ deriving (Show, Read, Eq, Data, Typeable, Generic)
314315
315316-- | Options for accepting or rejecting MS Word track-changes.
316317data TrackChanges = AcceptChanges
317318 | RejectChanges
318319 | AllChanges
319− deriving (Show, Read, Eq, Data, Typeable)
320+ deriving (Show, Read, Eq, Data, Typeable, Generic)
320321
321322-- | Options for writers
322323data WriterOptions = WriterOptions
@@ -363,7 +364,7 @@ data WriterOptions = WriterOptions
363364 , writerMediaBag :: MediaBag -- ^ Media collected by docx or epub reader
364365 , writerVerbose :: Bool -- ^ Verbose debugging output
365366 , writerLaTeXArgs :: [String] -- ^ Flags to pass to latex-engine
366− } deriving (Show, Data, Typeable)
367+ } deriving (Show, Data, Typeable, Generic)
367368
368369instance Default WriterOptions where
369370 def = WriterOptions { writerStandalone = False