xhtml-combinators-0.1: Fast and easy to use XHTML combinators.

Text.XHtmlCombinators.Render

Synopsis

Documentation

render :: Content c => XHtml c -> TextSource

Quickly render a xhtml page to text.

This function will render the entire page on a single line, which is somewhat unreadable. On the plus side, it's relatively fast.

renderPretty :: Content c => XHtml c -> TextSource

Renders a pretty xhtml page with readable indentation.

What we do is turn the document from Text into a String, parse that string with Text.XML.Light, then use Text.XML.Light's pretty printing function to render it, before finally packing it again. It probably goes without saying, but this function is incredibly inefficient!

Also, Text.XML.Light will render the document as proper XML, which is fine only if you're not trying to pass of your page as text/html.