git.iko.soy/typeable/pandoc
on master help sign in
T.P.App: extract Opt into separate module

The new Opt module has only a few dependencies. This is important for compile-times during development, as Template Haskell containing modules are be recompiled whenever a (transitive) dependency changes.

commitdae3a0e3d2e6fc2677f9f59bd046ef2a4e66ce42 authorAlbert Krewinkel <albert@zeitkraut.de> dateTue 6 Nov 2018, 21:25 (8 years ago) parentd66c88a
5 files changed+228−180
pandoc.cabal+1 src/Text/Pandoc/App.hs+2−2 src/Text/Pandoc/App/CommandLineOptions.hs+2−177 src/Text/Pandoc/App/Opt.hs+221 src/Text/Pandoc/App/OutputSettings.hs+2−1
pandoc.cabal+1
@@ -522,6 +522,7 @@ library
522522 Text.Pandoc.BCP47,
523523 Text.Pandoc.Class
524524 other-modules: Text.Pandoc.App.CommandLineOptions,
525+ Text.Pandoc.App.Opt,
525526 Text.Pandoc.App.OutputSettings,
526527 Text.Pandoc.Filter.JSON,
527528 Text.Pandoc.Filter.Lua,
src/Text/Pandoc/App.hs+2−2
@@ -62,8 +62,8 @@ import System.FilePath
6262import System.IO (nativeNewline, stdout)
6363import qualified System.IO as IO (Newline (..))
6464import Text.Pandoc
65−import Text.Pandoc.App.CommandLineOptions (Opt (..), LineEnding (..),
66− defaultOpts, parseOptions, options)
65+import Text.Pandoc.App.Opt (Opt (..), LineEnding (..), defaultOpts)
66+import Text.Pandoc.App.CommandLineOptions (parseOptions, options)
6767import Text.Pandoc.App.OutputSettings (OutputSettings (..), optToOutputSettings)
6868import Text.Pandoc.BCP47 (Lang (..), parseBCP47)
6969import Text.Pandoc.Builder (setMeta, deleteMeta)
src/Text/Pandoc/App/CommandLineOptions.hs+2−177
@@ -1,6 +1,5 @@
11{-# LANGUAGE NoImplicitPrelude #-}
22{-# LANGUAGE CPP #-}
3−{-# LANGUAGE DeriveGeneric #-}
43{-# LANGUAGE ScopedTypeVariables #-}
54{-# LANGUAGE TupleSections #-}
65#ifdef DERIVE_JSON_VIA_TH
@@ -36,10 +35,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
3635Does a pandoc conversion based on command-line options.
3736-}
3837module Text.Pandoc.App.CommandLineOptions (
39− Opt(..)
40− , LineEnding (..)
41− , defaultOpts
42− , parseOptions
38+ parseOptions
4339 , options
4440 , engines
4541 ) where
@@ -51,7 +47,6 @@ import Data.Aeson.Encode.Pretty (encodePretty', Config(..), keyOrder,
5147import Data.Char (toLower, toUpper)
5248import Data.List (intercalate, sort)
5349import Data.Maybe (fromMaybe)
54−import GHC.Generics
5550import Skylighting (Style, Syntax (..), defaultSyntaxMap, parseTheme,
5651 pygments)
5752import System.Console.GetOpt
@@ -60,19 +55,13 @@ import System.Exit (exitSuccess)
6055import System.FilePath
6156import System.IO (stdout)
6257import Text.Pandoc
58+import Text.Pandoc.App.Opt (Opt (..), LineEnding (..))
6359import Text.Pandoc.Filter (Filter (..))
6460import Text.Pandoc.Highlighting (highlightingStyles)
6561import Text.Pandoc.Writers.Math (defaultMathJaxURL, defaultKaTeXURL)
6662import Text.Pandoc.Shared (ordNub, safeRead)
6763import Text.Printf
6864
69−#ifdef DERIVE_JSON_VIA_TH
70−import Data.Aeson.TH (deriveJSON, defaultOptions)
71−#else
72−import Data.Aeson (FromJSON (..), ToJSON (..),
73− defaultOptions, genericToEncoding)
74−#endif
75−
7665#ifdef EMBED_DATA_FILES
7766import Text.Pandoc.Data (dataFiles)
7867import System.Directory (getAppUserDataDirectory)
@@ -88,9 +77,6 @@ import qualified Data.Map as M
8877import qualified Data.Text as T
8978import qualified Text.Pandoc.UTF8 as UTF8
9079
91−-- | The type of line-endings to be used when writing plain-text.
92−data LineEnding = LF | CRLF | Native deriving (Show, Generic)
93−
9480parseOptions :: [OptDescr (Opt -> IO Opt)] -> Opt -> IO Opt
9581parseOptions options' defaults = do
9682 rawArgs <- map UTF8.decodeArg <$> getArgs
@@ -130,152 +116,6 @@ engines = map ("html",) htmlEngines ++
130116pdfEngines :: [String]
131117pdfEngines = ordNub $ map snd engines
132118
133−
134−-- | Data structure for command line options.
135−data Opt = Opt
136− { optTabStop :: Int -- ^ Number of spaces per tab
137− , optPreserveTabs :: Bool -- ^ Preserve tabs instead of converting to spaces
138− , optStandalone :: Bool -- ^ Include header, footer
139− , optReader :: Maybe String -- ^ Reader format
140− , optWriter :: Maybe String -- ^ Writer format
141− , optTableOfContents :: Bool -- ^ Include table of contents
142− , optBaseHeaderLevel :: Int -- ^ Base header level
143− , optTemplate :: Maybe FilePath -- ^ Custom template
144− , optVariables :: [(String,String)] -- ^ Template variables to set
145− , optMetadata :: [(String, String)] -- ^ Metadata fields to set
146− , optMetadataFile :: Maybe FilePath -- ^ Name of YAML metadata file
147− , optOutputFile :: Maybe FilePath -- ^ Name of output file
148− , optInputFiles :: [FilePath] -- ^ Names of input files
149− , optNumberSections :: Bool -- ^ Number sections in LaTeX
150− , optNumberOffset :: [Int] -- ^ Starting number for sections
151− , optSectionDivs :: Bool -- ^ Put sections in div tags in HTML
152− , optIncremental :: Bool -- ^ Use incremental lists in Slidy/Slideous/S5
153− , optSelfContained :: Bool -- ^ Make HTML accessible offline
154− , optHtmlQTags :: Bool -- ^ Use <q> tags in HTML
155− , optHighlightStyle :: Maybe Style -- ^ Style to use for highlighted code
156− , optSyntaxDefinitions :: [FilePath] -- ^ xml syntax defs to load
157− , optTopLevelDivision :: TopLevelDivision -- ^ Type of the top-level divisions
158− , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math
159− , optAbbreviations :: Maybe FilePath -- ^ Path to abbrevs file
160− , optReferenceDoc :: Maybe FilePath -- ^ Path of reference doc
161− , optEpubSubdirectory :: String -- ^ EPUB subdir in OCF container
162− , optEpubMetadata :: Maybe FilePath -- ^ EPUB metadata
163− , optEpubFonts :: [FilePath] -- ^ EPUB fonts to embed
164− , optEpubChapterLevel :: Int -- ^ Header level at which to split chapters
165− , optEpubCoverImage :: Maybe FilePath -- ^ Cover image for epub
166− , optTOCDepth :: Int -- ^ Number of levels to include in TOC
167− , optDumpArgs :: Bool -- ^ Output command-line arguments
168− , optIgnoreArgs :: Bool -- ^ Ignore command-line arguments
169− , optVerbosity :: Verbosity -- ^ Verbosity of diagnostic output
170− , optTrace :: Bool -- ^ Enable tracing
171− , optLogFile :: Maybe FilePath -- ^ File to write JSON log output
172− , optFailIfWarnings :: Bool -- ^ Fail on warnings
173− , optReferenceLinks :: Bool -- ^ Use reference links in writing markdown, rst
174− , optReferenceLocation :: ReferenceLocation -- ^ location for footnotes and link references in markdown output
175− , optDpi :: Int -- ^ Dpi
176− , optWrapText :: WrapOption -- ^ Options for wrapping text
177− , optColumns :: Int -- ^ Line length in characters
178− , optFilters :: [Filter] -- ^ Filters to apply
179− , optEmailObfuscation :: ObfuscationMethod
180− , optIdentifierPrefix :: String
181− , optStripEmptyParagraphs :: Bool -- ^ Strip empty paragraphs
182− , optIndentedCodeClasses :: [String] -- ^ Default classes for indented code blocks
183− , optDataDir :: Maybe FilePath
184− , optCiteMethod :: CiteMethod -- ^ Method to output cites
185− , optListings :: Bool -- ^ Use listings package for code blocks
186− , optPdfEngine :: Maybe String -- ^ Program to use for latex/html -> pdf
187− , optPdfEngineArgs :: [String] -- ^ Flags to pass to the engine
188− , optSlideLevel :: Maybe Int -- ^ Header level that creates slides
189− , optSetextHeaders :: Bool -- ^ Use atx headers for markdown level 1-2
190− , optAscii :: Bool -- ^ Prefer ascii output
191− , optDefaultImageExtension :: String -- ^ Default image extension
192− , optExtractMedia :: Maybe FilePath -- ^ Path to extract embedded media
193− , optTrackChanges :: TrackChanges -- ^ Accept or reject MS Word track-changes.
194− , optFileScope :: Bool -- ^ Parse input files before combining
195− , optTitlePrefix :: Maybe String -- ^ Prefix for title
196− , optCss :: [FilePath] -- ^ CSS files to link to
197− , optIncludeBeforeBody :: [FilePath] -- ^ Files to include before
198− , optIncludeAfterBody :: [FilePath] -- ^ Files to include after body
199− , optIncludeInHeader :: [FilePath] -- ^ Files to include in header
200− , optResourcePath :: [FilePath] -- ^ Path to search for images etc
201− , optRequestHeaders :: [(String, String)] -- ^ Headers for HTTP requests
202− , optEol :: LineEnding -- ^ Style of line-endings to use
203− , optStripComments :: Bool -- ^ Skip HTML comments
204− } deriving (Generic, Show)
205−
206−-- | Defaults for command-line options.
207−defaultOpts :: Opt
208−defaultOpts = Opt
209− { optTabStop = 4
210− , optPreserveTabs = False
211− , optStandalone = False
212− , optReader = Nothing
213− , optWriter = Nothing
214− , optTableOfContents = False
215− , optBaseHeaderLevel = 1
216− , optTemplate = Nothing
217− , optVariables = []
218− , optMetadata = []
219− , optMetadataFile = Nothing
220− , optOutputFile = Nothing
221− , optInputFiles = []
222− , optNumberSections = False
223− , optNumberOffset = [0,0,0,0,0,0]
224− , optSectionDivs = False
225− , optIncremental = False
226− , optSelfContained = False
227− , optHtmlQTags = False
228− , optHighlightStyle = Just pygments
229− , optSyntaxDefinitions = []
230− , optTopLevelDivision = TopLevelDefault
231− , optHTMLMathMethod = PlainMath
232− , optAbbreviations = Nothing
233− , optReferenceDoc = Nothing
234− , optEpubSubdirectory = "EPUB"
235− , optEpubMetadata = Nothing
236− , optEpubFonts = []
237− , optEpubChapterLevel = 1
238− , optEpubCoverImage = Nothing
239− , optTOCDepth = 3
240− , optDumpArgs = False
241− , optIgnoreArgs = False
242− , optVerbosity = WARNING
243− , optTrace = False
244− , optLogFile = Nothing
245− , optFailIfWarnings = False
246− , optReferenceLinks = False
247− , optReferenceLocation = EndOfDocument
248− , optDpi = 96
249− , optWrapText = WrapAuto
250− , optColumns = 72
251− , optFilters = []
252− , optEmailObfuscation = NoObfuscation
253− , optIdentifierPrefix = ""
254− , optStripEmptyParagraphs = False
255− , optIndentedCodeClasses = []
256− , optDataDir = Nothing
257− , optCiteMethod = Citeproc
258− , optListings = False
259− , optPdfEngine = Nothing
260− , optPdfEngineArgs = []
261− , optSlideLevel = Nothing
262− , optSetextHeaders = True
263− , optAscii = False
264− , optDefaultImageExtension = ""
265− , optExtractMedia = Nothing
266− , optTrackChanges = AcceptChanges
267− , optFileScope = False
268− , optTitlePrefix = Nothing
269− , optCss = []
270− , optIncludeBeforeBody = []
271− , optIncludeAfterBody = []
272− , optIncludeInHeader = []
273− , optResourcePath = ["."]
274− , optRequestHeaders = []
275− , optEol = Native
276− , optStripComments = False
277− }
278−
279119lookupHighlightStyle :: String -> IO (Maybe Style)
280120lookupHighlightStyle s
281121 | takeExtension s == ".theme" = -- attempt to load KDE theme
@@ -1091,18 +931,3 @@ deprecatedOption o msg =
1091931 \r -> case r of
1092932 Right () -> return ()
1093933 Left e -> E.throwIO e
1094−
1095−-- see https://github.com/jgm/pandoc/pull/4083
1096−-- using generic deriving caused long compilation times
1097−#ifdef DERIVE_JSON_VIA_TH
1098−$(deriveJSON defaultOptions ''LineEnding)
1099−$(deriveJSON defaultOptions ''Opt)
1100−#else
1101−instance ToJSON LineEnding where
1102− toEncoding = genericToEncoding defaultOptions
1103−instance FromJSON LineEnding
1104−
1105−instance ToJSON Opt where
1106− toEncoding = genericToEncoding defaultOptions
1107−instance FromJSON Opt
1108−#endif
src/Text/Pandoc/App/Opt.hsnew file+221
@@ -0,0 +1,221 @@
1+{-# LANGUAGE NoImplicitPrelude #-}
2+{-# LANGUAGE CPP #-}
3+{-# LANGUAGE DeriveGeneric #-}
4+#ifdef DERIVE_JSON_VIA_TH
5+{-# LANGUAGE TemplateHaskell #-}
6+#endif
7+{-
8+Copyright (C) 2006-2018 John MacFarlane <jgm@berkeley.edu>
9+
10+This program is free software; you can redistribute it and/or modify
11+it under the terms of the GNU General Public License as published by
12+the Free Software Foundation; either version 2 of the License, or
13+(at your option) any later version.
14+
15+This program is distributed in the hope that it will be useful,
16+but WITHOUT ANY WARRANTY; without even the implied warranty of
17+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18+GNU General Public License for more details.
19+
20+You should have received a copy of the GNU General Public License
21+along with this program; if not, write to the Free Software
22+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23+-}
24+
25+{- |
26+ Module : Text.Pandoc.App.Opt
27+ Copyright : Copyright (C) 2006-2018 John MacFarlane
28+ License : GNU GPL, version 2 or above
29+
30+ Maintainer : John MacFarlane <jgm@berkeley@edu>
31+ Stability : alpha
32+ Portability : portable
33+
34+Options for pandoc when used as an app.
35+-}
36+module Text.Pandoc.App.Opt (
37+ Opt(..)
38+ , LineEnding (..)
39+ , defaultOpts
40+ ) where
41+import Prelude
42+import GHC.Generics
43+import Text.Pandoc.Filter (Filter (..))
44+import Text.Pandoc.Highlighting (Style, pygments)
45+import Text.Pandoc.Logging (Verbosity (WARNING))
46+import Text.Pandoc.Options (TopLevelDivision (TopLevelDefault),
47+ TrackChanges (AcceptChanges),
48+ WrapOption (WrapAuto), HTMLMathMethod (PlainMath),
49+ ReferenceLocation (EndOfDocument),
50+ ObfuscationMethod (NoObfuscation),
51+ CiteMethod (Citeproc))
52+
53+#ifdef DERIVE_JSON_VIA_TH
54+import Data.Aeson.TH (deriveJSON, defaultOptions)
55+#else
56+import Data.Aeson (FromJSON (..), ToJSON (..),
57+ defaultOptions, genericToEncoding)
58+#endif
59+
60+-- | The type of line-endings to be used when writing plain-text.
61+data LineEnding = LF | CRLF | Native deriving (Show, Generic)
62+
63+-- | Data structure for command line options.
64+data Opt = Opt
65+ { optTabStop :: Int -- ^ Number of spaces per tab
66+ , optPreserveTabs :: Bool -- ^ Preserve tabs instead of converting to spaces
67+ , optStandalone :: Bool -- ^ Include header, footer
68+ , optReader :: Maybe String -- ^ Reader format
69+ , optWriter :: Maybe String -- ^ Writer format
70+ , optTableOfContents :: Bool -- ^ Include table of contents
71+ , optBaseHeaderLevel :: Int -- ^ Base header level
72+ , optTemplate :: Maybe FilePath -- ^ Custom template
73+ , optVariables :: [(String,String)] -- ^ Template variables to set
74+ , optMetadata :: [(String, String)] -- ^ Metadata fields to set
75+ , optMetadataFile :: Maybe FilePath -- ^ Name of YAML metadata file
76+ , optOutputFile :: Maybe FilePath -- ^ Name of output file
77+ , optInputFiles :: [FilePath] -- ^ Names of input files
78+ , optNumberSections :: Bool -- ^ Number sections in LaTeX
79+ , optNumberOffset :: [Int] -- ^ Starting number for sections
80+ , optSectionDivs :: Bool -- ^ Put sections in div tags in HTML
81+ , optIncremental :: Bool -- ^ Use incremental lists in Slidy/Slideous/S5
82+ , optSelfContained :: Bool -- ^ Make HTML accessible offline
83+ , optHtmlQTags :: Bool -- ^ Use <q> tags in HTML
84+ , optHighlightStyle :: Maybe Style -- ^ Style to use for highlighted code
85+ , optSyntaxDefinitions :: [FilePath] -- ^ xml syntax defs to load
86+ , optTopLevelDivision :: TopLevelDivision -- ^ Type of the top-level divisions
87+ , optHTMLMathMethod :: HTMLMathMethod -- ^ Method to print HTML math
88+ , optAbbreviations :: Maybe FilePath -- ^ Path to abbrevs file
89+ , optReferenceDoc :: Maybe FilePath -- ^ Path of reference doc
90+ , optEpubSubdirectory :: String -- ^ EPUB subdir in OCF container
91+ , optEpubMetadata :: Maybe FilePath -- ^ EPUB metadata
92+ , optEpubFonts :: [FilePath] -- ^ EPUB fonts to embed
93+ , optEpubChapterLevel :: Int -- ^ Header level at which to split chapters
94+ , optEpubCoverImage :: Maybe FilePath -- ^ Cover image for epub
95+ , optTOCDepth :: Int -- ^ Number of levels to include in TOC
96+ , optDumpArgs :: Bool -- ^ Output command-line arguments
97+ , optIgnoreArgs :: Bool -- ^ Ignore command-line arguments
98+ , optVerbosity :: Verbosity -- ^ Verbosity of diagnostic output
99+ , optTrace :: Bool -- ^ Enable tracing
100+ , optLogFile :: Maybe FilePath -- ^ File to write JSON log output
101+ , optFailIfWarnings :: Bool -- ^ Fail on warnings
102+ , optReferenceLinks :: Bool -- ^ Use reference links in writing markdown, rst
103+ , optReferenceLocation :: ReferenceLocation -- ^ location for footnotes and link references in markdown output
104+ , optDpi :: Int -- ^ Dpi
105+ , optWrapText :: WrapOption -- ^ Options for wrapping text
106+ , optColumns :: Int -- ^ Line length in characters
107+ , optFilters :: [Filter] -- ^ Filters to apply
108+ , optEmailObfuscation :: ObfuscationMethod
109+ , optIdentifierPrefix :: String
110+ , optStripEmptyParagraphs :: Bool -- ^ Strip empty paragraphs
111+ , optIndentedCodeClasses :: [String] -- ^ Default classes for indented code blocks
112+ , optDataDir :: Maybe FilePath
113+ , optCiteMethod :: CiteMethod -- ^ Method to output cites
114+ , optListings :: Bool -- ^ Use listings package for code blocks
115+ , optPdfEngine :: Maybe String -- ^ Program to use for latex/html -> pdf
116+ , optPdfEngineArgs :: [String] -- ^ Flags to pass to the engine
117+ , optSlideLevel :: Maybe Int -- ^ Header level that creates slides
118+ , optSetextHeaders :: Bool -- ^ Use atx headers for markdown level 1-2
119+ , optAscii :: Bool -- ^ Prefer ascii output
120+ , optDefaultImageExtension :: String -- ^ Default image extension
121+ , optExtractMedia :: Maybe FilePath -- ^ Path to extract embedded media
122+ , optTrackChanges :: TrackChanges -- ^ Accept or reject MS Word track-changes.
123+ , optFileScope :: Bool -- ^ Parse input files before combining
124+ , optTitlePrefix :: Maybe String -- ^ Prefix for title
125+ , optCss :: [FilePath] -- ^ CSS files to link to
126+ , optIncludeBeforeBody :: [FilePath] -- ^ Files to include before
127+ , optIncludeAfterBody :: [FilePath] -- ^ Files to include after body
128+ , optIncludeInHeader :: [FilePath] -- ^ Files to include in header
129+ , optResourcePath :: [FilePath] -- ^ Path to search for images etc
130+ , optRequestHeaders :: [(String, String)] -- ^ Headers for HTTP requests
131+ , optEol :: LineEnding -- ^ Style of line-endings to use
132+ , optStripComments :: Bool -- ^ Skip HTML comments
133+ } deriving (Generic, Show)
134+
135+-- | Defaults for command-line options.
136+defaultOpts :: Opt
137+defaultOpts = Opt
138+ { optTabStop = 4
139+ , optPreserveTabs = False
140+ , optStandalone = False
141+ , optReader = Nothing
142+ , optWriter = Nothing
143+ , optTableOfContents = False
144+ , optBaseHeaderLevel = 1
145+ , optTemplate = Nothing
146+ , optVariables = []
147+ , optMetadata = []
148+ , optMetadataFile = Nothing
149+ , optOutputFile = Nothing
150+ , optInputFiles = []
151+ , optNumberSections = False
152+ , optNumberOffset = [0,0,0,0,0,0]
153+ , optSectionDivs = False
154+ , optIncremental = False
155+ , optSelfContained = False
156+ , optHtmlQTags = False
157+ , optHighlightStyle = Just pygments
158+ , optSyntaxDefinitions = []
159+ , optTopLevelDivision = TopLevelDefault
160+ , optHTMLMathMethod = PlainMath
161+ , optAbbreviations = Nothing
162+ , optReferenceDoc = Nothing
163+ , optEpubSubdirectory = "EPUB"
164+ , optEpubMetadata = Nothing
165+ , optEpubFonts = []
166+ , optEpubChapterLevel = 1
167+ , optEpubCoverImage = Nothing
168+ , optTOCDepth = 3
169+ , optDumpArgs = False
170+ , optIgnoreArgs = False
171+ , optVerbosity = WARNING
172+ , optTrace = False
173+ , optLogFile = Nothing
174+ , optFailIfWarnings = False
175+ , optReferenceLinks = False
176+ , optReferenceLocation = EndOfDocument
177+ , optDpi = 96
178+ , optWrapText = WrapAuto
179+ , optColumns = 72
180+ , optFilters = []
181+ , optEmailObfuscation = NoObfuscation
182+ , optIdentifierPrefix = ""
183+ , optStripEmptyParagraphs = False
184+ , optIndentedCodeClasses = []
185+ , optDataDir = Nothing
186+ , optCiteMethod = Citeproc
187+ , optListings = False
188+ , optPdfEngine = Nothing
189+ , optPdfEngineArgs = []
190+ , optSlideLevel = Nothing
191+ , optSetextHeaders = True
192+ , optAscii = False
193+ , optDefaultImageExtension = ""
194+ , optExtractMedia = Nothing
195+ , optTrackChanges = AcceptChanges
196+ , optFileScope = False
197+ , optTitlePrefix = Nothing
198+ , optCss = []
199+ , optIncludeBeforeBody = []
200+ , optIncludeAfterBody = []
201+ , optIncludeInHeader = []
202+ , optResourcePath = ["."]
203+ , optRequestHeaders = []
204+ , optEol = Native
205+ , optStripComments = False
206+ }
207+
208+#ifdef DERIVE_JSON_VIA_TH
209+-- see https://github.com/jgm/pandoc/pull/4083
210+-- using generic deriving caused long compilation times
211+$(deriveJSON defaultOptions ''LineEnding)
212+$(deriveJSON defaultOptions ''Opt)
213+#else
214+instance ToJSON LineEnding where
215+ toEncoding = genericToEncoding defaultOptions
216+instance FromJSON LineEnding
217+
218+instance ToJSON Opt where
219+ toEncoding = genericToEncoding defaultOptions
220+instance FromJSON Opt
221+#endif
src/Text/Pandoc/App/OutputSettings.hs+2−1
@@ -50,7 +50,8 @@ import System.Exit (exitSuccess)
5050import System.FilePath
5151import System.IO (stdout)
5252import Text.Pandoc
53−import Text.Pandoc.App.CommandLineOptions (Opt (..), engines)
53+import Text.Pandoc.App.Opt (Opt (..))
54+import Text.Pandoc.App.CommandLineOptions (engines)
5455import Text.Pandoc.BCP47 (Lang (..), parseBCP47)
5556import qualified Text.Pandoc.UTF8 as UTF8
5657