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

Text.Pandoc.Highlighting

Description

Exports functions for syntax highlighting.

Synopsis

Documentation

languages :: SyntaxMap -> [Text] Source #

languagesByExtension :: SyntaxMap -> Text -> [Text] Source #

highlight Source #

Arguments

:: SyntaxMap 
-> (FormatOptions -> [SourceLine] -> a)

Formatter

-> Attr

Attributes of the CodeBlock

-> Text

Raw contents of the CodeBlock

-> Either Text a 

Formats

LaTeX

formatLaTeXInline :: FormatOptions -> [SourceLine] -> Text #

formatLaTeXBlock :: FormatOptions -> [SourceLine] -> Text #

styleToLaTeX :: Style -> Text #

HTML

formatHtmlInline :: FormatOptions -> [SourceLine] -> Html #

formatHtmlBlock :: FormatOptions -> [SourceLine] -> Html #

formatHtml4Block :: FormatOptions -> [SourceLine] -> Html #

styleToCss :: Style -> String #

ConTeXt

formatConTeXtInline :: FormatOptions -> [SourceLine] -> Text #

formatConTeXtBlock :: FormatOptions -> [SourceLine] -> Text #

Styles

data Style #

Instances

Instances details
FromJSON Style 
Instance details

Defined in Skylighting.Types

Methods

parseJSON :: Value -> Parser Style

parseJSONList :: Value -> Parser [Style]

omittedField :: Maybe Style

ToJSON Style 
Instance details

Defined in Skylighting.Types

Methods

toJSON :: Style -> Value

toEncoding :: Style -> Encoding

toJSONList :: [Style] -> Value

toEncodingList :: [Style] -> Encoding

omitField :: Style -> Bool

Data Style 
Instance details

Defined in Skylighting.Types

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Style -> c Style

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Style

toConstr :: Style -> Constr

dataTypeOf :: Style -> DataType

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Style)

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Style)

gmapT :: (forall b. Data b => b -> b) -> Style -> Style

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Style -> r

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Style -> r

gmapQ :: (forall d. Data d => d -> u) -> Style -> [u]

gmapQi :: Int -> (forall d. Data d => d -> u) -> Style -> u

gmapM :: Monad m => (forall d. Data d => d -> m d) -> Style -> m Style

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Style -> m Style

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Style -> m Style

Generic Style 
Instance details

Defined in Skylighting.Types

Associated Types

type Rep Style 
Instance details

Defined in Skylighting.Types

type Rep Style = D1 ('MetaData "Style" "Skylighting.Types" "skylighting-core-0.14.1.2-DMDRK7Bs2zzGusEBGim5x0" 'False) (C1 ('MetaCons "Style" 'PrefixI 'True) ((S1 ('MetaSel ('Just "tokenStyles") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map TokenType TokenStyle)) :*: S1 ('MetaSel ('Just "defaultColor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Color))) :*: (S1 ('MetaSel ('Just "backgroundColor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Color)) :*: (S1 ('MetaSel ('Just "lineNumberColor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Color)) :*: S1 ('MetaSel ('Just "lineNumberBackgroundColor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Color))))))

Methods

from :: Style -> Rep Style x

to :: Rep Style x -> Style

Read Style 
Instance details

Defined in Skylighting.Types

Methods

readsPrec :: Int -> ReadS Style

readList :: ReadS [Style]

readPrec :: ReadPrec Style

readListPrec :: ReadPrec [Style]

Show Style 
Instance details

Defined in Skylighting.Types

Methods

showsPrec :: Int -> Style -> ShowS

show :: Style -> String

showList :: [Style] -> ShowS

Binary Style 
Instance details

Defined in Skylighting.Types

Methods

put :: Style -> Put

get :: Get Style

putList :: [Style] -> Put

Eq Style 
Instance details

Defined in Skylighting.Types

Methods

(==) :: Style -> Style -> Bool

(/=) :: Style -> Style -> Bool

Ord Style 
Instance details

Defined in Skylighting.Types

Methods

compare :: Style -> Style -> Ordering

(<) :: Style -> Style -> Bool

(<=) :: Style -> Style -> Bool

(>) :: Style -> Style -> Bool

(>=) :: Style -> Style -> Bool

max :: Style -> Style -> Style

min :: Style -> Style -> Style

type Rep Style 
Instance details

Defined in Skylighting.Types

type Rep Style = D1 ('MetaData "Style" "Skylighting.Types" "skylighting-core-0.14.1.2-DMDRK7Bs2zzGusEBGim5x0" 'False) (C1 ('MetaCons "Style" 'PrefixI 'True) ((S1 ('MetaSel ('Just "tokenStyles") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Map TokenType TokenStyle)) :*: S1 ('MetaSel ('Just "defaultColor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Color))) :*: (S1 ('MetaSel ('Just "backgroundColor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Color)) :*: (S1 ('MetaSel ('Just "lineNumberColor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Color)) :*: S1 ('MetaSel ('Just "lineNumberBackgroundColor") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 (Maybe Color))))))

lookupHighlightingStyle :: PandocMonad m => String -> m Style Source #

Lookup style from a name. If the name is a standard style, load it; if it ends in ".theme", attempt to load a KDE theme from the file path specified.

fromListingsLanguage :: Text -> Maybe Text Source #

Determine skylighting language name from listings language name.

toListingsLanguage :: Text -> Maybe Text Source #

Determine listings language name from skylighting language name.