Instances1ToHamletData
ToHamletData HtmlDefined in shakespeare-2.1.0.1 · Text.Hamlet.Runtime
:: a typeCtrl KGHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05
Moduleshakespeare-2.1.0.1Haskell2010
ToHamletData HtmlDefined in shakespeare-2.1.0.1 · Text.Hamlet.RuntimeLike shamlet, but produces XHTML.
Like shamletFile, but produces XHTML.
A function generating an Html given a URL-rendering function.
Hamlet quasi-quoter. May only be used to generate expressions.
Generated expression have type HtmlUrl url, for some url.
data MyRoute = Home
render :: Render MyRoute
render Home _ = "/home"
>>> putStrLn (renderHtml ([hamlet|<a href=@{Home}>Home|] render))
<a href="/home">Home</a>
Like hamletFile, but the external file is parsed at runtime. Allows for more rapid development, but should not be used in production.
Like hamlet, but produces XHTML.
Like hamletFile, but produces XHTML.
A function generating an Html given a message translator and a URL rendering function.
Hamlet quasi-quoter with internationalization. May only be used to generate expressions.
Generated expressions have type HtmlUrlI18n msg url, for some msg and
url.
data MyMsg = Hi | Bye
data MyRoute = Home
renderEnglish :: Translate MyMsg
renderEnglish Hi = "hi"
renderEnglish Bye = "bye"
renderUrl :: Render MyRoute
renderUrl Home _ = "/home"
>>> putStrLn (Text.Blaze.Html.Renderer.renderHtml ([ihamlet|@{Home} _{Hi} _{Bye}|] renderEnglish renderUrl))
<div>/home hi bye <div>
Like ihamletFile, but the external file is parsed at runtime. Allows for more rapid development, but should not be used in production.
Convert some value to a list of attribute pairs.
toAttributes :: a -> [(Text, Text)]ToAttributes [(String, String)]Defined in shakespeare-2.1.0.1 · Text.HamletToAttributes [(Text, Text)]Defined in shakespeare-2.1.0.1 · Text.HamletToAttributes (String, String)Defined in shakespeare-2.1.0.1 · Text.HamletToAttributes (Text, Text)Defined in shakespeare-2.1.0.1 · Text.HamletSettings for parsing of a hamlet document.
HamletSettingshamletDoctype :: StringThe value to replace a "!!!" with. Do not include the trailing newline.
hamletNewlines :: NewlineStyleShould we add newlines to the output, making it more human-readable? Useful for client-side debugging but may alter browser page layout.
hamletCloseStyle :: String -> CloseStyleHow a tag should be closed. Use this to switch between HTML, XHTML or even XML output.
hamletDoctypeNames :: [(String, String)]Mapping from short names in "$doctype" statements to full doctype.
Lift HamletSettingsDefined in shakespeare-2.1.0.1 · Text.Hamlet.ParseNoNewlinesnever add newlines
NewlinesTextadd newlines between consecutive text lines
AlwaysNewlinesadd newlines everywhere
DefaultNewlineStyleShow NewlineStyleDefined in shakespeare-2.1.0.1 · Text.Hamlet.ParseLift NewlineStyleDefined in shakespeare-2.1.0.1 · Text.Hamlet.ParseDefaults settings: HTML5 doctype and HTML-style empty tags.
Lift (String -> CloseStyle)Defined in shakespeare-2.1.0.1 · Text.Hamlet.ParseChecks for truth in the left value in each pair in the first argument. If a true exists, then the corresponding right action is performed. Only the first is performed. In there are no true values, then the second argument is performed, if supplied.
Runs the second argument with the value in the first, if available. Otherwise, runs the third argument, if available.