tamarin-prover-utils-1.2.2: Utility library for the tamarin prover.

Copyright(c) 2011 Simon Meier
LicenseGPL v3 (see LICENSE)
MaintainerSimon Meier <iridcode@gmail.com>
Portabilityportable
Safe HaskellNone
LanguageHaskell98

Text.PrettyPrint.Html

Contents

Description

Pretty-printing with support for HTML markup and proper HTML escaping.

Synopsis

HtmlDocument class

class HighlightDocument d => HtmlDocument d where #

Minimal complete definition

unescapedText, unescapedZeroWidthText

Methods

unescapedText :: String -> d #

unescapedText str converts the String str to a document without performing any escaping.

unescapedZeroWidthText :: String -> d #

unescapedZeroWidthText str converts the String str to a document with zero width without performing any escaping.

withTag :: HtmlDocument d => String -> [(String, String)] -> d -> d #

withTag tag attrs inner adds the tag tag with the attributes attrs around the inner document.

withTagNonEmpty :: HtmlDocument d => String -> [(String, String)] -> d -> d #

withTagNonEmpty tag attrs inner adds the tag tag with the attributes attrs around the inner document iff inner is a non-empty document.

closedTag :: HtmlDocument d => String -> [(String, String)] -> d #

closedTag tag attrs builds the closed tag tag with the attributes attrs; e.g.,

closedTag "img" "href" "here" = HtmlDoc (text "<img href=\"here\"/>)

HtmlDoc: adding HTML markup

data HtmlDoc d #

A Document transformer that adds proper HTML escaping.

Instances

Monoid d => Monoid (HtmlDoc d) # 

Methods

mempty :: HtmlDoc d #

mappend :: HtmlDoc d -> HtmlDoc d -> HtmlDoc d #

mconcat :: [HtmlDoc d] -> HtmlDoc d #

NFData d => NFData (HtmlDoc d) # 

Methods

rnf :: HtmlDoc d -> () #

Document d => Document (HtmlDoc d) # 

Methods

char :: Char -> HtmlDoc d #

text :: String -> HtmlDoc d #

zeroWidthText :: String -> HtmlDoc d #

(<->) :: HtmlDoc d -> HtmlDoc d -> HtmlDoc d #

hcat :: [HtmlDoc d] -> HtmlDoc d #

hsep :: [HtmlDoc d] -> HtmlDoc d #

($$) :: HtmlDoc d -> HtmlDoc d -> HtmlDoc d #

($-$) :: HtmlDoc d -> HtmlDoc d -> HtmlDoc d #

vcat :: [HtmlDoc d] -> HtmlDoc d #

sep :: [HtmlDoc d] -> HtmlDoc d #

cat :: [HtmlDoc d] -> HtmlDoc d #

fsep :: [HtmlDoc d] -> HtmlDoc d #

fcat :: [HtmlDoc d] -> HtmlDoc d #

nest :: Int -> HtmlDoc d -> HtmlDoc d #

caseEmptyDoc :: HtmlDoc d -> HtmlDoc d -> HtmlDoc d -> HtmlDoc d #

Document d => HighlightDocument (HtmlDoc d) # 
Document d => HtmlDocument (HtmlDoc d) # 

htmlDoc :: d -> HtmlDoc d #

Wrap a document such that HTML markup can be added without disturbing the layout.

getHtmlDoc :: HtmlDoc d -> d #

postprocessHtmlDoc :: String -> String #

postprocessHtmlDoc cs converts the line-breaks of cs to br tags and the prefixed spaces in every line of cs by non-breaing HTML spaces &nbsp;.

NoHtmlDoc: ignoring HTML markup

noHtmlDoc :: d -> NoHtmlDoc d #

Wrap a document such that all HtmlDocument specific methods are ignored.

getNoHtmlDoc :: NoHtmlDoc d -> d #

Extract the wrapped document.