{-# LANGUAGE EmptyDataDecls #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} {-# LANGUAGE TypeSynonymInstances #-} -- | Module for parsing and rendering Hamlet templates at runtime, not compile -- time. This uses the same Hamlet parsing as compile-time Hamlet, but has some -- limitations, such as: -- -- * No compile-time checking of validity -- -- * Can't apply functions at runtime -- -- * No URL rendering -- -- > {-# LANGUAGE OverloadedStrings #-} -- > import Text.Hamlet.Runtime -- > import qualified Data.Map as Map -- > import Text.Blaze.Html.Renderer.String (renderHtml) -- > -- > main :: IO () -- > main = do -- > template <- parseHamletTemplate defaultHamletSettings $ unlines -- > [ "

Hello, #{name}" -- > , "$if hungry" -- > , "

Available food:" -- > , "