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 #

Type of filter and path to filter file.

Constructors

LuaFilter FilePath |
JSONFilter FilePath |
CiteprocFilter |

#### Instances

Instances details

FromJSON Filter # |
Instance details Defined in Text.Pandoc.Filter Methods parseJSON :: Value -> Parser Filter # parseJSONList :: Value -> Parser [Filter] # omittedField :: Maybe Filter #
ToJSON Filter # |
Instance details Defined in Text.Pandoc.Filter Methods toJSON :: Filter -> Value # toEncoding :: Filter -> Encoding # toJSONList :: [Filter] -> Value # toEncodingList :: [Filter] -> Encoding # omitField :: Filter -> Bool #
Generic Filter # |

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-LV2qWKW0Q2RElzdkrvf5Ll" '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 #

to :: Rep Filter x -> Filter #

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

Instance details

Defined in Text.Pandoc.Filter

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

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 # |
Instance details Defined in Text.Pandoc.Filter.Environment Methods def :: Environment #

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

Modify the given document using a filter.

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