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

Safe Haskell | None

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

Structure representing a template directory.

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

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

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

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

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

Gets the `HeistState` from a TemplateDirectory.

getDirectoryCTS :: TemplateDirectory n -> IO CacheTagState

Clears the TemplateDirectory's cache tag state.

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

Clears cached content and reloads templates from disk.