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

Defined in:
lib/hanna/hanna.rb

Overview

A better RDoc HTML template

Many different kinds of awesome.

Author: Mislav Marohnić <[email protected]> Based on the work of Michael Granger <[email protected]>

Constant Summary collapse

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

Class Method Summary collapse

Class Method Details

.dirObject



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

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

.read(*names) ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/hanna/hanna.rb', line 19

def read(*names)
  extension = nil
  
  content = names.map { |name|
    if extension
      name += '.' + extension
    else
      extension = name =~ /\.(\w+)$/ && $1
    end
    File.read File.join(dir, name)
  }.join('')

  case extension
  when 'sass'
    Sass::Engine.new(content)
  when 'haml'
    Haml::Engine.new(content)
  else
    content
  end
end