An extensible Haskell content management system

I've extended the markup syntax a bit, and added the ability for modules to add their own formatting rules. Here is a summary of the supported markup:

Paragraphs

Use one or more empty lines to separate paragraphs.

Headings

Headings are written with multiple equal signs:

=== Headings ===

Headings are written with multiple equal signs:

Emphasis

Use asterisks to emphasize text.

 Use asterisks to *emphasize text*. 

Links

Enclose URLs in square brackets to make links. The markup after the URL becomes the link text.

Enclose URLs in [http://en.wikipedia.org/wiki/Bracket 
*square* brackets] to make links. 
The markup after the URL becomes the link text.

Images

To include external inline images, use [image:url].

[image:http://hope.bringert.net/_theme/hope/logo.png]

Special characters

Backslash escapes

Put a \ before characters which have special meaning in Hope markup to include the literal characters. Some examples: [ ] & { }

Some examples: \[ \] \& \{ \}

XML entities

XHTML Named entities

All named entities in XHTML 1.0 are supported. My name is Björn Bringert.

My name is Björn Bringert.
Numerical entities

You can use XML-style numerical entities, both decimal and hexadecimal. To write a λ (lambda) you write "λ".

Preformatted text

Use the "pre" chunk format:

This is
   preformatted text.

{{{pre: This is preformatted text. }}}

Block quotes

Use the "quote" chunk format:

If you try and take a cat apart to see how it works, the first thing you have on your hands is a non-working cat.

{{{quote: If you try and take a cat apart to see how it works, the first thing you have on your hands is a non-working cat. }}}

Custom references

Modules can add their own markup for inline items: [name:x y z].

Halbum images

The "halbum" reference format lets you add thumbnails for halbum images using the image ID.

IMG_0704.JPG

[halbum:11]

Custom chunks

Modules can also add chunk formats:

{{{name: foo bar baz }}}

Haskell code

The "haskell" module adds a chunk format called "haskell" which highlights Haskell code using hscolour:

module_haskell :: Module
module_haskell = 
    emptyModule {
                 moduleName = "haskell",
                 moduleStyleSheets = ["modules/haskell/style/haskell.css"],
                 moduleMarkupFormats = formats
                }

formats :: [MarkupXHtmlFormat Hope]
formats = [haskellChunk]

haskellChunk :: MarkupXHtmlFormat Hope
haskellChunk = ChunkFormat "haskell" f
    where f pref s = do let h = CSS.hscolourFragment False s
                        return $ primHtml h

Missing features

Various kinds of lists.

BUGS

There is no way to include a literal }}} in a preformatted chunk (or any chunk for that matter).