- hamlet :: QuasiQuoter
- xhamlet :: QuasiQuoter
- hamlet' :: QuasiQuoter
- xhamlet' :: QuasiQuoter
- hamletDebug :: QuasiQuoter
- hamletFile :: FilePath -> Q Exp
- xhamletFile :: FilePath -> Q Exp
- hamletWithSettings :: HamletSettings -> QuasiQuoter
- hamletFileWithSettings :: HamletSettings -> FilePath -> Q Exp
- data HamletSettings = HamletSettings {}
- defaultHamletSettings :: HamletSettings
- xhtmlHamletSettings :: HamletSettings
- data Html a
- type Hamlet url = (url -> String) -> Html ()
- renderHamlet :: (url -> String) -> Hamlet url -> ByteString
- renderHtml :: Html a -> ByteString
- preEscapedString :: String -> Html a
- string :: String -> Html a
- unsafeByteString :: ByteString -> Html a
- cdata :: Html () -> Html ()
- data HamletRT
- data HamletData url
- = HDHtml (Html ())
- | HDUrl url
- | HDUrlParams url [(String, String)]
- | HDTemplate HamletRT
- | HDBool Bool
- | HDMaybe (Maybe (HamletData url))
- | HDList [HamletData url]
- | HDMap [(String, HamletData url)]
- data HamletException
- parseHamletRT :: Failure HamletException m => HamletSettings -> String -> m HamletRT
- renderHamletRT :: Failure HamletException m => HamletRT -> HamletData url -> (url -> String) -> m (Html ())
Basic quasiquoters
Calls hamletWithSettings
with defaultHamletSettings
.
Calls hamletWithSettings
using XHTML 1.0 Strict settings.
Calls hamletWithSettings'
with defaultHamletSettings
.
Calls hamletWithSettings'
using XHTML 1.0 Strict settings.
hamletDebug :: QuasiQuoterSource
Calls hamletWithSettings
with debugHamletSettings
.
Load from external file
hamletFile :: FilePath -> Q ExpSource
Calls hamletFileWithSettings
with defaultHamletSettings
.
xhamletFile :: FilePath -> Q ExpSource
Calls hamletFileWithSettings
using XHTML 1.0 Strict settings.
Customized settings
hamletWithSettings :: HamletSettings -> QuasiQuoterSource
A quasi-quoter that converts Hamlet syntax into a function of form:
(url -> String) -> Html
Please see accompanying documentation for a description of Hamlet syntax.
data HamletSettings Source
Settings for parsing of a hamlet document.
HamletSettings | |
|
defaultHamletSettings :: HamletSettingsSource
Defaults settings: HTML5 doctype and HTML-style empty tags.
Datatypes
data Html a
The core HTML datatype.
type Hamlet url = (url -> String) -> Html ()Source
An function generating an Html
given a URL-rendering function.
Construction/rendering
renderHamlet :: (url -> String) -> Hamlet url -> ByteStringSource
Converts a Hamlet
to lazy bytestring.
:: Html a | Document to render. |
-> ByteString | Resulting output. |
O(n). Render the HTML fragment to lazy ByteString
.
preEscapedString :: String -> Html a
Create an HTML snippet from a String
without escaping
Create an HTML snippet from a String
.
:: ByteString | Value to insert. |
-> Html a | Resulting HTML fragment. |
Insert a ByteString
. This is an unsafe operation:
- The
ByteString
could have the wrong encoding. - The
ByteString
might contain illegal HTML characters (no escaping is done).
Runtime Hamlet
data HamletData url Source
HDHtml (Html ()) | |
HDUrl url | |
HDUrlParams url [(String, String)] | |
HDTemplate HamletRT | |
HDBool Bool | |
HDMaybe (Maybe (HamletData url)) | |
HDList [HamletData url] | |
HDMap [(String, HamletData url)] |
data HamletException Source
parseHamletRT :: Failure HamletException m => HamletSettings -> String -> m HamletRTSource
renderHamletRT :: Failure HamletException m => HamletRT -> HamletData url -> (url -> String) -> m (Html ())Source