- hamlet :: QuasiQuoter
- xhamlet :: QuasiQuoter
- hamletFile :: FilePath -> Q Exp
- xhamletFile :: FilePath -> Q Exp
- hamletWithSettings :: HamletSettings -> QuasiQuoter
- hamletFileWithSettings :: HamletSettings -> FilePath -> Q Exp
- data HamletSettings = HamletSettings {}
- defaultHamletSettings :: 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 ()
Basic quasiquoters
Calls hamletWithSettings
with defaultHamletSettings
.
Calls hamletWithSettings
using XHTML 1.0 Strict settings.
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).