-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Clear to write, read and edit DSL for HTML -- @package lucid @version 2.2 -- | Base types and combinators. module Lucid.Base -- | Render the HTML to a lazy Text. -- -- This is a convenience function defined in terms of execHtmlT, -- runIdentity and toLazyByteString, and decodeUtf8. -- Check the source if you're interested in the lower-level behaviour. renderText :: Html a -> Text -- | Render the HTML to a lazy ByteString. -- -- This is a convenience function defined in terms of execHtmlT, -- runIdentity and toLazyByteString. Check the source if -- you're interested in the lower-level behaviour. renderBS :: Html a -> ByteString -- | Render the HTML to a lazy Text, but in a monad. -- -- This is a convenience function defined in terms of execHtmlT -- and toLazyByteString, and decodeUtf8. Check the source -- if you're interested in the lower-level behaviour. renderTextT :: Monad m => HtmlT m a -> m Text -- | Render the HTML to a lazy ByteString, but in a monad. -- -- This is a convenience function defined in terms of execHtmlT -- and toLazyByteString. Check the source if you're interested in -- the lower-level behaviour. renderBST :: Monad m => HtmlT m a -> m ByteString -- | Render the HTML to a lazy ByteString. -- -- This is a convenience function defined in terms of execHtmlT, -- runIdentity and toLazyByteString. Check the source if -- you're interested in the lower-level behaviour. renderToFile :: FilePath -> Html a -> IO () -- | Build the HTML. Analogous to execState. -- -- You might want to use this is if you want to do something with the raw -- Builder. Otherwise for simple cases you can just use -- renderText or renderBS. execHtmlT :: Monad m => HtmlT m a -> m Builder -- | Evaluate the HTML to its return value. Analogous to -- evalState. -- -- Use this if you want to ignore the HTML output of an action completely -- and just get the result. -- -- For using with the Html type, you'll need runIdentity -- e.g. -- --
--   >>> runIdentity (evalHtmlT (p_ "Hello!"))
--   ()
--   
evalHtmlT :: Monad m => HtmlT m a -> m a -- | This is the low-level way to run the HTML transformer, finally -- returning an element builder and a value. You can pass mempty -- for both arguments for a top-level call. See evalHtmlT and -- execHtmlT for easier to use functions. runHtmlT :: HtmlT m a -> m (HashMap Text Text -> Builder -> Builder, a) -- | Make an HTML builder. makeElement :: Monad m => Text -> HtmlT m a -> HtmlT m a -- | Make an HTML builder for elements which have no ending tag. makeElementNoEnd :: Monad m => Text -> HtmlT m () -- | Make an attribute builder. makeAttribute :: Text -> Text -> Attribute -- | Simple HTML builder type. Defined in terms of HtmlT. Check out -- that type for instance information. -- -- Simple use-cases will just use this type. But if you want to -- transformer over Reader or something, you can go and use HtmlT. type Html = HtmlT Identity -- | A monad transformer that generates HTML. Use the simpler Html -- type if you don't want to transform over some other monad. data HtmlT m a -- | A simple attribute. data Attribute -- | Used to construct HTML terms. -- -- Simplest use: p_ = term "p" yields p_. -- -- Very overloaded for three cases: -- -- -- -- The instances look intimidating but actually the constraints make it -- very general so that type inference works well even in the presence of -- things like OverloadedLists and such. class Term arg result | result -> arg where term = flip termWith [] term :: Term arg result => Text -> arg -> result termWith :: Term arg result => Text -> [Attribute] -> arg -> result -- | Same as the Term class, but will not HTML escape its children. -- Useful for elements like style_ or script_. class TermRaw arg result | result -> arg where termRaw = flip termRawWith [] termRaw :: TermRaw arg result => Text -> arg -> result termRawWith :: TermRaw arg result => Text -> [Attribute] -> arg -> result -- | Can be converted to HTML. class ToHtml a toHtml :: (ToHtml a, Monad m) => a -> HtmlT m () toHtmlRaw :: (ToHtml a, Monad m) => a -> HtmlT m () -- | With an element use these attributes. An overloaded way of adding -- attributes either to an element accepting attributes-and-children or -- one that just accepts attributes. See the two instances. class With a with :: With a => a -> [Attribute] -> a instance Show Attribute instance Eq Attribute instance Monad m => With (HtmlT m a -> HtmlT m a) instance Monad m => With (HtmlT m a) instance TermRaw Text Attribute instance (Monad m, a ~ ()) => TermRaw Text (HtmlT m a) instance (Monad m, ToHtml f, a ~ ()) => TermRaw [Attribute] (f -> HtmlT m a) instance Term Text Attribute instance Monad m => Term (HtmlT m a) (HtmlT m a) instance (Monad m, f ~ HtmlT m a) => Term [Attribute] (f -> HtmlT m a) instance ToHtml Text instance ToHtml Text instance ToHtml String instance m ~ Identity => Show (HtmlT m a) instance (Monad m, a ~ ()) => IsString (HtmlT m a) instance MonadIO m => MonadIO (HtmlT m) instance MonadTrans HtmlT instance Monad m => Monad (HtmlT m) instance Monad m => Functor (HtmlT m) instance Monad m => Applicative (HtmlT m) instance Monoid a => Monoid (Html a) -- | Html5 terms. module Lucid.Html5 -- | DOCTYPE element doctype_ :: Monad m => HtmlT m () -- | DOCTYPE element + html element doctypehtml_ :: Monad m => HtmlT m a -> HtmlT m a -- | a element a_ :: Term arg result => arg -> result -- | abbr element abbr_ :: Term arg result => arg -> result -- | address element address_ :: Term arg result => arg -> result -- | area element area_ :: Monad m => [Attribute] -> HtmlT m () -- | article element article_ :: Term arg result => arg -> result -- | aside element aside_ :: Term arg result => arg -> result -- | audio element audio_ :: Term arg result => arg -> result -- | b element b_ :: Term arg result => arg -> result -- | base element base_ :: Monad m => [Attribute] -> HtmlT m () -- | bdo element bdo_ :: Term arg result => arg -> result -- | blockquote element blockquote_ :: Term arg result => arg -> result -- | body element body_ :: Term arg result => arg -> result -- | br element br_ :: Monad m => [Attribute] -> HtmlT m () -- | button element button_ :: Term arg result => arg -> result -- | canvas element canvas_ :: Term arg result => arg -> result -- | caption element caption_ :: Term arg result => arg -> result -- | cite element or cite attribute. cite_ :: Term arg result => arg -> result -- | code element code_ :: Term arg result => arg -> result -- | col element col_ :: Monad m => [Attribute] -> HtmlT m () -- | colgroup element colgroup_ :: Term arg result => arg -> result -- | command element command_ :: Term arg result => arg -> result -- | datalist element datalist_ :: Term arg result => arg -> result -- | dd element dd_ :: Term arg result => arg -> result -- | del element del_ :: Term arg result => arg -> result -- | details element details_ :: Term arg result => arg -> result -- | dfn element dfn_ :: Term arg result => arg -> result -- | div element div_ :: Term arg result => arg -> result -- | dl element dl_ :: Term arg result => arg -> result -- | dt element dt_ :: Term arg result => arg -> result -- | em element em_ :: Term arg result => arg -> result -- | embed element embed_ :: Monad m => [Attribute] -> HtmlT m () -- | fieldset element fieldset_ :: Term arg result => arg -> result -- | figcaption element figcaption_ :: Term arg result => arg -> result -- | figure element figure_ :: Term arg result => arg -> result -- | footer element footer_ :: Term arg result => arg -> result -- | form element or form attribute form_ :: Term arg result => arg -> result -- | h1 element h1_ :: Term arg result => arg -> result -- | h2 element h2_ :: Term arg result => arg -> result -- | h3 element h3_ :: Term arg result => arg -> result -- | h4 element h4_ :: Term arg result => arg -> result -- | h5 element h5_ :: Term arg result => arg -> result -- | h6 element h6_ :: Term arg result => arg -> result -- | head element head_ :: Term arg result => arg -> result -- | header element header_ :: Term arg result => arg -> result -- | hgroup element hgroup_ :: Term arg result => arg -> result -- | hr element hr_ :: Monad m => [Attribute] -> HtmlT m () -- | html element html_ :: Term arg result => arg -> result -- | i element i_ :: Term arg result => arg -> result -- | iframe element iframe_ :: Term arg result => arg -> result -- | img element img_ :: Monad m => [Attribute] -> HtmlT m () -- | input element input_ :: Monad m => [Attribute] -> HtmlT m () -- | ins element ins_ :: Term arg result => arg -> result -- | kbd element kbd_ :: Term arg result => arg -> result -- | keygen element keygen_ :: Monad m => [Attribute] -> HtmlT m () -- | label element or label attribute label_ :: Term arg result => arg -> result -- | legend element legend_ :: Term arg result => arg -> result -- | li element li_ :: Term arg result => arg -> result -- | link element link_ :: Monad m => [Attribute] -> HtmlT m () -- | map element map_ :: Term arg result => arg -> result -- | main element main_ :: Term arg result => arg -> result -- | mark element mark_ :: Term arg result => arg -> result -- | menu element menu_ :: Term arg result => arg -> result -- | menuitem element menuitem_ :: Monad m => [Attribute] -> HtmlT m () -- | meta element meta_ :: Monad m => [Attribute] -> HtmlT m () -- | meter element meter_ :: Term arg result => arg -> result -- | nav element nav_ :: Term arg result => arg -> result -- | noscript element noscript_ :: Term arg result => arg -> result -- | object element object_ :: Term arg result => arg -> result -- | ol element ol_ :: Term arg result => arg -> result -- | optgroup element optgroup_ :: Term arg result => arg -> result -- | option element option_ :: Term arg result => arg -> result -- | output element output_ :: Term arg result => arg -> result -- | p element p_ :: Term arg result => arg -> result -- | param element param_ :: Monad m => [Attribute] -> HtmlT m () -- | pre element pre_ :: Term arg result => arg -> result -- | progress element progress_ :: Term arg result => arg -> result -- | q element q_ :: Term arg result => arg -> result -- | rp element rp_ :: Term arg result => arg -> result -- | rt element rt_ :: Term arg result => arg -> result -- | ruby element ruby_ :: Term arg result => arg -> result -- | samp element samp_ :: Term arg result => arg -> result -- | script element script_ :: TermRaw arg result => arg -> result -- | section element section_ :: Term arg result => arg -> result -- | select element select_ :: Term arg result => arg -> result -- | small element small_ :: Term arg result => arg -> result -- | source element source_ :: Monad m => [Attribute] -> HtmlT m () -- | span element or span attribute span_ :: Term arg result => arg -> result -- | strong element strong_ :: Term arg result => arg -> result -- | style element or style attribute style_ :: TermRaw arg result => arg -> result -- | sub element sub_ :: Term arg result => arg -> result -- | summary element or summary attribute summary_ :: Term arg result => arg -> result -- | sup element sup_ :: Term arg result => arg -> result -- | table element table_ :: Term arg result => arg -> result -- | tbody element tbody_ :: Term arg result => arg -> result -- | td element td_ :: Term arg result => arg -> result -- | textarea element textarea_ :: Term arg result => arg -> result -- | tfoot element tfoot_ :: Term arg result => arg -> result -- | th element th_ :: Term arg result => arg -> result -- | template element template_ :: Term arg result => arg -> result -- | thead element thead_ :: Term arg result => arg -> result -- | time element time_ :: Term arg result => arg -> result -- | title element or title attribute title_ :: Term arg result => arg -> result -- | tr element tr_ :: Term arg result => arg -> result -- | track element track_ :: Monad m => [Attribute] -> HtmlT m () -- | ul element ul_ :: Term arg result => arg -> result -- | var element var_ :: Term arg result => arg -> result -- | video element video_ :: Term arg result => arg -> result -- | wbr element wbr_ :: Monad m => [Attribute] -> HtmlT m () -- | The accept attribute. accept_ :: Text -> Attribute -- | The acceptCharset attribute. acceptCharset_ :: Text -> Attribute -- | The accesskey attribute. accesskey_ :: Text -> Attribute -- | The action attribute. action_ :: Text -> Attribute -- | The alt attribute. alt_ :: Text -> Attribute -- | The async attribute. async_ :: Text -> Attribute -- | The autocomplete attribute. autocomplete_ :: Text -> Attribute -- | The autofocus attribute. autofocus_ :: Attribute -- | The autoplay attribute. autoplay_ :: Text -> Attribute -- | The challenge attribute. challenge_ :: Text -> Attribute -- | The charset attribute. charset_ :: Text -> Attribute -- | The checked attribute. checked_ :: Attribute -- | The class attribute. class_ :: Text -> Attribute -- | The cols attribute. cols_ :: Text -> Attribute -- | The colspan attribute. colspan_ :: Text -> Attribute -- | The content attribute. content_ :: Text -> Attribute -- | The contenteditable attribute. contenteditable_ :: Text -> Attribute -- | The contextmenu attribute. contextmenu_ :: Text -> Attribute -- | The controls attribute. controls_ :: Text -> Attribute -- | The coords attribute. coords_ :: Text -> Attribute -- | The data attribute. data_ :: Text -> Text -> Attribute -- | The datetime attribute. datetime_ :: Text -> Attribute -- | The defer attribute. defer_ :: Text -> Attribute -- | The dir attribute. dir_ :: Text -> Attribute -- | The disabled attribute. disabled_ :: Text -> Attribute -- | The draggable attribute. draggable_ :: Text -> Attribute -- | The enctype attribute. enctype_ :: Text -> Attribute -- | The for attribute. for_ :: Text -> Attribute -- | The formaction attribute. formaction_ :: Text -> Attribute -- | The formenctype attribute. formenctype_ :: Text -> Attribute -- | The formmethod attribute. formmethod_ :: Text -> Attribute -- | The formnovalidate attribute. formnovalidate_ :: Text -> Attribute -- | The formtarget attribute. formtarget_ :: Text -> Attribute -- | The headers attribute. headers_ :: Text -> Attribute -- | The height attribute. height_ :: Text -> Attribute -- | The hidden attribute. hidden_ :: Text -> Attribute -- | The high attribute. high_ :: Text -> Attribute -- | The href attribute. href_ :: Text -> Attribute -- | The hreflang attribute. hreflang_ :: Text -> Attribute -- | The httpEquiv attribute. httpEquiv_ :: Text -> Attribute -- | The icon attribute. icon_ :: Text -> Attribute -- | The id attribute. id_ :: Text -> Attribute -- | The ismap attribute. ismap_ :: Text -> Attribute -- | The item attribute. item_ :: Text -> Attribute -- | The itemprop attribute. itemprop_ :: Text -> Attribute -- | The keytype attribute. keytype_ :: Text -> Attribute -- | The lang attribute. lang_ :: Text -> Attribute -- | The list attribute. list_ :: Text -> Attribute -- | The loop attribute. loop_ :: Text -> Attribute -- | The low attribute. low_ :: Text -> Attribute -- | The manifest attribute. manifest_ :: Text -> Attribute -- | The max attribute. max_ :: Text -> Attribute -- | The maxlength attribute. maxlength_ :: Text -> Attribute -- | The media attribute. media_ :: Text -> Attribute -- | The method attribute. method_ :: Text -> Attribute -- | The min attribute. min_ :: Text -> Attribute -- | The multiple attribute. multiple_ :: Text -> Attribute -- | The name attribute. name_ :: Text -> Attribute -- | The novalidate attribute. novalidate_ :: Text -> Attribute -- | The onbeforeonload attribute. onbeforeonload_ :: Text -> Attribute -- | The onbeforeprint attribute. onbeforeprint_ :: Text -> Attribute -- | The onblur attribute. onblur_ :: Text -> Attribute -- | The oncanplay attribute. oncanplay_ :: Text -> Attribute -- | The oncanplaythrough attribute. oncanplaythrough_ :: Text -> Attribute -- | The onchange attribute. onchange_ :: Text -> Attribute -- | The onclick attribute. onclick_ :: Text -> Attribute -- | The oncontextmenu attribute. oncontextmenu_ :: Text -> Attribute -- | The ondblclick attribute. ondblclick_ :: Text -> Attribute -- | The ondrag attribute. ondrag_ :: Text -> Attribute -- | The ondragend attribute. ondragend_ :: Text -> Attribute -- | The ondragenter attribute. ondragenter_ :: Text -> Attribute -- | The ondragleave attribute. ondragleave_ :: Text -> Attribute -- | The ondragover attribute. ondragover_ :: Text -> Attribute -- | The ondragstart attribute. ondragstart_ :: Text -> Attribute -- | The ondrop attribute. ondrop_ :: Text -> Attribute -- | The ondurationchange attribute. ondurationchange_ :: Text -> Attribute -- | The onemptied attribute. onemptied_ :: Text -> Attribute -- | The onended attribute. onended_ :: Text -> Attribute -- | The onerror attribute. onerror_ :: Text -> Attribute -- | The onfocus attribute. onfocus_ :: Text -> Attribute -- | The onformchange attribute. onformchange_ :: Text -> Attribute -- | The onforminput attribute. onforminput_ :: Text -> Attribute -- | The onhaschange attribute. onhaschange_ :: Text -> Attribute -- | The oninput attribute. oninput_ :: Text -> Attribute -- | The oninvalid attribute. oninvalid_ :: Text -> Attribute -- | The onkeydown attribute. onkeydown_ :: Text -> Attribute -- | The onkeyup attribute. onkeyup_ :: Text -> Attribute -- | The onload attribute. onload_ :: Text -> Attribute -- | The onloadeddata attribute. onloadeddata_ :: Text -> Attribute -- | The onloadedmetadata attribute. onloadedmetadata_ :: Text -> Attribute -- | The onloadstart attribute. onloadstart_ :: Text -> Attribute -- | The onmessage attribute. onmessage_ :: Text -> Attribute -- | The onmousedown attribute. onmousedown_ :: Text -> Attribute -- | The onmousemove attribute. onmousemove_ :: Text -> Attribute -- | The onmouseout attribute. onmouseout_ :: Text -> Attribute -- | The onmouseover attribute. onmouseover_ :: Text -> Attribute -- | The onmouseup attribute. onmouseup_ :: Text -> Attribute -- | The onmousewheel attribute. onmousewheel_ :: Text -> Attribute -- | The ononline attribute. ononline_ :: Text -> Attribute -- | The onpagehide attribute. onpagehide_ :: Text -> Attribute -- | The onpageshow attribute. onpageshow_ :: Text -> Attribute -- | The onpause attribute. onpause_ :: Text -> Attribute -- | The onplay attribute. onplay_ :: Text -> Attribute -- | The onplaying attribute. onplaying_ :: Text -> Attribute -- | The onprogress attribute. onprogress_ :: Text -> Attribute -- | The onpropstate attribute. onpropstate_ :: Text -> Attribute -- | The onratechange attribute. onratechange_ :: Text -> Attribute -- | The onreadystatechange attribute. onreadystatechange_ :: Text -> Attribute -- | The onredo attribute. onredo_ :: Text -> Attribute -- | The onresize attribute. onresize_ :: Text -> Attribute -- | The onscroll attribute. onscroll_ :: Text -> Attribute -- | The onseeked attribute. onseeked_ :: Text -> Attribute -- | The onseeking attribute. onseeking_ :: Text -> Attribute -- | The onselect attribute. onselect_ :: Text -> Attribute -- | The onstalled attribute. onstalled_ :: Text -> Attribute -- | The onstorage attribute. onstorage_ :: Text -> Attribute -- | The onsubmit attribute. onsubmit_ :: Text -> Attribute -- | The onsuspend attribute. onsuspend_ :: Text -> Attribute -- | The ontimeupdate attribute. ontimeupdate_ :: Text -> Attribute -- | The onundo attribute. onundo_ :: Text -> Attribute -- | The onunload attribute. onunload_ :: Text -> Attribute -- | The onvolumechange attribute. onvolumechange_ :: Text -> Attribute -- | The onwaiting attribute. onwaiting_ :: Text -> Attribute -- | The open attribute. open_ :: Text -> Attribute -- | The optimum attribute. optimum_ :: Text -> Attribute -- | The pattern attribute. pattern_ :: Text -> Attribute -- | The ping attribute. ping_ :: Text -> Attribute -- | The placeholder attribute. placeholder_ :: Text -> Attribute -- | The preload attribute. preload_ :: Text -> Attribute -- | The pubdate attribute. pubdate_ :: Text -> Attribute -- | The radiogroup attribute. radiogroup_ :: Text -> Attribute -- | The readonly attribute. readonly_ :: Text -> Attribute -- | The rel attribute. rel_ :: Text -> Attribute -- | The required attribute. required_ :: Text -> Attribute -- | The reversed attribute. reversed_ :: Text -> Attribute -- | The rows attribute. rows_ :: Text -> Attribute -- | The rowspan attribute. rowspan_ :: Text -> Attribute -- | The sandbox attribute. sandbox_ :: Text -> Attribute -- | The scope attribute. scope_ :: Text -> Attribute -- | The svg attribute. svg_ :: Text -> Attribute -- | The scoped attribute. scoped_ :: Text -> Attribute -- | The seamless attribute. seamless_ :: Text -> Attribute -- | The selected attribute. selected_ :: Text -> Attribute -- | The shape attribute. shape_ :: Text -> Attribute -- | The size attribute. size_ :: Text -> Attribute -- | The sizes attribute. sizes_ :: Text -> Attribute -- | The spellcheck attribute. spellcheck_ :: Text -> Attribute -- | The src attribute. src_ :: Text -> Attribute -- | The srcdoc attribute. srcdoc_ :: Text -> Attribute -- | The start attribute. start_ :: Text -> Attribute -- | The step attribute. step_ :: Text -> Attribute -- | The subject attribute. subject_ :: Text -> Attribute -- | The tabindex attribute. tabindex_ :: Text -> Attribute -- | The target attribute. target_ :: Text -> Attribute -- | The type attribute. type_ :: Text -> Attribute -- | The usemap attribute. usemap_ :: Text -> Attribute -- | The value attribute. value_ :: Text -> Attribute -- | The width attribute. width_ :: Text -> Attribute -- | The wrap attribute. wrap_ :: Text -> Attribute -- | The xmlns attribute. xmlns_ :: Text -> Attribute -- | Bootstrap layout elements. See -- http://getbootstrap.com/2.3.2/scaffolding.html for more -- information. module Lucid.Bootstrap -- | A grid container. container_ :: Term arg result => arg -> result -- | A fluid grid container. containerFluid_ :: Term arg result => arg -> result -- | A grid row. row_ :: Term arg result => arg -> result -- | A fluid grid row. rowFluid_ :: Term arg result => arg -> result -- | A span of 1 column. span1_ :: Term arg result => arg -> result -- | A span of 2 columns. span2_ :: Term arg result => arg -> result -- | A span of 3 columns. span3_ :: Term arg result => arg -> result -- | A span of 4 columns. span4_ :: Term arg result => arg -> result -- | A span of 5 columns. span5_ :: Term arg result => arg -> result -- | A span of 6 columns. span6_ :: Term arg result => arg -> result -- | A span of 7 columns. span7_ :: Term arg result => arg -> result -- | A span of 8 columns. span8_ :: Term arg result => arg -> result -- | A span of 9 columns. span9_ :: Term arg result => arg -> result -- | A span of 10 columns. span10_ :: Term arg result => arg -> result -- | A span of 11 columns. span11_ :: Term arg result => arg -> result -- | A span of 12 columns. span12_ :: Term arg result => arg -> result -- | Clear to write, read and edit DSL for writing HTML -- -- See Lucid.Html5 for a complete list of Html5 combinators. That -- module is re-exported from this module for your convenience. -- -- See Lucid.Base for lower level functions like -- makeElement, makeAttribute, termRaw, etc. module Lucid -- | Render the HTML to a lazy Text. -- -- This is a convenience function defined in terms of execHtmlT, -- runIdentity and toLazyByteString, and decodeUtf8. -- Check the source if you're interested in the lower-level behaviour. renderText :: Html a -> Text -- | Render the HTML to a lazy ByteString. -- -- This is a convenience function defined in terms of execHtmlT, -- runIdentity and toLazyByteString. Check the source if -- you're interested in the lower-level behaviour. renderBS :: Html a -> ByteString -- | Render the HTML to a lazy Text, but in a monad. -- -- This is a convenience function defined in terms of execHtmlT -- and toLazyByteString, and decodeUtf8. Check the source -- if you're interested in the lower-level behaviour. renderTextT :: Monad m => HtmlT m a -> m Text -- | Render the HTML to a lazy ByteString, but in a monad. -- -- This is a convenience function defined in terms of execHtmlT -- and toLazyByteString. Check the source if you're interested in -- the lower-level behaviour. renderBST :: Monad m => HtmlT m a -> m ByteString -- | Render the HTML to a lazy ByteString. -- -- This is a convenience function defined in terms of execHtmlT, -- runIdentity and toLazyByteString. Check the source if -- you're interested in the lower-level behaviour. renderToFile :: FilePath -> Html a -> IO () -- | Build the HTML. Analogous to execState. -- -- You might want to use this is if you want to do something with the raw -- Builder. Otherwise for simple cases you can just use -- renderText or renderBS. execHtmlT :: Monad m => HtmlT m a -> m Builder -- | Evaluate the HTML to its return value. Analogous to -- evalState. -- -- Use this if you want to ignore the HTML output of an action completely -- and just get the result. -- -- For using with the Html type, you'll need runIdentity -- e.g. -- --
--   >>> runIdentity (evalHtmlT (p_ "Hello!"))
--   ()
--   
evalHtmlT :: Monad m => HtmlT m a -> m a -- | This is the low-level way to run the HTML transformer, finally -- returning an element builder and a value. You can pass mempty -- for both arguments for a top-level call. See evalHtmlT and -- execHtmlT for easier to use functions. runHtmlT :: HtmlT m a -> m (HashMap Text Text -> Builder -> Builder, a) -- | Simple HTML builder type. Defined in terms of HtmlT. Check out -- that type for instance information. -- -- Simple use-cases will just use this type. But if you want to -- transformer over Reader or something, you can go and use HtmlT. type Html = HtmlT Identity -- | A simple attribute. data Attribute -- | Used to construct HTML terms. -- -- Simplest use: p_ = term "p" yields p_. -- -- Very overloaded for three cases: -- -- -- -- The instances look intimidating but actually the constraints make it -- very general so that type inference works well even in the presence of -- things like OverloadedLists and such. class Term arg result | result -> arg where term = flip termWith [] term :: Term arg result => Text -> arg -> result termWith :: Term arg result => Text -> [Attribute] -> arg -> result -- | Can be converted to HTML. class ToHtml a toHtml :: (ToHtml a, Monad m) => a -> HtmlT m () toHtmlRaw :: (ToHtml a, Monad m) => a -> HtmlT m () -- | With an element use these attributes. An overloaded way of adding -- attributes either to an element accepting attributes-and-children or -- one that just accepts attributes. See the two instances. class With a with :: With a => a -> [Attribute] -> a