ginger-0.3.7.2: An implementation of the Jinja2 template language in Haskell

Safe HaskellNone
LanguageHaskell2010

Text.Ginger.Parse

Description

Ginger parser.

Synopsis

Documentation

parseGinger :: Monad m => IncludeResolver m -> Maybe SourceName -> Source -> m (Either ParserError Template) Source #

Parse Ginger source from memory.

parseGingerFile :: Monad m => IncludeResolver m -> SourceName -> m (Either ParserError Template) Source #

Parse Ginger source from a file.

data ParserError Source #

Error information for Ginger parser errors.

Constructors

ParserError 

Fields

type IncludeResolver m = SourceName -> m (Maybe Source) Source #

Used to resolve includes. Ginger will call this function whenever it encounters an {% include %}, {% import %}, or {% extends %} directive. If the required source code is not available, the resolver should return Nothing, else Just the source.

type Source = String Source #

Input type for the parser (source code).

type SourceName = String Source #

A source identifier (typically a filename).