Copyright | Copyright (c) 2012-2015, David Sorokin <david.sorokin@gmail.com> |
---|---|
License | BSD3 |
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell98 |
Tested with: GHC 7.10.1
This is an utility module that provides an HTML writer.
- data HtmlWriter a
- runHtmlWriter :: HtmlWriter a -> ShowS -> ExperimentWriter (a, ShowS)
- composeHtml :: ShowS -> HtmlWriter ()
- writeHtml :: String -> HtmlWriter ()
- writeHtmlLn :: String -> HtmlWriter ()
- writeHtmlText :: String -> HtmlWriter ()
- writeHtmlParagraph :: HtmlWriter () -> HtmlWriter ()
- writeHtmlParagraphWithId :: String -> HtmlWriter () -> HtmlWriter ()
- writeHtmlHeader1 :: HtmlWriter () -> HtmlWriter ()
- writeHtmlHeader1WithId :: String -> HtmlWriter () -> HtmlWriter ()
- writeHtmlHeader2 :: HtmlWriter () -> HtmlWriter ()
- writeHtmlHeader2WithId :: String -> HtmlWriter () -> HtmlWriter ()
- writeHtmlHeader3 :: HtmlWriter () -> HtmlWriter ()
- writeHtmlHeader3WithId :: String -> HtmlWriter () -> HtmlWriter ()
- writeHtmlHeader4 :: HtmlWriter () -> HtmlWriter ()
- writeHtmlHeader4WithId :: String -> HtmlWriter () -> HtmlWriter ()
- writeHtmlHeader5 :: HtmlWriter () -> HtmlWriter ()
- writeHtmlHeader5WithId :: String -> HtmlWriter () -> HtmlWriter ()
- writeHtmlHeader6 :: HtmlWriter () -> HtmlWriter ()
- writeHtmlHeader6WithId :: String -> HtmlWriter () -> HtmlWriter ()
- writeHtmlBreak :: HtmlWriter ()
- writeHtmlLink :: String -> HtmlWriter () -> HtmlWriter ()
- writeHtmlImage :: String -> HtmlWriter ()
- writeHtmlList :: HtmlWriter () -> HtmlWriter ()
- writeHtmlListItem :: HtmlWriter () -> HtmlWriter ()
- writeHtmlDocumentWithTitle :: String -> HtmlWriter () -> HtmlWriter ()
- encodeHtmlText :: String -> String
Documentation
data HtmlWriter a Source
It writes fast an HTML code.
runHtmlWriter :: HtmlWriter a -> ShowS -> ExperimentWriter (a, ShowS) Source
Run the HTML writer monad.
composeHtml :: ShowS -> HtmlWriter () Source
Compose the HTML applying the corresponded transformation.
writeHtml :: String -> HtmlWriter () Source
Write the HTML code.
writeHtmlLn :: String -> HtmlWriter () Source
Write the HTML code.
writeHtmlText :: String -> HtmlWriter () Source
Write the text in HTML.
writeHtmlParagraph :: HtmlWriter () -> HtmlWriter () Source
Write the <p>
element with the specified contents.
writeHtmlParagraphWithId :: String -> HtmlWriter () -> HtmlWriter () Source
Write the <p>
element with the specified id and contents.
writeHtmlHeader1 :: HtmlWriter () -> HtmlWriter () Source
Write the <h1>
element with the specified contents.
writeHtmlHeader1WithId :: String -> HtmlWriter () -> HtmlWriter () Source
Write the <h1>
element with the specified id and contents.
writeHtmlHeader2 :: HtmlWriter () -> HtmlWriter () Source
Write the <h2>
element with the specified contents.
writeHtmlHeader2WithId :: String -> HtmlWriter () -> HtmlWriter () Source
Write the <h2>
element with the specified id and contents.
writeHtmlHeader3 :: HtmlWriter () -> HtmlWriter () Source
Write the <h3>
element with the specified contents.
writeHtmlHeader3WithId :: String -> HtmlWriter () -> HtmlWriter () Source
Write the <h3>
element with the specified id and contents.
writeHtmlHeader4 :: HtmlWriter () -> HtmlWriter () Source
Write the <h4>
element with the specified contents.
writeHtmlHeader4WithId :: String -> HtmlWriter () -> HtmlWriter () Source
Write the <h4>
element with the specified id and contents.
writeHtmlHeader5 :: HtmlWriter () -> HtmlWriter () Source
Write the <h5>
element with the specified contents.
writeHtmlHeader5WithId :: String -> HtmlWriter () -> HtmlWriter () Source
Write the <h5>
element with the specified id and contents.
writeHtmlHeader6 :: HtmlWriter () -> HtmlWriter () Source
Write the <h6>
element with the specified contents.
writeHtmlHeader6WithId :: String -> HtmlWriter () -> HtmlWriter () Source
Write the <h6>
element with the specified id and contents.
writeHtmlBreak :: HtmlWriter () Source
Write the <br>
element.
writeHtmlLink :: String -> HtmlWriter () -> HtmlWriter () Source
Write the HTML link with the specified URI and contents.
writeHtmlImage :: String -> HtmlWriter () Source
Write the HTML image with the specified URI.
writeHtmlList :: HtmlWriter () -> HtmlWriter () Source
Write the list of items wrapped in <ul>
.
writeHtmlListItem :: HtmlWriter () -> HtmlWriter () Source
Write the item list wrapped in <li>
.
writeHtmlDocumentWithTitle :: String -> HtmlWriter () -> HtmlWriter () Source
Write the HTML document with the specified title and contents
encodeHtmlText :: String -> String Source
Escape special HTML characters in the String
.
It is based on one function from package Web-Encodings,
which is licensed under BSD3 but obsolete now.