pandoc-3.1.2: Conversion between markup formats
CopyrightCopyright (C) 2021-2023 John MacFarlane
LicenseGNU GPL, version 2 or above
MaintainerJohn MacFarlane <jgm@berkeley.edu>
Stabilityalpha
Portabilityportable
Safe HaskellSafe-Inferred
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
IsString Sources Source # 
Instance details

Defined in Text.Pandoc.Sources

Methods

fromString :: String -> Sources #

Monoid Sources Source # 
Instance details

Defined in Text.Pandoc.Sources

Semigroup Sources Source # 
Instance details

Defined in Text.Pandoc.Sources

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

Defined in Text.Pandoc.Sources

ToSources Text Source # 
Instance details

Defined in Text.Pandoc.Sources

ToSources [(FilePath, Text)] 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.