[Haskell-cafe] Re: Xhtml?

minh thu noteed at gmail.com
Wed Jan 13 09:56:30 EST 2010

2010/1/13 Günther Schmidt <gue.schmidt at web.de>:
> Am 13.01.10 15:31, schrieb Günther Schmidt:
>> Hi,
>> apologies upfront. As time presses I decided to post questions
>> immediately as soon as I run into dead-ends.
>> I just don't want to give the impression that I'm not willing to do my
>> homework.
>> I'm trying to find documentation on Xhtml, the site on hackage refers to
>> http://www.cse.ogi.edu/~andy/html/intro.htm for an introduction to the
>> library, the link is dead.
>> I managed to locate Andy Gill's current homepage
>> (http://www.cse.ogi.edu/~andy/html/intro.htm) but there is no mention of
>> his html combinatory library.
> sry, I meant this site here: http://www.ittc.ku.edu/~andygill/index.php
>> Does anyone else know where an introduction to this library can be
>> retrieved from?
>> Günther


By Xhtml, do you mean the xhtml package on hackage [1] ?

Maybe to get you started:

$ ghci
Prelude> :m + Text.XHtml.Strict
Prelude Text.XHtml.Strict> putStrLn . prettyHtmlFragment $ p (primHtml
"hello") ! [theclass "foo"]
<p class="foo">

The idea is to create values of type Html, e.g. primHtml, combine them
to make bigger document, e.g. with p or (+++), possibly with some
attributes, e.g. with (!), then eventually render the final Html
value, e.g. with prettyHtmlFragment.

Try it in ghci!

HTH, cheers

[1] http://hackage.haskell.org/package/xhtml

More information about the Haskell-Cafe mailing list