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

Portabilityportable
MaintainerSimon Meier <iridcode@gmail.com>
Safe HaskellNone

Text.PrettyPrint.Html

Contents

Description

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

Synopsis

HtmlDocument class

class HighlightDocument d => HtmlDocument d whereSource

Methods

unescapedText :: String -> dSource

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

unescapedZeroWidthText :: String -> dSource

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

Instances

Document d => HtmlDocument (NoHtmlDoc d) 
Document d => HtmlDocument (HtmlDoc d) 

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

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

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

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)] -> dSource

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 Source

A Document transformer that adds proper HTML escaping.

htmlDoc :: d -> HtmlDoc dSource

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

postprocessHtmlDoc :: String -> StringSource

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 dSource

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

getNoHtmlDoc :: NoHtmlDoc d -> dSource

Extract the wrapped document.