heist-0.14.1.1: An Haskell template system supporting both HTML5 and XML.

Safe Haskell | None
Language | Haskell98

Heist.TemplateDirectory

Description

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

Synopsis

- data TemplateDirectory n
- newTemplateDirectory :: MonadIO n => FilePath -> HeistConfig n -> EitherT [String] IO (TemplateDirectory n)
- newTemplateDirectory' :: MonadIO n => FilePath -> HeistConfig n -> IO (TemplateDirectory n)
- getDirectoryHS :: MonadIO n => TemplateDirectory n -> IO (HeistState n)
- getDirectoryCTS :: TemplateDirectory n -> IO CacheTagState
- reloadTemplateDirectory :: MonadIO n => TemplateDirectory n -> IO (Either String ())

# Documentation

data TemplateDirectory n Source

Structure representing a template directory.

newTemplateDirectory :: MonadIO n => FilePath -> HeistConfig n -> EitherT [String] IO (TemplateDirectory n) Source

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

newTemplateDirectory' :: MonadIO n => FilePath -> HeistConfig n -> IO (TemplateDirectory n) Source

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

getDirectoryHS :: MonadIO n => TemplateDirectory n -> IO (HeistState n) Source

Gets the `HeistState` from a TemplateDirectory.

getDirectoryCTS :: TemplateDirectory n -> IO CacheTagState Source

Clears the TemplateDirectory's cache tag state.

reloadTemplateDirectory :: MonadIO n => TemplateDirectory n -> IO (Either String ()) Source

Clears cached content and reloads templates from disk.