require 'rubygems' require 'redcloth' require 'erb' require 'uri/common' class Node attr_reader :anchor attr_reader :children def initialize(title, anchor, parent) @title = title @anchor = (parent.anchor ? "#{parent.anchor}-#{anchor}" : anchor) @children = [] parent.children << self end def outline(level) children = "" if level == 1 children = "" end ["
  • #{@title}#{children}
  • "] end Root = Struct.new(:anchor, :children).new(nil, []) def Root.outline "" end end def pop_open_div(name) return %{
    Hide/Show #{name}