hamlet-0.5.1: Haml-like template files that are compile-time checked

Text.Hamlet

Contents

Synopsis

Basic quasiquoters

xhamlet :: QuasiQuoterSource

Calls hamletWithSettings using XHTML 1.0 Strict settings.

hamlet' :: QuasiQuoterSource

Calls hamletWithSettings' with defaultHamletSettings.

xhamlet' :: QuasiQuoterSource

Calls hamletWithSettings' using XHTML 1.0 Strict settings.

hamletDebug :: QuasiQuoterSource

Calls hamletWithSettings with debugHamletSettings.

Load from external file

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.

Constructors

HamletSettings 

Fields

hamletDoctype :: String

The value to replace a "!!!" with. Do not include the trailing newline.

hamletCloseEmpties :: Bool

True means to close empty tags (eg, img) with a trailing slash, ie XML-style empty tags. False uses HTML-style.

hamletCloseNewline :: Bool

Should we put a newline after closing a tag?

defaultHamletSettings :: HamletSettingsSource

Defaults settings: HTML5 doctype and HTML-style empty tags.

Datatypes

type Hamlet url = (url -> [(String, String)] -> String) -> HtmlSource

An function generating an Html given a URL-rendering function.

Typeclass

class ToHtml a whereSource

Methods

toHtml :: a -> HtmlSource

Instances

Construction/rendering

renderHamlet :: (url -> [(String, String)] -> String) -> Hamlet url -> ByteStringSource

Converts a Hamlet to lazy bytestring.

cdata :: Html -> HtmlSource

Wrap an Html for embedding in an XML file.

Runtime Hamlet