pandoc-2.14.2: Conversion between markup formats
CopyrightCopyright (C) 2021 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 Source #

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 Source # 
Instance details

Defined in Text.Pandoc.Sources

IsString Sources Source # 
Instance details

Defined in Text.Pandoc.Sources

Methods

fromString :: String -> Sources #

Semigroup Sources Source # 
Instance details

Defined in Text.Pandoc.Sources

Monoid Sources Source # 
Instance details

Defined in Text.Pandoc.Sources

ToSources Sources Source # 
Instance details

Defined in Text.Pandoc.Sources

UpdateSourcePos Sources Char Source # 
Instance details

Defined in Text.Pandoc.Sources

Monad m => Stream Sources m Char Source # 
Instance details

Defined in Text.Pandoc.Sources

Methods

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

class ToSources a where Source #

Methods

toSources :: a -> Sources Source #

Instances

Instances details
ToSources Text Source # 
Instance details

Defined in Text.Pandoc.Sources

ToSources Sources Source # 
Instance details

Defined in Text.Pandoc.Sources

ToSources [(FilePath, Text)] Source # 
Instance details

Defined in Text.Pandoc.Sources

class UpdateSourcePos s c where Source #

Methods

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

Instances

Instances details
UpdateSourcePos Text Char Source # 
Instance details

Defined in Text.Pandoc.Sources

UpdateSourcePos Sources Char Source # 
Instance details

Defined in Text.Pandoc.Sources

initialSourceName :: Sources -> FilePath Source #

Get name of first source in Sources.

ensureFinalNewlines Source #

Arguments

:: Int

number of trailing newlines

-> Sources 
-> Sources 

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

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