@@ -1,3 +1,4 @@
1+{-# LANGUAGE DeriveDataTypeable #-}
2Copyright (C) 2012-2014 John MacFarlane <jgm@berkeley.edu>
3Copyright (C) 2012-2014 John MacFarlane <jgm@berkeley.edu>
@@ -51,6 +52,8 @@ import Data.Default
51import Text.Pandoc.Highlighting (Style, pygments)
52import Text.Pandoc.Highlighting (Style, pygments)
52import Text.Pandoc.MediaBag (MediaBag)
53import Text.Pandoc.MediaBag (MediaBag)
53import Data.Monoid
54import Data.Monoid
55+import Data.Data (Data)
56+import Data.Typeable (Typeable)
55-- | Individually selectable syntax extensions.
58-- | Individually selectable syntax extensions.
56data Extension =
59data Extension =
@@ -110,7 +113,7 @@ data Extension =
110 | Ext_line_blocks -- ^ RST style line blocks
113 | Ext_line_blocks -- ^ RST style line blocks
111 | Ext_epub_html_exts -- ^ Recognise the EPUB extended version of HTML
114 | Ext_epub_html_exts -- ^ Recognise the EPUB extended version of HTML
112 | Ext_shortcut_reference_links -- ^ Shortcut reference links
115 | Ext_shortcut_reference_links -- ^ Shortcut reference links
113− deriving (Show, Read, Enum, Eq, Ord, Bounded)
116+ deriving (Show, Read, Enum, Eq, Ord, Bounded, Data, Typeable)
115pandocExtensions :: Set Extension
118pandocExtensions :: Set Extension
116pandocExtensions = Set.fromList
119pandocExtensions = Set.fromList
@@ -226,7 +229,7 @@ data ReaderOptions = ReaderOptions{
226 , readerDefaultImageExtension :: String -- ^ Default extension for images
229 , readerDefaultImageExtension :: String -- ^ Default extension for images
227 , readerTrace :: Bool -- ^ Print debugging info
230 , readerTrace :: Bool -- ^ Print debugging info
228 , readerTrackChanges :: TrackChanges
231 , readerTrackChanges :: TrackChanges
229−} deriving (Show, Read)
232+} deriving (Show, Read, Data, Typeable)
231instance Default ReaderOptions
234instance Default ReaderOptions
232 where def = ReaderOptions{
235 where def = ReaderOptions{
@@ -248,7 +251,7 @@ instance Default ReaderOptions
248-- Writer options
251-- Writer options
251−data EPUBVersion = EPUB2 | EPUB3 deriving (Eq, Show, Read)
254+data EPUBVersion = EPUB2 | EPUB3 deriving (Eq, Show, Read, Data, Typeable)
253data HTMLMathMethod = PlainMath
256data HTMLMathMethod = PlainMath
254 | LaTeXMathML (Maybe String) -- url of LaTeXMathML.js
257 | LaTeXMathML (Maybe String) -- url of LaTeXMathML.js
@@ -258,18 +261,18 @@ data HTMLMathMethod = PlainMath
258 | MathML (Maybe String) -- url of MathMLinHTML.js
261 | MathML (Maybe String) -- url of MathMLinHTML.js
259 | MathJax String -- url of MathJax.js
262 | MathJax String -- url of MathJax.js
260 | KaTeX String String -- url of stylesheet and katex.js
263 | KaTeX String String -- url of stylesheet and katex.js
261− deriving (Show, Read, Eq)
264+ deriving (Show, Read, Eq, Data, Typeable)
263data CiteMethod = Citeproc -- use citeproc to render them
266data CiteMethod = Citeproc -- use citeproc to render them
264 | Natbib -- output natbib cite commands
267 | Natbib -- output natbib cite commands
265 | Biblatex -- output biblatex cite commands
268 | Biblatex -- output biblatex cite commands
266− deriving (Show, Read, Eq)
269+ deriving (Show, Read, Eq, Data, Typeable)
268-- | Methods for obfuscating email addresses in HTML.
271-- | Methods for obfuscating email addresses in HTML.
269data ObfuscationMethod = NoObfuscation
272data ObfuscationMethod = NoObfuscation
270 | ReferenceObfuscation
273 | ReferenceObfuscation
271 | JavascriptObfuscation
274 | JavascriptObfuscation
272− deriving (Show, Read, Eq)
275+ deriving (Show, Read, Eq, Data, Typeable)
274-- | Varieties of HTML slide shows.
277-- | Varieties of HTML slide shows.
275data HTMLSlideVariant = S5Slides
278data HTMLSlideVariant = S5Slides
@@ -278,13 +281,13 @@ data HTMLSlideVariant = S5Slides
278 | DZSlides
281 | DZSlides
279 | RevealJsSlides
282 | RevealJsSlides
280 | NoSlides
283 | NoSlides
281− deriving (Show, Read, Eq)
284+ deriving (Show, Read, Eq, Data, Typeable)
283-- | Options for accepting or rejecting MS Word track-changes.
286-- | Options for accepting or rejecting MS Word track-changes.
284data TrackChanges = AcceptChanges
287data TrackChanges = AcceptChanges
285 | RejectChanges
288 | RejectChanges
286 | AllChanges
289 | AllChanges
287− deriving (Show, Read, Eq)
290+ deriving (Show, Read, Eq, Data, Typeable)
289-- | Options for writers
292-- | Options for writers
290data WriterOptions = WriterOptions
293data WriterOptions = WriterOptions
@@ -331,7 +334,7 @@ data WriterOptions = WriterOptions
331 , writerMediaBag :: MediaBag -- ^ Media collected by docx or epub reader
334 , writerMediaBag :: MediaBag -- ^ Media collected by docx or epub reader
332 , writerVerbose :: Bool -- ^ Verbose debugging output
335 , writerVerbose :: Bool -- ^ Verbose debugging output
333 , writerLaTeXArgs :: [String] -- ^ Flags to pass to latex-engine
336 , writerLaTeXArgs :: [String] -- ^ Flags to pass to latex-engine
334− } deriving Show
337+ } deriving (Show, Data, Typeable)
336instance Default WriterOptions where
339instance Default WriterOptions where
337 def = WriterOptions { writerStandalone = False
340 def = WriterOptions { writerStandalone = False