Copyright | (c) Justus Adam 2015 |
---|---|
License | BSD3 |
Maintainer | dev@justus.science |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- parse :: FilePath -> Text -> Either ParseError STree
- parseWithConf :: MustacheConf -> FilePath -> Text -> Either ParseError STree
- data MustacheConf = MustacheConf {
- delimiters :: (String, String)
- defaultConf :: MustacheConf
- type Parser = Parsec Text MustacheState
- data MustacheState
- sectionBegin :: Char
- sectionEnd :: Char
- invertedSectionBegin :: Char
- unescape2 :: (Char, Char)
- unescape1 :: Char
- delimiterChange :: Char
- nestingSeparator :: Char
Generic parsing functions
parse :: FilePath -> Text -> Either ParseError STree Source #
Runs the parser for a mustache template, returning the syntax tree.
parseWithConf :: MustacheConf -> FilePath -> Text -> Either ParseError STree Source #
Parse using a custom initial configuration
Configurations
data MustacheConf Source #
Initial configuration for the parser
MustacheConf | |
|
defaultConf :: MustacheConf Source #
Default configuration (delimiters = ("{{", "}}"))
Parser
data MustacheState Source #
User state for the parser
Mustache Constants
sectionBegin :: Char Source #
#
sectionEnd :: Char Source #
/
delimiterChange :: Char Source #
=
nestingSeparator :: Char Source #
.