pandoc-2.17.1.1: Conversion between markup formats
CopyrightCopyright (C) 2021-2022 John MacFarlane
LicenseGNU GPL, version 2 or above
MaintainerJohn MacFarlane <jgm@berkeley.edu>
Stabilityalpha
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Text.Pandoc.Sources

Description

Defines Sources object to be used as input to pandoc parsers and redefines Char parsers so they get source position information from it.

Synopsis

Documentation

newtype Sources #

A list of inputs labeled with source positions. It is assumed that the Texts have n line endings.

Constructors

Sources 

Fields

Instances

Instances details
Show Sources # 
Instance details

Defined in Text.Pandoc.Sources

IsString Sources # 
Instance details

Defined in Text.Pandoc.Sources

Methods

fromString :: String -> Sources #

Semigroup Sources # 
Instance details

Defined in Text.Pandoc.Sources

Monoid Sources # 
Instance details

Defined in Text.Pandoc.Sources

Pushable Sources # 
Instance details

Defined in Text.Pandoc.Lua.Orphans

Methods

push :: LuaError e => Sources -> LuaE e () #

ToSources Sources # 
Instance details

Defined in Text.Pandoc.Sources

Methods

toSources :: Sources -> Sources #

UpdateSourcePos Sources Char # 
Instance details

Defined in Text.Pandoc.Sources

Monad m => Stream Sources m Char # 
Instance details

Defined in Text.Pandoc.Sources

Methods

uncons :: Sources -> m (Maybe (Char, Sources)) #

class ToSources a where #

Methods

toSources :: a -> Sources #

Instances

Instances details
ToSources Text # 
Instance details

Defined in Text.Pandoc.Sources

Methods

toSources :: Text -> Sources #

ToSources Sources # 
Instance details

Defined in Text.Pandoc.Sources

Methods

toSources :: Sources -> Sources #

ToSources [(FilePath, Text)] # 
Instance details

Defined in Text.Pandoc.Sources

Methods

toSources :: [(FilePath, Text)] -> Sources #

class UpdateSourcePos s c where #

Methods

updateSourcePos :: SourcePos -> c -> s -> SourcePos #

Instances

Instances details
UpdateSourcePos Text Char # 
Instance details

Defined in Text.Pandoc.Sources

UpdateSourcePos Sources Char # 
Instance details

Defined in Text.Pandoc.Sources

initialSourceName :: Sources -> FilePath #

Get name of first source in Sources.

ensureFinalNewlines #

Arguments

:: Int

number of trailing newlines

-> Sources 
-> Sources 

addToInput :: Monad m => Text -> ParsecT Sources u m () #

Add some text to the beginning of the input sources. This simplifies code that expands macros.

satisfy :: (Monad m, Stream s m Char, UpdateSourcePos s Char) => (Char -> Bool) -> ParsecT s u m Char #

oneOf :: (Monad m, Stream s m Char, UpdateSourcePos s Char) => [Char] -> ParsecT s u m Char #

noneOf :: (Monad m, Stream s m Char, UpdateSourcePos s Char) => [Char] -> ParsecT s u m Char #

char :: (Monad m, Stream s m Char, UpdateSourcePos s Char) => Char -> ParsecT s u m Char #

string :: (Monad m, Stream s m Char, UpdateSourcePos s Char) => [Char] -> ParsecT s u m [Char] #

spaces :: (Monad m, Stream s m Char, UpdateSourcePos s Char) => ParsecT s u m () #