pandoc-3.7.0.2: Conversion between markup formats

Copyright | Copyright (C) 2006-2024 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.Filter

Description

Programmatically modifications of pandoc documents.

Synopsis

- data Filter
  - = LuaFilter FilePath
  - | JSONFilter FilePath
  - | CiteprocFilter
- data Environment = Environment {
  - envReaderOptions :: ReaderOptions
  - envWriterOptions :: WriterOptions
  }
- applyFilters :: (PandocMonad m, MonadIO m) => ScriptingEngine -> Environment -> [Filter] -> [String] -> Pandoc -> m Pandoc
- applyJSONFilter :: MonadIO m => Environment -> [String] -> FilePath -> Pandoc -> m Pandoc

# Documentation

data Filter Source #

Type of filter and path to filter file.

Constructors

LuaFilter FilePath |
JSONFilter FilePath |
CiteprocFilter |

#### Instances

Instances details

FromJSON Filter Source # |
Instance details Defined in Text.Pandoc.Filter Methods parseJSON :: Value -> Parser Filter Source # parseJSONList :: Value -> Parser [Filter] Source # omittedField :: Maybe 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 # omitField :: Filter -> Bool Source #
Generic Filter Source # |

Instance details

Defined in Text.Pandoc.Filter

Associated Types

type Rep Filter |

Instance details

Defined in Text.Pandoc.Filter

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

Methods

from :: Filter -> Rep Filter x Source #

to :: Rep Filter x -> Filter Source #

Show Filter Source # |
Instance details Defined in Text.Pandoc.Filter Methods showsPrec :: Int -> Filter -> ShowS Source # show :: Filter -> String Source # showList :: [Filter] -> ShowS Source #
Eq Filter Source # |
Instance details Defined in Text.Pandoc.Filter Methods (==) :: Filter -> Filter -> Bool Source # (/=) :: Filter -> Filter -> Bool Source #
type Rep Filter Source # |

Instance details

Defined in Text.Pandoc.Filter

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

data Environment Source #

Environment in which a filter is run. This includes reader and writer options.

Constructors

Environment |

Fields

- envReaderOptions :: ReaderOptions
- envWriterOptions :: WriterOptions

#### Instances

Instances details

Default Environment Source # |
Instance details Defined in Text.Pandoc.Filter.Environment Methods def :: Environment Source #

applyFilters :: (PandocMonad m, MonadIO m) => ScriptingEngine -> Environment -> [Filter] -> [String] -> Pandoc -> m Pandoc Source #

Modify the given document using a filter.

applyJSONFilter :: MonadIO m => Environment -> [String] -> FilePath -> Pandoc -> m Pandoc Source #