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 | Safe-Inferred |
Language | Haskell2010 |
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
- 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 () Source #
handleOptInfo :: ScriptingEngine -> OptInfo -> IO () Source #
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.
Opt | |
|
Instances
Option parser results requesting informational output.
Instances
data LineEnding Source #
The type of line-endings to be used when writing plain-text.
Instances
Generic LineEnding Source # | |
Defined in Text.Pandoc.App.Opt type Rep LineEnding :: Type -> Type # from :: LineEnding -> Rep LineEnding x # to :: Rep LineEnding x -> LineEnding # | |
Show LineEnding Source # | |
Defined in Text.Pandoc.App.Opt showsPrec :: Int -> LineEnding -> ShowS # show :: LineEnding -> String # showList :: [LineEnding] -> ShowS # | |
FromJSON LineEnding Source # | |
Defined in Text.Pandoc.App.Opt parseJSON :: Value -> Parser LineEnding parseJSONList :: Value -> Parser [LineEnding] | |
ToJSON LineEnding Source # | |
Defined in Text.Pandoc.App.Opt toJSON :: LineEnding -> Value toEncoding :: LineEnding -> Encoding toJSONList :: [LineEnding] -> Value toEncodingList :: [LineEnding] -> Encoding | |
type Rep LineEnding Source # | |
Defined in Text.Pandoc.App.Opt |
data IpynbOutput Source #
How to handle output blocks in ipynb.
Instances
Type of filter and path to filter file.
Instances
Generic Filter Source # | |
Show Filter Source # | |
FromJSON Filter Source # | |
Defined in Text.Pandoc.Filter parseJSON :: Value -> Parser Filter parseJSONList :: Value -> Parser [Filter] | |
ToJSON Filter Source # | |
Defined in Text.Pandoc.Filter toEncoding :: Filter -> Encoding toJSONList :: [Filter] -> Value toEncodingList :: [Filter] -> Encoding | |
type Rep Filter Source # | |
Defined in Text.Pandoc.Filter type Rep Filter = D1 ('MetaData "Filter" "Text.Pandoc.Filter" "pandoc-3.0-inplace" '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 Source #
Defaults for command-line options.
parseOptions :: [OptDescr (Opt -> ExceptT OptInfo IO Opt)] -> Opt -> IO (Either OptInfo Opt) Source #
parseOptionsFromArgs :: [OptDescr (Opt -> ExceptT OptInfo IO Opt)] -> Opt -> String -> [String] -> IO (Either OptInfo Opt) Source #
options :: [OptDescr (Opt -> ExceptT OptInfo IO Opt)] Source #
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 Source #
Modify the given document using a filter.