StrappedTemplates-0.2.0.2: General purpose templates in haskell

Safe HaskellNone
LanguageHaskell98

Text.Strapped.Parser

Contents

Synopsis

Documentation

parseTemplate :: StrappedConfig -> String -> String -> Either ParseError Template Source

Take config, a template body and a template name and return either an error or a renderable template.

Building custom template parsers

parseExpression :: ParserM a -> ParserM ParsedExpression Source

Parse an expression that produces a Literal

tagStart :: ParserM String Source

Parse the beginning of a tag

tagEnd :: ParserM String Source

Parse the end of a tag.

peekTag :: ParserM a -> ParserM () Source

Look at a tag but don't consume

tryTag :: ParserM a -> ParserM () Source

Try a tag and consume if it matches

tag :: ParserM a -> ParserM a Source

Parse content between tagStart and tagEnd

wordString :: ParserM String Source

Parse alpha-numeric characters and '_'

pathString :: ParserM String Source

Parse alpha-numeric characters and '_./'

peekChar :: Char -> ParserM () Source

Look at a character but don't consume