shakespeare-2.0.20: 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 Source #

Constructors

HamletRT [SimpleDoc] |

data HamletData url Source #

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)] Source #

data HamletException Source #

Constructors

HamletParseException String |
HamletUnsupportedDocException Doc |
HamletRenderException String |

Instances

Show HamletException Source # |
Instance details Defined in Text.Hamlet.RT Methods showsPrec :: Int -> HamletException -> ShowS Source # show :: HamletException -> String Source # showList :: [HamletException] -> ShowS Source #
Exception HamletException Source # |
Instance details Defined in Text.Hamlet.RT Methods toException :: HamletException -> SomeException Source # fromException :: SomeException -> Maybe HamletException Source # displayException :: HamletException -> String Source #

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

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

renderHamletRT' Source #

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 Source #

Constructors

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