module Webby
module Filters
# The Slides filter is used to generate an S5 presentation from HTML input
# text. The input HTML is scanned for
tags and slide divs are inserted
# before each tag found.
#
# When the HTML is rendered into the presentation layout, the result is an
# S5 presentation -- provided that the layout includes the appropriate S5
# javascript and CSS files.
#
class Slides
START_SLIDE = %{
#$/}
END_SLIDE = %{
#$/#$/}
# call-seq:
# Slides.new( html )
#
# Creates a new slides filter that will operate on the given
# _html_ string.
#
def initialize( str )
@str = str
@open = false
end
# call-seq:
# filter => html
#
# Process the original html document passed to the filter when it was
# created. The document will be scanned for H1 heading tags and slide
# divs will be inserted into the page before each H1 tag that is found.
#
def filter
result = []
@str.split(%r/\