SummaryAllows one to write HTML with the Haml markup language
Short namehaml
Content typetext
Extension mapping{"haml"=>"html"}
Provided by bundlebuilt-in
API docWebgen::ContentProcessor::Haml


This processor converts the content, which is assumed to be in the Haml markup language, to valid XHTML by using the Haml library. For detailed information about Haml have a look at the Haml Homepage!

This extension is only available if the haml library is installed. The preferred way to do this is via Rubygems:

$ gem install haml


Writing page files using the Haml markup is probably not so a good idea – there are other markup languages that lend themselves better to writing content. However, Haml would be a good choice for writing template files (instead of, for example, writing plain HTML interspersed with ERB tags).

Since Haml is a templating language like ERB, you can use the special context object (which is an instance of Webgen::Context) in your Haml markup. This object provides the rendering context and many useful methods.

Have a look at the Haml tutorial for an introduction to the basic syntax of Haml and/or below for a short example.


Here is a short sample of a text in Haml markup:

      %h2 Welcome!
      %p= context.node['title']
    = context.render_block(:name => 'some_block', :notfound => 'ignore')

%h1#myid This a h1 header

  You can just write
  %b your
  paragraphs here and
  %a{:href => ''} link
  them below. This is a
  %strong nice

  Citations are easy too.
  Really. And you can assign them attributes.

  %li Lists
  %li aren't
  %li difficult
  %li either.

When processed by this content processor, the output would look like this:

<div id='content'>
<div class='row'>
<div class='span4 content'>
<div class='span8 sidebar'></div>

<h1 id='myid'>This a h1 header</h1>
You can just write
paragraphs here and
<a href=''>link</a>
them below. This is a
<blockquote class='information'>
Citations are easy too.
Really. And you can assign them attributes.