Module: RDoc::Generator::HTML::HANNA

Defined in:
lib/hanna/hanna.rb

Constant Summary collapse

STYLE =
read('styles.sass')
CLASS_PAGE =
read('page.haml')
FILE_PAGE =
CLASS_PAGE
METHOD_LIST =
read('method_list.haml', 'sections.haml')
FR_INDEX_BODY =
BODY = read('layout.haml')
FILE_INDEX =
read('file_index.haml')
CLASS_INDEX =
read('class_index.haml')
METHOD_INDEX =
read('method_index.haml')
INDEX =
read('index.haml')

Class Method Summary collapse

Class Method Details

.dirObject



14
15
16
# File 'lib/hanna/hanna.rb', line 14

def dir
  @dir ||= File.join File.dirname(__FILE__), 'template_files'
end

.read(*names) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/hanna/hanna.rb', line 18

def read(*names)
  content = names.inject('') { |all, name| all << File.read(File.join(dir, name)) }
  extension = names.first =~ /\.(\w+)$/ && $1

  Hanna::TemplateHelpers.silence_warnings do
    case extension
    when 'sass'
      Sass::Engine.new(content)
    when 'haml'
      Haml::Engine.new(content, :format => :html4, :filename => names.join(','))
    else
      content
    end
  end
end