Movatterモバイル変換


[0]ホーム

URL:


shakespeare-2.2.0: A toolkit for making compile-time interpolated templates
Safe HaskellNone
LanguageHaskell2010

Text.Hamlet

Contents

Synopsis

Plain HTML

typeHtml =Markup#

shamlet ::QuasiQuoterSource#

"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>

shamletFile ::FilePath ->QExpSource#

xshamlet ::QuasiQuoterSource#

Likeshamlet, but produces XHTML.

xshamletFile ::FilePath ->QExpSource#

LikeshamletFile, but produces XHTML.

Hamlet

typeHtmlUrl url =Render url ->HtmlSource#

A function generating anHtml given a URL-rendering function.

typeRender url = url -> [(Text,Text)] ->TextSource#

hamlet ::QuasiQuoterSource#

Hamlet quasi-quoter. May only be used to generate expressions.

Generated expression have typeHtmlUrl url, for someurl.

data MyRoute = Homerender ::Render MyRouterender Home _ = "/home">>>putStrLn (renderHtml ([hamlet|<a href=@{Home}>Home|] render))<a href="/home">Home</a>

hamletFile ::FilePath ->QExpSource#

hamletFileReload ::FilePath ->QExpSource#

LikehamletFile, but the external file is parsed at runtime. Allows for more rapid development, but should not be used in production.

xhamlet ::QuasiQuoterSource#

Likehamlet, but produces XHTML.

xhamletFile ::FilePath ->QExpSource#

LikehamletFile, but produces XHTML.

I18N Hamlet

typeHtmlUrlI18n msg url =Translate msg ->Render url ->HtmlSource#

A function generating anHtml given a message translator and a URL rendering function.

typeTranslate msg = msg ->HtmlSource#

ihamlet ::QuasiQuoterSource#

Hamlet quasi-quoter with internationalization. May only be used to generate expressions.

Generated expressions have typeHtmlUrlI18n msg url, for somemsg andurl.

data MyMsg = Hi | Byedata MyRoute = HomerenderEnglish ::Translate MyMsgrenderEnglish Hi  = "hi"renderEnglish Bye = "bye"renderUrl ::Render MyRouterenderUrl Home _ = "/home">>>putStrLn (renderHtml ([ihamlet|@{Home} _{Hi} _{Bye}|] renderEnglish renderUrl))<div>/home hi bye <div>

ihamletFile ::FilePath ->QExpSource#

ihamletFileReload ::FilePath ->QExpSource#

LikeihamletFile, but the external file is parsed at runtime. Allows for more rapid development, but should not be used in production.

Type classes

classToAttributes awhereSource#

Convert some value to a list of attribute pairs.

Methods

toAttributes :: a -> [(Text,Text)]Source#

Instances

Instances details
ToAttributes [(Text,Text)]Source# 
Instance details

Defined inText.Hamlet

Methods

toAttributes :: [(Text,Text)] -> [(Text,Text)]Source#

ToAttributes [(String,String)]Source# 
Instance details

Defined inText.Hamlet

ToAttributes (Text,Text)Source# 
Instance details

Defined inText.Hamlet

ToAttributes (String,String)Source# 
Instance details

Defined inText.Hamlet

Internal, for making more

dataHamletSettingsSource#

Settings for parsing of a hamlet document.

Constructors

HamletSettings 

Fields

Instances

Instances details
LiftHamletSettingsSource# 
Instance details

Defined inText.Hamlet.Parse

dataNewlineStyleSource#

Constructors

NoNewlines

never add newlines

NewlinesText

add newlines between consecutive text lines

AlwaysNewlines

add newlines everywhere

DefaultNewlineStyle 

Instances

Instances details
ShowNewlineStyleSource# 
Instance details

Defined inText.Hamlet.Parse

LiftNewlineStyleSource# 
Instance details

Defined inText.Hamlet.Parse

hamletWithSettings ::QHamletRules ->HamletSettings ->QuasiQuoterSource#

hamletFileWithSettings ::QHamletRules ->HamletSettings ->FilePath ->QExpSource#

defaultHamletSettings ::HamletSettingsSource#

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

xhtmlHamletSettings ::HamletSettingsSource#

dataEnvSource#

Constructors

Env 

Fields

dataHamletRulesSource#

Constructors

HamletRules 

Fields

hamletRules ::QHamletRulesSource#

ihamletRules ::QHamletRulesSource#

htmlRules ::QHamletRulesSource#

dataCloseStyleSource#

Constructors

NoClose 
CloseInside 
CloseSeparate 

Instances

Instances details
Lift (String ->CloseStyle)Source# 
Instance details

Defined inText.Hamlet.Parse

Methods

lift ::Quote m => (String ->CloseStyle) -> mExp#

liftTyped ::forall (m ::Type ->Type).Quote m => (String ->CloseStyle) ->Code m (String ->CloseStyle)#

Used by generated code

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.

asHtmlUrl ::HtmlUrl url ->HtmlUrl urlSource#

attrsToHtml :: [(Text,Text)] ->HtmlSource#

low-level

hamletFromString ::QHamletRules ->HamletSettings ->String ->QExpSource#

Produced byHaddock version 2.30.0


[8]ページ先頭

©2009-2026 Movatter.jp