Text.Templating.Heist.TemplateDirectory

heist-0.7.0.1: An (x)html templating system

Text.Templating.Heist.TemplateDirectory

Description

This module defines a TemplateDirectory data structure for convenient interaction with templates within web apps.

Synopsis

- data TemplateDirectory m
- newTemplateDirectory :: (MonadIO m, MonadIO n) => FilePath -> HeistState m -> n (Either String (TemplateDirectory m))
- newTemplateDirectory' :: (MonadIO m, MonadIO n) => FilePath -> HeistState m -> n (TemplateDirectory m)
- getDirectoryTS :: (Monad m, MonadIO n) => TemplateDirectory m -> n (HeistState m)
- reloadTemplateDirectory :: (MonadIO m, MonadIO n) => TemplateDirectory m -> n (Either String ())

# Documentation

data TemplateDirectory m

Structure representing a template directory.

newTemplateDirectory :: (MonadIO m, MonadIO n) => FilePath -> HeistState m -> n (Either String (TemplateDirectory m))

Creates and returns a new `TemplateDirectory` wrapped in an Either for error handling.

newTemplateDirectory' :: (MonadIO m, MonadIO n) => FilePath -> HeistState m -> n (TemplateDirectory m)

Creates and returns a new `TemplateDirectory`, using the monad's fail function on error.

getDirectoryTS :: (Monad m, MonadIO n) => TemplateDirectory m -> n (HeistState m)

Gets the `HeistState` from a TemplateDirectory.

reloadTemplateDirectory :: (MonadIO m, MonadIO n) => TemplateDirectory m -> n (Either String ())

Clears cached content and reloads templates from disk.