| Copyright | Copyright (C) 2006-2023 John MacFarlane |
|---|---|
| License | GNU GPL, version 2 or above |
| Maintainer | John MacFarlane <jgm@berkeley@edu> |
| Stability | alpha |
| Portability | portable |
| Safe Haskell | None |
| Language | Haskell2010 |
Text.Pandoc.App
Description
Does a pandoc conversion based on command-line options.
Synopsis
- convertWithOpts :: ScriptingEngine -> Opt -> IO ()
- handleOptInfo :: ScriptingEngine -> OptInfo -> IO ()
- data Opt = Opt {
- optTabStop :: Int
- optPreserveTabs :: Bool
- optStandalone :: Bool
- optFrom :: Maybe Text
- optTo :: Maybe Text
- optTableOfContents :: Bool
- optShiftHeadingLevelBy :: Int
- optTemplate :: Maybe FilePath
- optVariables :: Context Text
- optMetadata :: Meta
- optMetadataFiles :: [FilePath]
- optOutputFile :: Maybe FilePath
- optInputFiles :: Maybe [FilePath]
- optNumberSections :: Bool
- optNumberOffset :: [Int]
- optSectionDivs :: Bool
- optIncremental :: Bool
- optSelfContained :: Bool
- optEmbedResources :: Bool
- optHtmlQTags :: Bool
- optHighlightStyle :: Maybe Text
- optSyntaxDefinitions :: [FilePath]
- optTopLevelDivision :: TopLevelDivision
- optHTMLMathMethod :: HTMLMathMethod
- optAbbreviations :: Maybe FilePath
- optReferenceDoc :: Maybe FilePath
- optSplitLevel :: Int
- optChunkTemplate :: Maybe Text
- optEpubSubdirectory :: String
- optEpubMetadata :: Maybe FilePath
- optEpubFonts :: [FilePath]
- optEpubCoverImage :: Maybe FilePath
- optEpubTitlePage :: Bool
- optTOCDepth :: Int
- optDumpArgs :: Bool
- optIgnoreArgs :: Bool
- optVerbosity :: Verbosity
- optTrace :: Bool
- optLogFile :: Maybe FilePath
- optFailIfWarnings :: Bool
- optReferenceLinks :: Bool
- optReferenceLocation :: ReferenceLocation
- optDpi :: Int
- optWrap :: WrapOption
- optColumns :: Int
- optFilters :: [Filter]
- optEmailObfuscation :: ObfuscationMethod
- optIdentifierPrefix :: Text
- optIndentedCodeClasses :: [Text]
- optDataDir :: Maybe FilePath
- optCiteMethod :: CiteMethod
- optListings :: Bool
- optPdfEngine :: Maybe String
- optPdfEngineOpts :: [String]
- optSlideLevel :: Maybe Int
- optSetextHeaders :: Bool
- optListTables :: Bool
- optAscii :: Bool
- optDefaultImageExtension :: Text
- optExtractMedia :: Maybe FilePath
- optTrackChanges :: TrackChanges
- optFileScope :: Bool
- optTitlePrefix :: Maybe Text
- optCss :: [FilePath]
- optIpynbOutput :: IpynbOutput
- optIncludeBeforeBody :: [FilePath]
- optIncludeAfterBody :: [FilePath]
- optIncludeInHeader :: [FilePath]
- optResourcePath :: [FilePath]
- optRequestHeaders :: [(Text, Text)]
- optNoCheckCertificate :: Bool
- optEol :: LineEnding
- optStripComments :: Bool
- optCSL :: Maybe FilePath
- optBibliography :: [FilePath]
- optCitationAbbreviations :: Maybe FilePath
- optSandbox :: Bool
- data OptInfo
- data LineEnding
- data IpynbOutput
- data Filter
- defaultOpts :: Opt
- parseOptions :: [OptDescr (Opt -> ExceptT OptInfo IO Opt)] -> Opt -> IO (Either OptInfo Opt)
- parseOptionsFromArgs :: [OptDescr (Opt -> ExceptT OptInfo IO Opt)] -> Opt -> String -> [String] -> IO (Either OptInfo Opt)
- options :: [OptDescr (Opt -> ExceptT OptInfo IO Opt)]
- applyFilters :: (PandocMonad m, MonadIO m) => ScriptingEngine -> Environment -> [Filter] -> [String] -> Pandoc -> m Pandoc
Documentation
convertWithOpts :: ScriptingEngine -> Opt -> IO () #
handleOptInfo :: ScriptingEngine -> OptInfo -> IO () #
React to an OptInfo by printing the requested information
and exiting or (if there was a parsing error) raising an error.
Data structure for command line options.
Constructors
| Opt | |
Fields
| |
Instances
Option parser results requesting informational output.
Constructors
| BashCompletion | |
| ListInputFormats | |
| ListOutputFormats | |
| ListExtensions (Maybe Text) | |
| ListHighlightLanguages | |
| ListHighlightStyles | |
| PrintDefaultTemplate (Maybe FilePath) Text | |
| PrintDefaultDataFile (Maybe FilePath) Text | |
| PrintHighlightStyle (Maybe FilePath) Text | |
| VersionInfo | |
| Help | |
| OptError PandocError |
Instances
| Generic OptInfo # | |||||
Defined in Text.Pandoc.App.Opt Associated Types
| |||||
| Show OptInfo # | |||||
| type Rep OptInfo # | |||||
Defined in Text.Pandoc.App.Opt type Rep OptInfo = D1 ('MetaData "OptInfo" "Text.Pandoc.App.Opt" "pandoc-3.1.13-4z6Ggw740m1ARLbD77fK9I" 'False) (((C1 ('MetaCons "BashCompletion" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "ListInputFormats" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ListOutputFormats" 'PrefixI 'False) (U1 :: Type -> Type))) :+: (C1 ('MetaCons "ListExtensions" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))) :+: (C1 ('MetaCons "ListHighlightLanguages" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "ListHighlightStyles" 'PrefixI 'False) (U1 :: Type -> Type)))) :+: ((C1 ('MetaCons "PrintDefaultTemplate" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe FilePath)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "PrintDefaultDataFile" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe FilePath)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: C1 ('MetaCons "PrintHighlightStyle" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe FilePath)) :*: S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))) :+: (C1 ('MetaCons "VersionInfo" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Help" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "OptError" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PandocError)))))) | |||||
data LineEnding #
The type of line-endings to be used when writing plain-text.
Instances
| FromJSON LineEnding # | |||||
Defined in Text.Pandoc.App.Opt | |||||
| ToJSON LineEnding # | |||||
Defined in Text.Pandoc.App.Opt Methods toJSON :: LineEnding -> Value # toEncoding :: LineEnding -> Encoding # toJSONList :: [LineEnding] -> Value # toEncodingList :: [LineEnding] -> Encoding # omitField :: LineEnding -> Bool # | |||||
| Generic LineEnding # | |||||
Defined in Text.Pandoc.App.Opt Associated Types
| |||||
| Show LineEnding # | |||||
Defined in Text.Pandoc.App.Opt Methods showsPrec :: Int -> LineEnding -> ShowS # show :: LineEnding -> String # showList :: [LineEnding] -> ShowS # | |||||
| type Rep LineEnding # | |||||
Defined in Text.Pandoc.App.Opt type Rep LineEnding = D1 ('MetaData "LineEnding" "Text.Pandoc.App.Opt" "pandoc-3.1.13-4z6Ggw740m1ARLbD77fK9I" 'False) (C1 ('MetaCons "LF" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "CRLF" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Native" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
data IpynbOutput #
How to handle output blocks in ipynb.
Constructors
| IpynbOutputAll | |
| IpynbOutputNone | |
| IpynbOutputBest |
Instances
| FromJSON IpynbOutput # | |||||
Defined in Text.Pandoc.App.Opt | |||||
| ToJSON IpynbOutput # | |||||
Defined in Text.Pandoc.App.Opt Methods toJSON :: IpynbOutput -> Value # toEncoding :: IpynbOutput -> Encoding # toJSONList :: [IpynbOutput] -> Value # toEncodingList :: [IpynbOutput] -> Encoding # omitField :: IpynbOutput -> Bool # | |||||
| Generic IpynbOutput # | |||||
Defined in Text.Pandoc.App.Opt Associated Types
| |||||
| Show IpynbOutput # | |||||
Defined in Text.Pandoc.App.Opt Methods showsPrec :: Int -> IpynbOutput -> ShowS # show :: IpynbOutput -> String # showList :: [IpynbOutput] -> ShowS # | |||||
| type Rep IpynbOutput # | |||||
Defined in Text.Pandoc.App.Opt type Rep IpynbOutput = D1 ('MetaData "IpynbOutput" "Text.Pandoc.App.Opt" "pandoc-3.1.13-4z6Ggw740m1ARLbD77fK9I" 'False) (C1 ('MetaCons "IpynbOutputAll" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "IpynbOutputNone" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "IpynbOutputBest" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
Type of filter and path to filter file.
Constructors
| LuaFilter FilePath | |
| JSONFilter FilePath |
Instances
| FromJSON Filter # | |||||
Defined in Text.Pandoc.Filter | |||||
| ToJSON Filter # | |||||
| Generic Filter # | |||||
Defined in Text.Pandoc.Filter Associated Types
| |||||
| Show Filter # | |||||
| type Rep Filter # | |||||
Defined in Text.Pandoc.Filter type Rep Filter = D1 ('MetaData "Filter" "Text.Pandoc.Filter" "pandoc-3.1.13-4z6Ggw740m1ARLbD77fK9I" 'False) (C1 ('MetaCons "LuaFilter" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :+: (C1 ('MetaCons "JSONFilter" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 FilePath)) :+: C1 ('MetaCons "CiteprocFilter" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
defaultOpts :: Opt #
Defaults for command-line options.
parseOptionsFromArgs :: [OptDescr (Opt -> ExceptT OptInfo IO Opt)] -> Opt -> String -> [String] -> IO (Either OptInfo Opt) #
options :: [OptDescr (Opt -> ExceptT OptInfo IO Opt)] #
A list of functions, each transforming the options data structure in response to a command-line option.
applyFilters :: (PandocMonad m, MonadIO m) => ScriptingEngine -> Environment -> [Filter] -> [String] -> Pandoc -> m Pandoc #
Modify the given document using a filter.