pandoc-2.9.2.1: Conversion between markup formats

Copyright | Copyright (C) 2006-2020 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 :: Opt -> 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
  - optHtmlQTags :: Bool
  - optHighlightStyle :: Maybe Text
  - optSyntaxDefinitions :: [FilePath]
  - optTopLevelDivision :: TopLevelDivision
  - optHTMLMathMethod :: HTMLMathMethod
  - optAbbreviations :: Maybe FilePath
  - optReferenceDoc :: Maybe FilePath
  - optEpubSubdirectory :: String
  - optEpubMetadata :: Maybe FilePath
  - optEpubFonts :: [FilePath]
  - optEpubChapterLevel :: Int
  - optEpubCoverImage :: Maybe FilePath
  - 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
  - optStripEmptyParagraphs :: Bool
  - optIndentedCodeClasses :: [Text]
  - optDataDir :: Maybe FilePath
  - optCiteMethod :: CiteMethod
  - optListings :: Bool
  - optPdfEngine :: Maybe String
  - optPdfEngineOpts :: [String]
  - optSlideLevel :: Maybe Int
  - optSetextHeaders :: 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)]
  - optEol :: LineEnding
  - optStripComments :: Bool
  }
- data LineEnding
  - = LF
  - | CRLF
  - | Native
- data Filter
  - = LuaFilter FilePath
  - | JSONFilter FilePath
- defaultOpts :: Opt
- parseOptions :: [OptDescr (Opt -> IO Opt)] -> Opt -> IO Opt
- options :: [OptDescr (Opt -> IO Opt)]
- applyFilters :: ReaderOptions -> [Filter] -> [String] -> Pandoc -> PandocIO Pandoc

# Documentation

convertWithOpts :: Opt -> IO () Source #

data Opt Source #

Data structure for command line options.

Constructors

Opt |

Fields

- optTabStop :: Int

  Number of spaces per tab

- optPreserveTabs :: Bool

  Preserve tabs instead of converting to spaces

- optStandalone :: Bool

  Include header, footer

- optFrom :: Maybe Text

  Reader format

- optTo :: Maybe Text

  Writer format

- optTableOfContents :: Bool

  Include table of contents

- optShiftHeadingLevelBy :: Int

  Shift heading level by

- optTemplate :: Maybe FilePath

  Custom template

- optVariables :: Context Text

  Template variables to set

- optMetadata :: Meta

  Metadata fields to set

- optMetadataFiles :: [FilePath]

  Name of YAML metadata files

- optOutputFile :: Maybe FilePath

  Name of output file

- optInputFiles :: Maybe [FilePath]

  Names of input files

- optNumberSections :: Bool

  Number sections in LaTeX

- optNumberOffset :: [Int]

  Starting number for sections

- optSectionDivs :: Bool

  Put sections in div tags in HTML

- optIncremental :: Bool

  Use incremental lists in SlidySlideousS5

- optSelfContained :: Bool

  Make HTML accessible offline

- optHtmlQTags :: Bool

  Use q tags in HTML

- optHighlightStyle :: Maybe Text

  Style to use for highlighted code

- optSyntaxDefinitions :: [FilePath]

  xml syntax defs to load

- optTopLevelDivision :: TopLevelDivision

  Type of the top-level divisions

- optHTMLMathMethod :: HTMLMathMethod

  Method to print HTML math

- optAbbreviations :: Maybe FilePath

  Path to abbrevs file

- optReferenceDoc :: Maybe FilePath

  Path of reference doc

- optEpubSubdirectory :: String

  EPUB subdir in OCF container

- optEpubMetadata :: Maybe FilePath

  EPUB metadata

- optEpubFonts :: [FilePath]

  EPUB fonts to embed

- optEpubChapterLevel :: Int

  Header level at which to split chapters

- optEpubCoverImage :: Maybe FilePath

  Cover image for epub

- optTOCDepth :: Int

  Number of levels to include in TOC

- optDumpArgs :: Bool

  Output command-line arguments

- optIgnoreArgs :: Bool

  Ignore command-line arguments

- optVerbosity :: Verbosity

  Verbosity of diagnostic output

- optTrace :: Bool

  Enable tracing

- optLogFile :: Maybe FilePath

  File to write JSON log output

- optFailIfWarnings :: Bool

  Fail on warnings

- optReferenceLinks :: Bool

  Use reference links in writing markdown, rst

- optReferenceLocation :: ReferenceLocation

  location for footnotes and link references in markdown output

- optDpi :: Int

  Dpi

- optWrap :: WrapOption

  Options for wrapping text

- optColumns :: Int

  Line length in characters

- optFilters :: [Filter]

  Filters to apply

- optEmailObfuscation :: ObfuscationMethod
- optIdentifierPrefix :: Text
- optStripEmptyParagraphs :: Bool

  Strip empty paragraphs

- optIndentedCodeClasses :: [Text]

  Default classes for indented code blocks

- optDataDir :: Maybe FilePath
- optCiteMethod :: CiteMethod

  Method to output cites

- optListings :: Bool

  Use listings package for code blocks

- optPdfEngine :: Maybe String

  Program to use for latex/html -> pdf

- optPdfEngineOpts :: [String]

  Flags to pass to the engine

- optSlideLevel :: Maybe Int

  Header level that creates slides

- optSetextHeaders :: Bool

  Use atx headers for markdown level 1-2

- optAscii :: Bool

  Prefer ascii output

- optDefaultImageExtension :: Text

  Default image extension

- optExtractMedia :: Maybe FilePath

  Path to extract embedded media

- optTrackChanges :: TrackChanges

  Accept or reject MS Word track-changes.

- optFileScope :: Bool

  Parse input files before combining

- optTitlePrefix :: Maybe Text

  Prefix for title

- optCss :: [FilePath]

  CSS files to link to

- optIpynbOutput :: IpynbOutput

  How to treat ipynb output blocks

- optIncludeBeforeBody :: [FilePath]

  Files to include before

- optIncludeAfterBody :: [FilePath]

  Files to include after body

- optIncludeInHeader :: [FilePath]

  Files to include in header

- optResourcePath :: [FilePath]

  Path to search for images etc

- optRequestHeaders :: [(Text, Text)]

  Headers for HTTP requests

- optEol :: LineEnding

  Style of line-endings to use

- optStripComments :: Bool

  Skip HTML comments

#### Instances

Instances details

Show Opt Source # |
Instance details Defined in Text.Pandoc.App.Opt Methods showsPrec :: Int -> Opt -> ShowS Source # show :: Opt -> String Source # showList :: [Opt] -> ShowS Source #
Generic Opt Source # |
Instance details Defined in Text.Pandoc.App.Opt Associated Types type Rep Opt :: Type -> Type Source # Methods from :: Opt -> Rep Opt x Source # to :: Rep Opt x -> Opt Source #
ToJSON Opt Source # |
Instance details Defined in Text.Pandoc.App.Opt Methods toJSON :: Opt -> Value Source # toEncoding :: Opt -> Encoding Source # toJSONList :: [Opt] -> Value Source # toEncodingList :: [Opt] -> Encoding Source #
FromJSON Opt Source # |
Instance details Defined in Text.Pandoc.App.Opt Methods parseJSON :: Value -> Parser Opt Source # parseJSONList :: Value -> Parser [Opt] Source #
FromYAML (Opt -> Opt) Source # |
Instance details Defined in Text.Pandoc.App.Opt Methods parseYAML :: Node Pos -> Parser (Opt -> Opt) Source #
type Rep Opt Source # |
Instance details Defined in Text.Pandoc.App.Opt type Rep Opt

data LineEnding Source #

The type of line-endings to be used when writing plain-text.

Constructors

LF |
CRLF |
Native |

#### Instances

Instances details

Show LineEnding Source # |
Instance details Defined in Text.Pandoc.App.Opt Methods showsPrec :: Int -> LineEnding -> ShowS Source # show :: LineEnding -> String Source # showList :: [LineEnding] -> ShowS Source #
Generic LineEnding Source # |
Instance details Defined in Text.Pandoc.App.Opt Associated Types type Rep LineEnding :: Type -> Type Source # Methods from :: LineEnding -> Rep LineEnding x Source # to :: Rep LineEnding x -> LineEnding Source #
FromYAML LineEnding Source # |
Instance details Defined in Text.Pandoc.App.Opt Methods parseYAML :: Node Pos -> Parser LineEnding Source #
ToJSON LineEnding Source # |
Instance details Defined in Text.Pandoc.App.Opt Methods toJSON :: LineEnding -> Value Source # toEncoding :: LineEnding -> Encoding Source # toJSONList :: [LineEnding] -> Value Source # toEncodingList :: [LineEnding] -> Encoding Source #
FromJSON LineEnding Source # |
Instance details Defined in Text.Pandoc.App.Opt Methods parseJSON :: Value -> Parser LineEnding Source # parseJSONList :: Value -> Parser [LineEnding] Source #
type Rep LineEnding Source # |
Instance details Defined in Text.Pandoc.App.Opt type Rep LineEnding = D1 ('MetaData "LineEnding" "Text.Pandoc.App.Opt" "pandoc-2.9.2.1-BwC7qqLdfxs7s58m66jyVW" '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 Filter Source #

Type of filter and path to filter file.

Constructors

LuaFilter FilePath |
JSONFilter FilePath |

#### Instances

Instances details

Show Filter Source # |
Instance details Defined in Text.Pandoc.Filter Methods showsPrec :: Int -> Filter -> ShowS Source # show :: Filter -> String Source # showList :: [Filter] -> ShowS Source #
Generic Filter Source # |
Instance details Defined in Text.Pandoc.Filter Associated Types type Rep Filter :: Type -> Type Source # Methods from :: Filter -> Rep Filter x Source # to :: Rep Filter x -> Filter Source #
FromYAML Filter Source # |
Instance details Defined in Text.Pandoc.Filter Methods parseYAML :: Node Pos -> Parser Filter Source #
ToJSON Filter Source # |
Instance details Defined in Text.Pandoc.Filter Methods toJSON :: Filter -> Value Source # toEncoding :: Filter -> Encoding Source # toJSONList :: [Filter] -> Value Source # toEncodingList :: [Filter] -> Encoding Source #
FromJSON Filter Source # |
Instance details Defined in Text.Pandoc.Filter Methods parseJSON :: Value -> Parser Filter Source # parseJSONList :: Value -> Parser [Filter] Source #
type Rep Filter Source # |

Instance details

Defined in Text.Pandoc.Filter

type Rep Filter = D1 ('MetaData "Filter" "Text.Pandoc.Filter" "pandoc-2.9.2.1-BwC7qqLdfxs7s58m66jyVW" '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)))

defaultOpts :: Opt Source #

Defaults for command-line options.

parseOptions :: [OptDescr (Opt -> IO Opt)] -> Opt -> IO Opt Source #

options :: [OptDescr (Opt -> IO Opt)] Source #

A list of functions, each transforming the options data structure in response to a command-line option.

applyFilters :: ReaderOptions -> [Filter] -> [String] -> Pandoc -> PandocIO Pandoc Source #

Modify the given document using a filter.