shakespeare-2.0.11.2: A toolkit for making compile-time interpolated templates

Safe Haskell | None
Language | Haskell98

Text.Hamlet.RT

Contents

- Public API

Description

Provides functionality for runtime Hamlet templates. Please use Text.Hamlet.Runtime instead.

Synopsis

- newtype HamletRT = HamletRT [SimpleDoc]
- data HamletData url
  - = HDHtml Html
  - | HDUrl url
  - | HDUrlParams url [(Text, Text)]
  - | HDTemplate HamletRT
  - | HDBool Bool
  - | HDMaybe (Maybe (HamletMap url))
  - | HDList [HamletMap url]
- type HamletMap url = [([String], HamletData url)]
- data HamletException
  - = HamletParseException String
  - | HamletUnsupportedDocException Doc
  - | HamletRenderException String
- parseHamletRT :: MonadThrow m => HamletSettings -> String -> m HamletRT
- renderHamletRT :: MonadThrow m => HamletRT -> HamletMap url -> UrlRenderer url -> m Html
- renderHamletRT' :: MonadThrow m => Bool -> HamletRT -> HamletMap url -> (url -> [(Text, Text)] -> Text) -> m Html
- data SimpleDoc
  - = SDRaw String
  - | SDVar [String]
  - | SDUrl Bool [String]
  - | SDTemplate [String]
  - | SDForall [String] String [SimpleDoc]
  - | SDMaybe [String] String [SimpleDoc] [SimpleDoc]
  - | SDCond [([String], [SimpleDoc])] [SimpleDoc]

# Public API

newtype HamletRT #

Constructors

HamletRT [SimpleDoc] |

data HamletData url #

Constructors

HDHtml Html |
HDUrl url |
HDUrlParams url [(Text, Text)] |
HDTemplate HamletRT |
HDBool Bool |
HDMaybe (Maybe (HamletMap url)) |
HDList [HamletMap url] |

type HamletMap url = [([String], HamletData url)] #

data HamletException #

Constructors

HamletParseException String |
HamletUnsupportedDocException Doc |
HamletRenderException String |

Instances

Show HamletException # |
Methods showsPrec :: Int -> HamletException -> ShowS # show :: HamletException -> String # showList :: [HamletException] -> ShowS #
Exception HamletException # |
Methods toException :: HamletException -> SomeException # fromException :: SomeException -> Maybe HamletException # displayException :: HamletException -> String #

parseHamletRT :: MonadThrow m => HamletSettings -> String -> m HamletRT #

renderHamletRT :: MonadThrow m => HamletRT -> HamletMap url -> UrlRenderer url -> m Html #

renderHamletRT' #

Arguments

:: MonadThrow m |
=> Bool | should embeded template (via ^{..}) be plain Html or actual templates?
-> HamletRT |
-> HamletMap url |
-> (url -> [(Text, Text)] -> Text) |
-> m Html |

data SimpleDoc #

Constructors

SDRaw String |
SDVar [String] |
SDUrl Bool [String] |
SDTemplate [String] |
SDForall [String] String [SimpleDoc] |
SDMaybe [String] String [SimpleDoc] [SimpleDoc] |
SDCond [([String], [SimpleDoc])] [SimpleDoc] |