mislav-hanna 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/Manifest +19 -0
- data/README.markdown +30 -6
- data/Rakefile +21 -23
- data/bin/hanna +3 -9
- data/hanna.gemspec +121 -0
- data/lib/hanna.rb +1 -0
- data/lib/hanna/hanna.rb +11 -17
- data/lib/hanna/rdoc_version.rb +21 -0
- data/lib/hanna/rdoctask.rb +4 -8
- data/lib/hanna/template_files/index.haml +1 -1
- data/lib/hanna/template_files/layout.haml +13 -14
- data/lib/hanna/template_files/sections.haml +1 -1
- data/lib/hanna/template_files/styles.sass +7 -8
- data/lib/hanna/template_helpers.rb +18 -2
- data/lib/hanna/template_page_patch.rb +7 -2
- metadata +58 -29
- data/lib/hanna/rdoc_patch.rb +0 -22
data/Manifest
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
hanna.gemspec
|
|
2
|
+
bin/hanna
|
|
3
|
+
README.markdown
|
|
4
|
+
Manifest
|
|
5
|
+
lib/hanna/template_page_patch.rb
|
|
6
|
+
lib/hanna/rdoc_version.rb
|
|
7
|
+
lib/hanna/template_helpers.rb
|
|
8
|
+
lib/hanna/template_files/method_list.haml
|
|
9
|
+
lib/hanna/template_files/styles.sass
|
|
10
|
+
lib/hanna/template_files/class_index.haml
|
|
11
|
+
lib/hanna/template_files/layout.haml
|
|
12
|
+
lib/hanna/template_files/index.haml
|
|
13
|
+
lib/hanna/template_files/page.haml
|
|
14
|
+
lib/hanna/template_files/sections.haml
|
|
15
|
+
lib/hanna/template_files/file_index.haml
|
|
16
|
+
lib/hanna/rdoctask.rb
|
|
17
|
+
lib/hanna/hanna.rb
|
|
18
|
+
lib/hanna.rb
|
|
19
|
+
Rakefile
|
data/README.markdown
CHANGED
|
@@ -11,12 +11,23 @@ Hanna was made by [Mislav][] and is available from [GitHub][]:
|
|
|
11
11
|
|
|
12
12
|
## Usage
|
|
13
13
|
|
|
14
|
-
After installing, you have
|
|
14
|
+
After installing, you have several options.
|
|
15
|
+
---
|
|
16
|
+
Hanna can be used as a normal RDoc template by specifying
|
|
17
|
+
-S -T hanna
|
|
18
|
+
to rdoc. Note that Hanna requires the -S option, which inlines source
|
|
19
|
+
code.
|
|
20
|
+
---
|
|
21
|
+
You can use the command-line tool included in the Hanna gem:
|
|
15
22
|
|
|
16
23
|
hanna -h
|
|
17
24
|
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
This is a wrapper over the rdoc script that makes RDoc use the Hanna
|
|
26
|
+
template.
|
|
27
|
+
---
|
|
28
|
+
For repeated generation of API docs, it's better to set up a Rake task.
|
|
29
|
+
If you already have an RDocTask set up in your Rakefile, the only thing
|
|
30
|
+
you need to change is this:
|
|
20
31
|
|
|
21
32
|
# replace this:
|
|
22
33
|
require 'rake/rdoctask'
|
|
@@ -46,10 +57,23 @@ Here is an example of a task for the [will_paginate library][wp]:
|
|
|
46
57
|
rdoc.options << '--webcvs=http://github.com/mislav/will_paginate/tree/master/'
|
|
47
58
|
end
|
|
48
59
|
|
|
49
|
-
|
|
60
|
+
Alternatively, you can use the the standard RDocTask and simply set the
|
|
61
|
+
task's +template+ attribute to +hanna+ and append +--inline-source+ to its
|
|
62
|
+
options attribute.
|
|
50
63
|
|
|
51
|
-
|
|
52
|
-
|
|
64
|
+
A third alternative is to set the +RDOCOPT+ environment variable to
|
|
65
|
+
|
|
66
|
+
-T hanna -S
|
|
67
|
+
|
|
68
|
+
which will make RDoc always use Hanna unless this is overridden on the
|
|
69
|
+
command-line.
|
|
70
|
+
--
|
|
71
|
+
You also can generate documentation for installed gems, which might be more
|
|
72
|
+
convenient than the
|
|
73
|
+
|
|
74
|
+
gem rdoc
|
|
75
|
+
|
|
76
|
+
command (with the +RDOCOPT+ environment variable set as above). For this, do:
|
|
53
77
|
|
|
54
78
|
[sudo] hanna --gems haml will_paginate
|
|
55
79
|
|
data/Rakefile
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
File.read('.gitignore').each_line do |glob|
|
|
8
|
-
glob = glob.chomp.sub(/^\//, '')
|
|
9
|
-
list -= Dir[glob]
|
|
10
|
-
list -= Dir["#{glob}/**/*"] if File.directory?(glob) and !File.symlink?(glob)
|
|
11
|
-
puts "excluding #{glob}"
|
|
12
|
-
end if File.exists?('.gitignore')
|
|
1
|
+
#
|
|
2
|
+
# This can be made cleaner by using the relative gem.
|
|
3
|
+
#
|
|
4
|
+
require File.join(File.dirname(__FILE__), "lib/hanna/rdoc_version")
|
|
5
|
+
|
|
6
|
+
require 'echoe'
|
|
13
7
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
8
|
+
Echoe.new('hanna') do |p|
|
|
9
|
+
p.version = '0.1.3'
|
|
10
|
+
|
|
11
|
+
p.summary = "An RDoc template that rocks"
|
|
12
|
+
p.description = "Hanna is an RDoc template that scales. It's implemented in Haml, making its source clean and maintainable. It's built with simplicity, beauty and ease of browsing in mind."
|
|
13
|
+
|
|
14
|
+
p.author = 'Mislav Marohnić'
|
|
15
|
+
p.email = 'mislav.marohnic@gmail.com'
|
|
16
|
+
p.url = 'http://github.com/mislav/hanna'
|
|
17
|
+
|
|
18
|
+
p.executable_pattern = ['bin/hanna']
|
|
19
|
+
p.has_rdoc = false
|
|
20
|
+
p.runtime_dependencies = []
|
|
21
|
+
p.runtime_dependencies << ['rdoc', Hanna::RDOC_VERSION_REQUIREMENT]
|
|
22
|
+
p.runtime_dependencies << ['haml', '~> 2.0']
|
|
25
23
|
end
|
data/bin/hanna
CHANGED
|
@@ -25,19 +25,13 @@ HELP
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
require 'rubygems'
|
|
28
|
-
begin
|
|
29
|
-
gem 'rdoc', '~> 2.0.0'
|
|
30
|
-
rescue Gem::LoadError
|
|
31
|
-
$stderr.puts "Hanna requires the RDoc 2.0 gem."
|
|
32
|
-
exit 1
|
|
33
|
-
else
|
|
34
|
-
require 'rdoc/rdoc'
|
|
35
|
-
end
|
|
36
28
|
|
|
37
29
|
hanna_dir = File.expand_path(File.join(File.dirname(__FILE__), '..', 'lib'))
|
|
38
30
|
$:.unshift(hanna_dir) unless $:.include?(hanna_dir)
|
|
39
31
|
|
|
40
|
-
require 'hanna/
|
|
32
|
+
require 'hanna/rdoc_version'
|
|
33
|
+
Hanna::require_rdoc
|
|
34
|
+
require 'rdoc/rdoc'
|
|
41
35
|
|
|
42
36
|
options = []
|
|
43
37
|
|
data/hanna.gemspec
ADDED
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
|
|
2
|
+
# Gem::Specification for Hanna-0.1.3
|
|
3
|
+
# Originally generated by Echoe
|
|
4
|
+
|
|
5
|
+
--- !ruby/object:Gem::Specification
|
|
6
|
+
name: hanna
|
|
7
|
+
version: !ruby/object:Gem::Version
|
|
8
|
+
version: 0.1.3
|
|
9
|
+
platform: ruby
|
|
10
|
+
authors:
|
|
11
|
+
- "Mislav Marohni\xC4\x87"
|
|
12
|
+
autorequire:
|
|
13
|
+
bindir: bin
|
|
14
|
+
|
|
15
|
+
date: 2008-09-19 00:00:00 -04:00
|
|
16
|
+
default_executable:
|
|
17
|
+
dependencies:
|
|
18
|
+
- !ruby/object:Gem::Dependency
|
|
19
|
+
name: rdoc
|
|
20
|
+
type: :runtime
|
|
21
|
+
version_requirement:
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ~>
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: 2.2.0
|
|
27
|
+
version:
|
|
28
|
+
- !ruby/object:Gem::Dependency
|
|
29
|
+
name: haml
|
|
30
|
+
type: :runtime
|
|
31
|
+
version_requirement:
|
|
32
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
33
|
+
requirements:
|
|
34
|
+
- - ~>
|
|
35
|
+
- !ruby/object:Gem::Version
|
|
36
|
+
version: "2.0"
|
|
37
|
+
version:
|
|
38
|
+
- !ruby/object:Gem::Dependency
|
|
39
|
+
name: echoe
|
|
40
|
+
type: :development
|
|
41
|
+
version_requirement:
|
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
43
|
+
requirements:
|
|
44
|
+
- - ">="
|
|
45
|
+
- !ruby/object:Gem::Version
|
|
46
|
+
version: "0"
|
|
47
|
+
version:
|
|
48
|
+
description: Hanna is an RDoc template that scales. It's implemented in Haml, making its source clean and maintainable. It's built with simplicity, beauty and ease of browsing in mind.
|
|
49
|
+
email: mislav.marohnic@gmail.com
|
|
50
|
+
executables:
|
|
51
|
+
- hanna
|
|
52
|
+
extensions: []
|
|
53
|
+
|
|
54
|
+
extra_rdoc_files:
|
|
55
|
+
- bin/hanna
|
|
56
|
+
- README.markdown
|
|
57
|
+
- lib/hanna/template_page_patch.rb
|
|
58
|
+
- lib/hanna/rdoc_version.rb
|
|
59
|
+
- lib/hanna/template_helpers.rb
|
|
60
|
+
- lib/hanna/template_files/method_list.haml
|
|
61
|
+
- lib/hanna/template_files/styles.sass
|
|
62
|
+
- lib/hanna/template_files/class_index.haml
|
|
63
|
+
- lib/hanna/template_files/layout.haml
|
|
64
|
+
- lib/hanna/template_files/index.haml
|
|
65
|
+
- lib/hanna/template_files/page.haml
|
|
66
|
+
- lib/hanna/template_files/sections.haml
|
|
67
|
+
- lib/hanna/template_files/file_index.haml
|
|
68
|
+
- lib/hanna/rdoctask.rb
|
|
69
|
+
- lib/hanna/hanna.rb
|
|
70
|
+
- lib/hanna.rb
|
|
71
|
+
files:
|
|
72
|
+
- hanna.gemspec
|
|
73
|
+
- bin/hanna
|
|
74
|
+
- README.markdown
|
|
75
|
+
- Manifest
|
|
76
|
+
- lib/hanna/template_page_patch.rb
|
|
77
|
+
- lib/hanna/rdoc_version.rb
|
|
78
|
+
- lib/hanna/template_helpers.rb
|
|
79
|
+
- lib/hanna/template_files/method_list.haml
|
|
80
|
+
- lib/hanna/template_files/styles.sass
|
|
81
|
+
- lib/hanna/template_files/class_index.haml
|
|
82
|
+
- lib/hanna/template_files/layout.haml
|
|
83
|
+
- lib/hanna/template_files/index.haml
|
|
84
|
+
- lib/hanna/template_files/page.haml
|
|
85
|
+
- lib/hanna/template_files/sections.haml
|
|
86
|
+
- lib/hanna/template_files/file_index.haml
|
|
87
|
+
- lib/hanna/rdoctask.rb
|
|
88
|
+
- lib/hanna/hanna.rb
|
|
89
|
+
- lib/hanna.rb
|
|
90
|
+
- Rakefile
|
|
91
|
+
has_rdoc: false
|
|
92
|
+
homepage: http://github.com/mislav/hanna
|
|
93
|
+
post_install_message:
|
|
94
|
+
rdoc_options:
|
|
95
|
+
- --line-numbers
|
|
96
|
+
- --inline-source
|
|
97
|
+
- --title
|
|
98
|
+
- Hanna
|
|
99
|
+
- --main
|
|
100
|
+
- README.markdown
|
|
101
|
+
require_paths:
|
|
102
|
+
- lib
|
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
|
+
requirements:
|
|
105
|
+
- - ">="
|
|
106
|
+
- !ruby/object:Gem::Version
|
|
107
|
+
version: "0"
|
|
108
|
+
version:
|
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
110
|
+
requirements:
|
|
111
|
+
- - "="
|
|
112
|
+
- !ruby/object:Gem::Version
|
|
113
|
+
version: "1.2"
|
|
114
|
+
version:
|
|
115
|
+
requirements: []
|
|
116
|
+
|
|
117
|
+
rubyforge_project: hanna
|
|
118
|
+
rubygems_version: 1.2.0
|
|
119
|
+
specification_version: 2
|
|
120
|
+
summary: An RDoc template that rocks
|
|
121
|
+
test_files: []
|
data/lib/hanna.rb
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require 'hanna/hanna'
|
data/lib/hanna/hanna.rb
CHANGED
|
@@ -16,24 +16,18 @@ module RDoc::Generator::HTML::HANNA
|
|
|
16
16
|
end
|
|
17
17
|
|
|
18
18
|
def read(*names)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
content = names.inject('') { |all, name| all << File.read(File.join(dir, name)) }
|
|
20
|
+
extension = names.first =~ /\.(\w+)$/ && $1
|
|
21
|
+
|
|
22
|
+
Hanna::TemplateHelpers.with_no_warnings do
|
|
23
|
+
case extension
|
|
24
|
+
when 'sass'
|
|
25
|
+
Sass::Engine.new(content)
|
|
26
|
+
when 'haml'
|
|
27
|
+
Haml::Engine.new(content, :format => :html4)
|
|
24
28
|
else
|
|
25
|
-
|
|
29
|
+
content
|
|
26
30
|
end
|
|
27
|
-
File.read File.join(dir, name)
|
|
28
|
-
}.join('')
|
|
29
|
-
|
|
30
|
-
case extension
|
|
31
|
-
when 'sass'
|
|
32
|
-
Sass::Engine.new(content)
|
|
33
|
-
when 'haml'
|
|
34
|
-
Haml::Engine.new(content)
|
|
35
|
-
else
|
|
36
|
-
content
|
|
37
31
|
end
|
|
38
32
|
end
|
|
39
33
|
end
|
|
@@ -42,7 +36,7 @@ module RDoc::Generator::HTML::HANNA
|
|
|
42
36
|
|
|
43
37
|
CLASS_PAGE = read('page.haml')
|
|
44
38
|
FILE_PAGE = CLASS_PAGE
|
|
45
|
-
METHOD_LIST = read('method_list.haml', 'sections')
|
|
39
|
+
METHOD_LIST = read('method_list.haml', 'sections.haml')
|
|
46
40
|
|
|
47
41
|
FR_INDEX_BODY = BODY = read('layout.haml')
|
|
48
42
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
module Hanna
|
|
2
|
+
#
|
|
3
|
+
# The version of RDoc that Hanna should use.
|
|
4
|
+
#
|
|
5
|
+
RDOC_VERSION = '2.2.0'
|
|
6
|
+
RDOC_VERSION_REQUIREMENT = "~> #{RDOC_VERSION}"
|
|
7
|
+
|
|
8
|
+
#
|
|
9
|
+
# This method loads the correct version of RDoc. If the correct
|
|
10
|
+
# version of RDoc is not present, this method will terminate the
|
|
11
|
+
# program with a helpful error message.
|
|
12
|
+
#
|
|
13
|
+
def self.require_rdoc
|
|
14
|
+
begin
|
|
15
|
+
gem 'rdoc', RDOC_VERSION_REQUIREMENT
|
|
16
|
+
rescue Gem::LoadError
|
|
17
|
+
$stderr.puts "Error: hanna requires the RDoc #{RDOC_VERSION} gem!"
|
|
18
|
+
exit 1
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
data/lib/hanna/rdoctask.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
require 'hanna/rdoc_version'
|
|
2
|
+
|
|
1
3
|
require 'rake'
|
|
2
4
|
require 'rake/rdoctask'
|
|
3
5
|
|
|
@@ -8,7 +10,7 @@ Rake::RDocTask.class_eval do
|
|
|
8
10
|
# Create the tasks defined by this task lib.
|
|
9
11
|
def define
|
|
10
12
|
unless @template and @template != 'html'
|
|
11
|
-
@template =
|
|
13
|
+
@template = 'hanna'
|
|
12
14
|
end
|
|
13
15
|
# inline source and UTF-8 are defaults:
|
|
14
16
|
options << '--inline-source' unless options.include? '--inline-source' or options.include? '-S'
|
|
@@ -31,14 +33,8 @@ Rake::RDocTask.class_eval do
|
|
|
31
33
|
task name => [rdoc_target]
|
|
32
34
|
file rdoc_target => @rdoc_files + [$rakefile] do
|
|
33
35
|
rm_r @rdoc_dir rescue nil
|
|
34
|
-
|
|
35
|
-
begin
|
|
36
|
-
gem 'rdoc', '~> 2.1.0'
|
|
37
|
-
rescue Gem::LoadError
|
|
38
|
-
$stderr.puts "Couldn't load RDoc 2.1 gem"
|
|
39
|
-
end
|
|
36
|
+
Hanna::require_rdoc
|
|
40
37
|
require 'rdoc/rdoc'
|
|
41
|
-
require 'hanna/rdoc_patch'
|
|
42
38
|
|
|
43
39
|
RDoc::RDoc.new.document(option_list + @rdoc_files)
|
|
44
40
|
end
|
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
%frame{ :name => "Files", :title => "Files", :src => "fr_file_index.html" }
|
|
9
9
|
%frame{ :name => "Classes", :src => "fr_class_index.html" }
|
|
10
10
|
%frame{ :name => "Methods", :src => "fr_method_index.html" }
|
|
11
|
-
%frame{ :name => "docwin", :src => values['initial_page'] }
|
|
11
|
+
%frame{ :name => "docwin", :src => values['initial_page'] }=""
|
|
@@ -1,26 +1,25 @@
|
|
|
1
1
|
!!! strict
|
|
2
2
|
- index = values['list_title']
|
|
3
|
-
%html{ :
|
|
3
|
+
%html{ :lang => "en" }
|
|
4
4
|
%head
|
|
5
|
-
%title=
|
|
5
|
+
%title= values['title']
|
|
6
6
|
%meta{ 'http-equiv' => "Content-Type", :content => "text/html; charset=#{values['charset']}" }
|
|
7
7
|
%link{ :rel => "stylesheet", :href => values["style_url"], :type => "text/css", :media => "screen" }
|
|
8
8
|
- unless index
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
9
|
+
:javascript
|
|
10
|
+
function popupCode(url) {
|
|
11
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
12
|
+
}
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
function toggleCode(id) {
|
|
15
|
+
var code = document.getElementById(id)
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
code.style.display = code.style.display != 'block' ? 'block' : 'none'
|
|
18
|
+
return true
|
|
19
|
+
}
|
|
21
20
|
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
// Make codeblocks hidden by default
|
|
22
|
+
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
|
|
24
23
|
- else
|
|
25
24
|
%base{ :target => 'docwin' }/
|
|
26
25
|
|
|
@@ -58,6 +58,11 @@ a
|
|
|
58
58
|
:background = !light_link
|
|
59
59
|
:text-decoration none
|
|
60
60
|
:color #eef
|
|
61
|
+
|
|
62
|
+
#diagram
|
|
63
|
+
img
|
|
64
|
+
:border = 0
|
|
65
|
+
|
|
61
66
|
#description, .method .description, .header
|
|
62
67
|
a
|
|
63
68
|
:color = !light_link
|
|
@@ -218,7 +223,7 @@ div.header
|
|
|
218
223
|
ol
|
|
219
224
|
:list-style decimal
|
|
220
225
|
li
|
|
221
|
-
:white-space
|
|
226
|
+
:white-space normal
|
|
222
227
|
|
|
223
228
|
#method-list
|
|
224
229
|
:position absolute
|
|
@@ -293,12 +298,7 @@ div.header
|
|
|
293
298
|
:margin 1em
|
|
294
299
|
:padding 0.5em
|
|
295
300
|
:border 1px dashed #999
|
|
296
|
-
:overflow
|
|
297
|
-
|
|
298
|
-
.standalone-code
|
|
299
|
-
:background #221111
|
|
300
|
-
:color #ffdead
|
|
301
|
-
:overflow hidden
|
|
301
|
+
:overflow auto
|
|
302
302
|
|
|
303
303
|
.ruby-constant
|
|
304
304
|
:color #7fffd4
|
|
@@ -336,4 +336,3 @@ div.header
|
|
|
336
336
|
.ruby-value
|
|
337
337
|
:color #7fffd4
|
|
338
338
|
:background transparent
|
|
339
|
-
|
|
@@ -17,12 +17,28 @@ module Hanna
|
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
20
|
+
#
|
|
21
|
+
# We need to suppress warnings before calling into HAML because
|
|
22
|
+
# HAML has lots of uninitialized instance variable accesses.
|
|
23
|
+
#
|
|
24
|
+
def with_no_warnings
|
|
25
|
+
save = $-w
|
|
26
|
+
$-w = false
|
|
27
|
+
|
|
28
|
+
begin
|
|
29
|
+
yield
|
|
30
|
+
ensure
|
|
31
|
+
$-w = save
|
|
32
|
+
end
|
|
33
|
+
end
|
|
34
|
+
module_function :with_no_warnings
|
|
35
|
+
|
|
20
36
|
def debug(text)
|
|
21
37
|
"<pre>#{h YAML::dump(text)}</pre>"
|
|
22
38
|
end
|
|
23
39
|
|
|
24
40
|
def h(html)
|
|
25
|
-
CGI::escapeHTML
|
|
41
|
+
CGI::escapeHTML(html)
|
|
26
42
|
end
|
|
27
43
|
|
|
28
44
|
def methods_from_sections(sections)
|
|
@@ -54,7 +70,7 @@ module Hanna
|
|
|
54
70
|
text = parent ? %[<span class="parent">#{parent}</span>#{name}] : name
|
|
55
71
|
out << '<li>'
|
|
56
72
|
out << (subtree['_href'] ? link_to(text, subtree['_href']) : %[<span class="nodoc">#{text}</span>])
|
|
57
|
-
if subtree.keys.size > 1
|
|
73
|
+
if subtree.keys.size > 1 || (subtree.keys.size == 1 && !subtree['_href'])
|
|
58
74
|
out << "\n<ol>" << render_class_tree(subtree, parent.to_s + name) << "\n</ol>"
|
|
59
75
|
end
|
|
60
76
|
out << '</li>'
|
|
@@ -5,13 +5,18 @@ RDoc::TemplatePage.class_eval do
|
|
|
5
5
|
include Hanna::TemplateHelpers
|
|
6
6
|
|
|
7
7
|
# overwrite the original method
|
|
8
|
+
alias :old_write_html_on :write_html_on # suppresses a warning
|
|
8
9
|
def write_html_on(io, values)
|
|
9
10
|
result = @templates.reverse.inject(nil) do |previous, template|
|
|
10
11
|
case template
|
|
11
12
|
when Haml::Engine
|
|
12
|
-
|
|
13
|
+
with_no_warnings do
|
|
14
|
+
template.to_html(get_binding, :values => values) { previous }
|
|
15
|
+
end
|
|
13
16
|
when Sass::Engine
|
|
14
|
-
|
|
17
|
+
with_no_warnings do
|
|
18
|
+
template.to_css
|
|
19
|
+
end
|
|
15
20
|
when String
|
|
16
21
|
ERB.new(template).result(get_binding(values){ previous })
|
|
17
22
|
when nil
|
metadata
CHANGED
|
@@ -1,34 +1,45 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mislav-hanna
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- "Mislav Marohni\xC4\x87"
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
|
-
cert_chain:
|
|
11
|
-
|
|
12
|
-
date: 2008-05-03 00:00:00 -07:00
|
|
10
|
+
cert_chain:
|
|
11
|
+
date: 2008-09-18 21:00:00 -07:00
|
|
13
12
|
default_executable:
|
|
14
13
|
dependencies:
|
|
15
14
|
- !ruby/object:Gem::Dependency
|
|
16
15
|
name: rdoc
|
|
16
|
+
type: :runtime
|
|
17
17
|
version_requirement:
|
|
18
18
|
version_requirements: !ruby/object:Gem::Requirement
|
|
19
19
|
requirements:
|
|
20
20
|
- - ~>
|
|
21
21
|
- !ruby/object:Gem::Version
|
|
22
|
-
version: 2.
|
|
22
|
+
version: 2.2.0
|
|
23
23
|
version:
|
|
24
24
|
- !ruby/object:Gem::Dependency
|
|
25
25
|
name: haml
|
|
26
|
+
type: :runtime
|
|
27
|
+
version_requirement:
|
|
28
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - ~>
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: "2.0"
|
|
33
|
+
version:
|
|
34
|
+
- !ruby/object:Gem::Dependency
|
|
35
|
+
name: echoe
|
|
36
|
+
type: :development
|
|
26
37
|
version_requirement:
|
|
27
38
|
version_requirements: !ruby/object:Gem::Requirement
|
|
28
39
|
requirements:
|
|
29
40
|
- - ">="
|
|
30
41
|
- !ruby/object:Gem::Version
|
|
31
|
-
version:
|
|
42
|
+
version: "0"
|
|
32
43
|
version:
|
|
33
44
|
description: Hanna is an RDoc template that scales. It's implemented in Haml, making its source clean and maintainable. It's built with simplicity, beauty and ease of browsing in mind.
|
|
34
45
|
email: mislav.marohnic@gmail.com
|
|
@@ -36,35 +47,53 @@ executables:
|
|
|
36
47
|
- hanna
|
|
37
48
|
extensions: []
|
|
38
49
|
|
|
39
|
-
extra_rdoc_files:
|
|
40
|
-
|
|
41
|
-
files:
|
|
42
|
-
- README.markdown
|
|
43
|
-
- Rakefile
|
|
44
|
-
- bin
|
|
50
|
+
extra_rdoc_files:
|
|
45
51
|
- bin/hanna
|
|
46
|
-
-
|
|
47
|
-
- lib/hanna.rb
|
|
48
|
-
- lib/hanna
|
|
49
|
-
- lib/hanna/
|
|
50
|
-
- lib/hanna/
|
|
51
|
-
- lib/hanna/
|
|
52
|
-
- lib/hanna/template_files
|
|
52
|
+
- README.markdown
|
|
53
|
+
- lib/hanna/template_page_patch.rb
|
|
54
|
+
- lib/hanna/rdoc_version.rb
|
|
55
|
+
- lib/hanna/template_helpers.rb
|
|
56
|
+
- lib/hanna/template_files/method_list.haml
|
|
57
|
+
- lib/hanna/template_files/styles.sass
|
|
53
58
|
- lib/hanna/template_files/class_index.haml
|
|
54
|
-
- lib/hanna/template_files/file_index.haml
|
|
55
|
-
- lib/hanna/template_files/index.haml
|
|
56
59
|
- lib/hanna/template_files/layout.haml
|
|
57
|
-
- lib/hanna/template_files/
|
|
60
|
+
- lib/hanna/template_files/index.haml
|
|
58
61
|
- lib/hanna/template_files/page.haml
|
|
59
62
|
- lib/hanna/template_files/sections.haml
|
|
60
|
-
- lib/hanna/template_files/
|
|
61
|
-
- lib/hanna/
|
|
63
|
+
- lib/hanna/template_files/file_index.haml
|
|
64
|
+
- lib/hanna/rdoctask.rb
|
|
65
|
+
- lib/hanna/hanna.rb
|
|
66
|
+
- lib/hanna.rb
|
|
67
|
+
files:
|
|
68
|
+
- hanna.gemspec
|
|
69
|
+
- bin/hanna
|
|
70
|
+
- README.markdown
|
|
71
|
+
- Manifest
|
|
62
72
|
- lib/hanna/template_page_patch.rb
|
|
73
|
+
- lib/hanna/rdoc_version.rb
|
|
74
|
+
- lib/hanna/template_helpers.rb
|
|
75
|
+
- lib/hanna/template_files/method_list.haml
|
|
76
|
+
- lib/hanna/template_files/styles.sass
|
|
77
|
+
- lib/hanna/template_files/class_index.haml
|
|
78
|
+
- lib/hanna/template_files/layout.haml
|
|
79
|
+
- lib/hanna/template_files/index.haml
|
|
80
|
+
- lib/hanna/template_files/page.haml
|
|
81
|
+
- lib/hanna/template_files/sections.haml
|
|
82
|
+
- lib/hanna/template_files/file_index.haml
|
|
83
|
+
- lib/hanna/rdoctask.rb
|
|
84
|
+
- lib/hanna/hanna.rb
|
|
85
|
+
- lib/hanna.rb
|
|
86
|
+
- Rakefile
|
|
63
87
|
has_rdoc: false
|
|
64
88
|
homepage: http://github.com/mislav/hanna
|
|
65
89
|
post_install_message:
|
|
66
|
-
rdoc_options:
|
|
67
|
-
|
|
90
|
+
rdoc_options:
|
|
91
|
+
- --line-numbers
|
|
92
|
+
- --inline-source
|
|
93
|
+
- --title
|
|
94
|
+
- Hanna
|
|
95
|
+
- --main
|
|
96
|
+
- README.markdown
|
|
68
97
|
require_paths:
|
|
69
98
|
- lib
|
|
70
99
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
@@ -75,13 +104,13 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
75
104
|
version:
|
|
76
105
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
77
106
|
requirements:
|
|
78
|
-
- - "
|
|
107
|
+
- - "="
|
|
79
108
|
- !ruby/object:Gem::Version
|
|
80
|
-
version: "
|
|
109
|
+
version: "1.2"
|
|
81
110
|
version:
|
|
82
111
|
requirements: []
|
|
83
112
|
|
|
84
|
-
rubyforge_project:
|
|
113
|
+
rubyforge_project: hanna
|
|
85
114
|
rubygems_version: 1.2.0
|
|
86
115
|
signing_key:
|
|
87
116
|
specification_version: 2
|
data/lib/hanna/rdoc_patch.rb
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
require 'rdoc/generator/html'
|
|
2
|
-
|
|
3
|
-
# RDoc 2.0.0 is inflexible in a way that it doesn't handle absolute paths for
|
|
4
|
-
# templates well. We fix that by catching an NameError in load_html_template:
|
|
5
|
-
RDoc::Generator::HTML.class_eval do
|
|
6
|
-
private
|
|
7
|
-
alias :load_html_template_original :load_html_template
|
|
8
|
-
|
|
9
|
-
def load_html_template
|
|
10
|
-
load_html_template_original
|
|
11
|
-
rescue NameError => e
|
|
12
|
-
raise unless e.message.index(@options.template.upcase)
|
|
13
|
-
name = File.basename(@options.template).sub(/\.rb$/, '')
|
|
14
|
-
klass = name.split('_').map{ |n| n.capitalize }.join
|
|
15
|
-
@options.template_class = @template = RDoc::Generator::HTML::const_get(klass)
|
|
16
|
-
end
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
# Don't ask. This works around a bug in Markup where it tries to call
|
|
20
|
-
# HTML.gen_url, but RDoc::Markup::ToHtml::HTML doesn't exist. (What were they
|
|
21
|
-
# thinking, I don't know.)
|
|
22
|
-
RDoc::Markup::ToHtml.const_set :HTML, RDoc::Generator
|