Copyright | Copyright (c) 2012-2017 David Sorokin <david.sorokin@gmail.com> |
---|---|
License | BSD3 |
Maintainer | David Sorokin <david.sorokin@gmail.com> |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Tested with: GHC 8.0.1
This is an utility module that provides an HTML writer.
Synopsis
- 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.
Instances
MonadIO HtmlWriter Source # | |
Defined in Simulation.Aivika.Experiment.Base.HtmlWriter liftIO :: IO a -> HtmlWriter a # | |
Applicative HtmlWriter Source # | |
Defined in Simulation.Aivika.Experiment.Base.HtmlWriter pure :: a -> HtmlWriter a # (<*>) :: HtmlWriter (a -> b) -> HtmlWriter a -> HtmlWriter b # liftA2 :: (a -> b -> c) -> HtmlWriter a -> HtmlWriter b -> HtmlWriter c # (*>) :: HtmlWriter a -> HtmlWriter b -> HtmlWriter b # (<*) :: HtmlWriter a -> HtmlWriter b -> HtmlWriter a # | |
Functor HtmlWriter Source # | |
Defined in Simulation.Aivika.Experiment.Base.HtmlWriter fmap :: (a -> b) -> HtmlWriter a -> HtmlWriter b # (<$) :: a -> HtmlWriter b -> HtmlWriter a # | |
Monad HtmlWriter Source # | |
Defined in Simulation.Aivika.Experiment.Base.HtmlWriter (>>=) :: HtmlWriter a -> (a -> HtmlWriter b) -> HtmlWriter b # (>>) :: HtmlWriter a -> HtmlWriter b -> HtmlWriter b # return :: a -> HtmlWriter a # |
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