| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Text.Hamlet
"Simple Hamlet" quasi-quoter. May only be used to generate expressions.
Generated expressions have typeHtml.
>>>putStrLn(renderHtml[shamlet|<div>Hello, world!|])<div>Hello, world!</div>
Likeshamlet, but produces XHTML.
xshamletFile ::FilePath ->QExpSource#
LikeshamletFile, but produces XHTML.
typeHtmlUrl url =Render url ->HtmlSource#
A function generating anHtml given a URL-rendering function.
Hamlet quasi-quoter. May only be used to generate expressions.
Generated expression have type, for someHtmlUrl urlurl.
data MyRoute = Homerender ::RenderMyRouterender Home _ = "/home">>>putStrLn(renderHtml([hamlet|<a href=@{Home}>Home|] render))<a href="/home">Home</a>
hamletFileReload ::FilePath ->QExpSource#
LikehamletFile, but the external file is parsed at runtime. Allows for more rapid development, but should not be used in production.
Likehamlet, but produces XHTML.
xhamletFile ::FilePath ->QExpSource#
LikehamletFile, but produces XHTML.
typeHtmlUrlI18n msg url =Translate msg ->Render url ->HtmlSource#
A function generating anHtml 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, for someHtmlUrlI18n msg urlmsg andurl.
data MyMsg = Hi | Byedata MyRoute = HomerenderEnglish ::TranslateMyMsgrenderEnglish Hi = "hi"renderEnglish Bye = "bye"renderUrl ::RenderMyRouterenderUrl Home _ = "/home">>>putStrLn(renderHtml([ihamlet|@{Home} _{Hi} _{Bye}|] renderEnglish renderUrl))<div>/home hi bye <div>
ihamletFileReload ::FilePath ->QExpSource#
LikeihamletFile, but the external file is parsed at runtime. Allows for more rapid development, but should not be used in production.
classToAttributes awhereSource#
Convert some value to a list of attribute pairs.
Methods
toAttributes :: a -> [(Text,Text)]Source#
| ToAttributes [(Text,Text)]Source# | |
| ToAttributes [(String,String)]Source# | |
Instance detailsDefined inText.Hamlet | |
| ToAttributes (Text,Text)Source# | |
| ToAttributes (String,String)Source# | |
Settings for parsing of a hamlet document.
Constructors
| HamletSettings | |
Fields
| |
| LiftHamletSettingsSource# | |
Instance detailsDefined inText.Hamlet.Parse Methods lift ::Quote m =>HamletSettings -> mExp# liftTyped ::forall (m ::Type ->Type).Quote m =>HamletSettings ->Code mHamletSettings# | |
Constructors
| NoNewlines | never add newlines |
| NewlinesText | add newlines between consecutive text lines |
| AlwaysNewlines | add newlines everywhere |
| DefaultNewlineStyle |
| ShowNewlineStyleSource# | |
Instance detailsDefined inText.Hamlet.Parse Methods showsPrec ::Int ->NewlineStyle ->ShowS# show ::NewlineStyle ->String# showList :: [NewlineStyle] ->ShowS# | |
| LiftNewlineStyleSource# | |
Instance detailsDefined inText.Hamlet.Parse Methods lift ::Quote m =>NewlineStyle -> mExp# liftTyped ::forall (m ::Type ->Type).Quote m =>NewlineStyle ->Code mNewlineStyle# | |
defaultHamletSettings ::HamletSettingsSource#
Defaults settings: HTML5 doctype and HTML-style empty tags.
Constructors
| NoClose | |
| CloseInside | |
| CloseSeparate |
| Lift (String ->CloseStyle)Source# | |
Instance detailsDefined inText.Hamlet.Parse | |
condH ::Monad m => [(Bool, m ())] ->Maybe (m ()) -> m ()Source#
Checks 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.
maybeH ::Monad m =>Maybe v -> (v -> m ()) ->Maybe (m ()) -> m ()Source#
Runs the second argument with the value in the first, if available. Otherwise, runs the third argument, if available.
Produced byHaddock version 2.30.0