hanna 0.1.12 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG +113 -0
  3. data/LICENSE +20 -0
  4. data/README.rdoc +63 -0
  5. data/lib/hanna/template_files/class_index.erb +4 -0
  6. data/lib/hanna/template_files/file_index.erb +9 -0
  7. data/lib/hanna/template_files/index.erb +15 -0
  8. data/lib/hanna/template_files/layout.erb +35 -0
  9. data/lib/hanna/template_files/method_index.erb +11 -0
  10. data/lib/hanna/template_files/method_list.erb +58 -0
  11. data/lib/hanna/template_files/method_search.js +41 -59
  12. data/lib/hanna/template_files/page.erb +48 -0
  13. data/lib/hanna/template_files/sections.erb +92 -0
  14. data/lib/hanna/template_files/styles.css +369 -0
  15. data/lib/hanna.rb +300 -1
  16. data/lib/rdoc/discover.rb +1 -0
  17. metadata +95 -90
  18. data/README.markdown +0 -102
  19. data/Rakefile +0 -4
  20. data/bin/hanna +0 -81
  21. data/lib/hanna/hanna.rb +0 -48
  22. data/lib/hanna/rdoctask.rb +0 -42
  23. data/lib/hanna/template_files/class_index.haml +0 -3
  24. data/lib/hanna/template_files/file_index.haml +0 -12
  25. data/lib/hanna/template_files/index.haml +0 -11
  26. data/lib/hanna/template_files/layout.haml +0 -34
  27. data/lib/hanna/template_files/method_index.haml +0 -13
  28. data/lib/hanna/template_files/method_list.haml +0 -37
  29. data/lib/hanna/template_files/page.haml +0 -50
  30. data/lib/hanna/template_files/prototype-1.6.0.3.js +0 -4320
  31. data/lib/hanna/template_files/sections.haml +0 -83
  32. data/lib/hanna/template_files/styles.sass +0 -364
  33. data/lib/hanna/template_helpers.rb +0 -119
  34. data/lib/hanna/template_page_patch.rb +0 -38
  35. data/lib/hanna/version.rb +0 -19
  36. data/lib/rubygems_plugin.rb +0 -28
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: '079ac57437e1a0f17ae7a0279551cd6cedd63226d89525bd083bd6efb1dfaf7a'
4
+ data.tar.gz: 678ead6e236b87db78ccd70926f1ecd8258da4edc1125146eb46b6db6f8fc6a6
5
+ SHA512:
6
+ metadata.gz: 45a89b66830d20ef83807ec53435bd0bf4c3d7997472ac8c2443efad186f1a251ea4efc6f49830e4cad0c96b7d04b62d083be6b7364dcb220060548e89495bf9
7
+ data.tar.gz: 608848deaf4abd6b421e122f1428ab5b9c4778513cebbe4770dbbf491e3c953c8913b33cd0552bc97a9943f9ca4a0a209005b0dfca94f20bf038a332b534a4f4
data/CHANGELOG ADDED
@@ -0,0 +1,113 @@
1
+ # 1.5.0 (2023-08-10)
2
+
3
+ * Rename back to hanna, after mislav granted access to the name (jeremyevans)
4
+
5
+ # 1.4.0 (2023-01-10)
6
+
7
+ * Improve style for mobile devices (janko) (#18, #19)
8
+
9
+ # 1.3.0 (2022-06-27)
10
+
11
+ * Use details/summary for class index (jeremyevans)
12
+
13
+ * Optimize render_class_tree, and avoid creation of O(n^2) regexps (jeremyevans)
14
+
15
+ * Use target="_top" for https links as well as http links (jeremyevans)
16
+
17
+ # 1.2.0 (2021-12-23)
18
+
19
+ * Remove dependency on haml, by switching to stdlib erb (jeremyevans)
20
+
21
+ * Remove use of prototype.js for the method index, switching to plain javascript (jeremyevans)
22
+
23
+ # 1.1.0 (2021-12-15)
24
+
25
+ * Remove dependency on sass, by converting the stylesheet to CSS (jeremyevans)
26
+
27
+ * Avoid Ruby verbose mode warnings (jeremyevans)
28
+
29
+ # 1.0.4 (2020-06-24)
30
+
31
+ * Avoid whitespace between method name and argument list (jeremyevans)
32
+
33
+ # 1.0.3 (2018-02-15)
34
+
35
+ * Avoid using deprecated sass color operators (jeremyevans)
36
+
37
+ # 1.0.2 (2017-07-01)
38
+
39
+ * Handle documenting BasicObject (jeremyevans)
40
+
41
+ # 1.0.1 (2016-10-12)
42
+
43
+ * Remove unneeded and harmful target="docwin" from links (jeremyevans)
44
+
45
+ # 1.0.0 (2016-09-21)
46
+
47
+ * Support haml 4+ and rdoc 5+ (jeremyevans)
48
+
49
+ * Remove no longer needed override of parseable? in rdoc (jeremyevans)
50
+
51
+ # 0.4.2 (2014-11-26)
52
+
53
+ * Use ruby's built-in syntax parser instead of parser gem to check for valid syntax (jeremyevans)
54
+
55
+ # 0.4.1 (2014-08-29)
56
+
57
+ * Update syntax highlighting color for comments and strings (jeremyevans)
58
+
59
+ # 0.4.0 (2014-08-19)
60
+
61
+ * Add parser as a dependency for checking for valid Ruby syntax (jeremyevans)
62
+
63
+ * Use table instead of dl for better styling of label/note lists (jeremyevans)
64
+
65
+ * Syntax highlight ruby code blocks, not just method source (jeremyevans)
66
+
67
+ # 0.3.0 (2014-06-18)
68
+
69
+ * Show superclass instead of parent for classes (Quintus, jeremyevans)
70
+
71
+ * Add support for RDoc 4 (Atsushi Nagase, jeremyevans)
72
+
73
+ # 0.2.7 (2013-03-23)
74
+
75
+ * Remove duplicate entries from method index (jeremyevans)
76
+
77
+ * Fix attribute links (jeremyevans)
78
+
79
+ # 0.2.6 (2013-03-01)
80
+
81
+ * Fix homepage in gem (erikh)
82
+
83
+ # 0.2.5 (2013-03-01)
84
+
85
+ * Restrict rdoc version in gem to ~> 3.1, since the gem doesn't work with RDoc 4 (jeremyevans)
86
+
87
+ # 0.2.4 (2011-07-24)
88
+
89
+ * Respect markup in section comments (jeremyevans)
90
+
91
+ * Fix class/singleton attribute anchors (jeremyevans)
92
+
93
+ * Work with RDoc 3.8+ (jeremyevans)
94
+
95
+ * Support RDoc sections (jeremyevans)
96
+
97
+ * Automatically link classes, modules, included modules, and attributes (jeremyevans)
98
+
99
+ # 0.2.3 (2011-05-12)
100
+
101
+ * Sort method, aliases, and attribute lists (jeremyevans)
102
+
103
+ # 0.2.2 (2010-12-28)
104
+
105
+ * Work with RDoc 3.1+ (erikh)
106
+
107
+ # 0.2.1 (2010-12-23)
108
+
109
+ * Rename internal files to hanna-nouveau (erikh)
110
+
111
+ # 0.2.0 (2010-12-23)
112
+
113
+ * Initial release
data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Mislav Marohnić
2
+ Copyright (c) 2010, 2011 Erik Hollensbe
3
+ Copyright (c) 2011-2023 Jeremy Evans
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.rdoc ADDED
@@ -0,0 +1,63 @@
1
+ = Hanna
2
+
3
+ Hanna is an RDoc generator built with simplicity, beauty
4
+ and ease of browsing in mind.
5
+
6
+ == Installation
7
+
8
+ gem install hanna
9
+
10
+ == Usage
11
+
12
+ rdoc -o doc -f hanna lib
13
+
14
+ An alternative is to set the `RDOCOPT` environment variable:
15
+
16
+ RDOCOPT="-f hanna"
17
+
18
+ This will make RDoc always use hanna unless it is explicitly overridden.
19
+
20
+ == Integrating with RubyGems
21
+
22
+ If you put the following line in your .gemrc, this will make
23
+ RubyGems use Hanna for all rdoc generation:
24
+
25
+ rdoc: -f hanna
26
+
27
+ After doing this, if you wish to have documentation for all your installed gems
28
+ to be formatted in hanna:
29
+
30
+ gem rdoc --all --overwrite
31
+
32
+ == Rake task
33
+
34
+ For repeated generation of API docs, you can set up a Rake task. Set
35
+ hanna as the RDoc generator:
36
+
37
+ require 'rdoc/task'
38
+ RDoc::Task.new do |rdoc|
39
+ rdoc.generator = 'hanna'
40
+ end
41
+
42
+ == Modification to RDoc
43
+
44
+ Hanna makes a small modification to RDoc to generate more
45
+ friendly documentation. It changes label lists to use a table
46
+ instead of a description list, since it is very difficult to
47
+ get visually appealing styling for description lists without
48
+ cutting corners (like using fixed widths).
49
+
50
+ == Contributors
51
+
52
+ The Hanna template was created by {Mislav}[http://mislav.uniqpath.com/] and
53
+ since then has seen contributions from:
54
+
55
+ 1. {Tony Strauss}[https://github.com/DesigningPatterns], who participated from
56
+ the early start and made tons of fixes and enhancements to the template.
57
+ 2. {Michael Granger}[https://github.com/ged] who maintained the original RDoc template.
58
+ 3. {Hongli Lai}[https://blog.phusion.nl/] with the search filter for methods.
59
+ 4. {Erik Hollensbe}[https://github.com/erikh] a serious refactoring and up to
60
+ date with RDoc 2.5.x and 3.x, now named 'hanna-nouveau'.
61
+ 5. {James Tucker}[https://github.com/raggi] minor cleanups and RubyGems integration
62
+ 6. {Jeremy Evans}[https://github.com/jeremyevans] RDoc 4+ support, switch from
63
+ haml/sass to erb, maintenance since 2014.
@@ -0,0 +1,4 @@
1
+ <h1><%=h values[:list_title] %></h1>
2
+ <div class='classes' id='index-entries'>
3
+ <%= render_class_tree(values[:classes].select{|x| x.full_name !~ /::/}) %>
4
+ </div>
@@ -0,0 +1,9 @@
1
+ <h1>File Index</h1><% any_hidden = false %>
2
+ <ol class='files' id='index-entries'>
3
+ <% values[:files].each do |file|
4
+ hide = file.name =~ /\.rb$/
5
+ any_hidden = true if hide %><li<%= " class='other'" if hide %>><%= link_to(file.name, file.path) %></li>
6
+ <% end %><% if any_hidden %><li>
7
+ <a class='show' href='#' onclick='this.parentNode.parentNode.className += &quot; expanded&quot;; this.parentNode.removeChild(this); return false'>show all</a>
8
+ </li><% end %>
9
+ </ol>
@@ -0,0 +1,15 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">
2
+ <html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'>
3
+ <head>
4
+ <title><%=h @options.title %></title>
5
+ <meta content='text/html; charset=<%=h @options.charset %>' http-equiv='Content-Type'>
6
+ </head>
7
+ <frameset border='1' bordercolor='gray' cols='20%, *' frameborder='1'>
8
+ <frameset rows='15%, 35%, 50%'>
9
+ <frame name='Files' src='fr_file_index.html' title='Files'>
10
+ <frame name='Classes' src='fr_class_index.html'>
11
+ <frame name='Methods' src='fr_method_index.html'>
12
+ </frameset>
13
+ <frame name='docwin' src='<%=h @main_page_uri %>'></frame>
14
+ </frameset>
15
+ </html>
@@ -0,0 +1,35 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><% values = values[:values]; index = values[:list_title] %>
2
+ <html lang='en'>
3
+ <head>
4
+ <title><%= h(values[:title]) if values[:title] %></title>
5
+ <meta name='viewport' content='width=device-width, initial-scale=1'>
6
+ <meta content='text/html; charset=<%=h @options.charset %>' http-equiv='Content-Type'>
7
+ <link href='<%=h values[:stylesheet] %>' media='screen' rel='stylesheet' type='text/css'>
8
+ <% if index %><base target='docwin'>
9
+ <% else %><script type='text/javascript'>
10
+ function popupCode(url) {
11
+ window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
12
+ }
13
+
14
+ function toggleCode(id) {
15
+ var code = document.getElementById(id)
16
+
17
+ code.style.display = code.style.display != 'block' ? 'block' : 'none'
18
+ return true
19
+ }
20
+
21
+ // Make codeblocks hidden by default
22
+ document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
23
+ </script>
24
+ <% end %></head>
25
+ <body class='<%= index ? 'list' : 'page' %>'>
26
+ <% if index %><div id='index'><%= yield %></div>
27
+ <% else %><div class='<%= values[:classmod] ? 'class' : 'file' %>' id='wrapper'>
28
+ <%= yield %>
29
+ <div id='footer-push'></div>
30
+ </div>
31
+ <div id='footer'>
32
+ <a href="https://github.com/jeremyevans/hanna"><strong>Hanna</strong> RDoc template</a>
33
+ </div>
34
+ <% end %></body>
35
+ </html>
@@ -0,0 +1,11 @@
1
+ <h1><%=h values[:list_title] %></h1>
2
+ <form id='search_form'>
3
+ <input autocomplete='off' class='untouched' id='search' placeholder='Enter search terms...' type='text'>
4
+ <span class='clear_button' id='clear_button'>
5
+ x
6
+ </span>
7
+ </form>
8
+ <ol class='methods' id='index-entries'>
9
+ <% (values[:attributes] + values[:methods]).uniq.each do |entry| %><li><%= link_to_method(entry, [classfile(entry.parent), entry.aref].join('#')) %></li>
10
+ <% end %></ol>
11
+ <script src='method_search.js' type='text/javascript'></script>
@@ -0,0 +1,58 @@
1
+ <%
2
+ values = values[:values] if values[:values]
3
+ entry = values[:entry]
4
+ sections = values[:sections].keys if values.has_key?(:sections)
5
+ methods = entry.method_list + entry.attributes
6
+ unless methods.empty? %><div id='method-list'>
7
+ <h2>Methods</h2>
8
+ <% %w[attr attr_accessor attr_reader attr_writer class instance].each do |type|
9
+ (RDoc::VISIBILITIES rescue RDoc::Context::VISIBILITIES).each do |vis|
10
+ list = methods.reject { |x| x.respond_to?(:is_alias_for) && x.is_alias_for }.select { |x| x.visibility == vis && x.type == type.to_s }.sort
11
+ next if list.empty?
12
+ type_result = ""
13
+ if type =~ /^attr_/
14
+ type_result += type.sub(/^attr_/, '').capitalize
15
+ else
16
+ type_result += type.capitalize
17
+ end
18
+ type_result = "#{vis.to_s.capitalize} #{type_result}"
19
+ %><h3><%=h type_result %></h3>
20
+ <ol>
21
+ <%
22
+ list.each do |method|
23
+ if method.respond_to?(:aref)
24
+ if method.name.to_s.empty? && method.call_seq %><li><%= link_to(method.call_seq.gsub(/<br\s*\/?>/, "").split(/[\r\n]+/).map{ |s| s.split(/([({]+|\[\{|\s+(#?=>|&rarr;)\s+)/).first.sub(/^[A-Za-z0-9_:]+\./, "").sub(/\s+=\s+.*/, "=").strip }.uniq.join("<br />\n"), '#' + method.aref) %></li>
25
+ <% else %><li><%= link_to(method.name, '#' + method.aref) %></li>
26
+ <% end
27
+ elsif method.respond_to?(:html_name) %><li><%= link_to(method.name, "#method-#{method.html_name}") %></li>
28
+ <% else %><li><%=h method.name %></li>
29
+ <% end
30
+ end %></ol>
31
+ <% end
32
+ end %></div>
33
+ <%
34
+ end
35
+ if entry.requires or sections or entry.includes %><div id='context'>
36
+ <% unless entry.requires.empty? %><div id='requires'>
37
+ <h2>Required files</h2>
38
+ <ol>
39
+ <% entry.requires.each do |req| %><li><%=h req.name %></li>
40
+ <% end %></ol>
41
+ </div>
42
+ <% end
43
+ if sections && (sections.length > 1 || sections.first.title.to_s != '')
44
+ %><div id='contents'>
45
+ <h2>Contents</h2>
46
+ <ol>
47
+ <% sections.sort_by{|s| s.title.to_s}.each do |section| %><li><%= link_to(section.title, "##{section.aref}") %></li>
48
+ <% end %></ol>
49
+ </div>
50
+ <% end
51
+ unless entry.includes.empty?
52
+ %><div id='includes'>
53
+ <h2>Included modules</h2>
54
+ <ol>
55
+ <% entry.includes.each do |inc| %><li><%= (mod = inc.module).is_a?(String) ? h(inc.name) : link_to(inc.name, entry.aref_to(mod.path)) %></li>
56
+ <% end %></ol>
57
+ </div>
58
+ <% end %></div><% end %>
@@ -1,63 +1,45 @@
1
- $(document).observe('dom:loaded', function() {
2
- // Setup search-during-typing.
3
- new Form.Element.Observer('search', 0.3, function(element, value) {
4
- performSearch();
5
- });
6
-
7
- // Remove the default search box value when the user puts the focus on
8
- // the search box for the first time.
9
- var search_box = $('search');
10
- if ($F('search') == 'Enter search terms...') {
11
- search_box.observe('focus', function() {
12
- if (search_box.hasClassName('untouched')) {
13
- search_box.removeClassName('untouched');
14
- search_box.value = '';
15
- }
16
- });
17
- } else {
18
- search_box.removeClassName('untouched');
19
- }
20
-
21
- search_box.insert({
22
- after: new Element('span', { 'class': 'clear_button' }).update('x').observe('click', function(e) {
23
- e.stopPropagation()
24
- search_box.setValue('')
25
- search_box.focus()
26
- })
27
- })
28
- });
29
-
30
- function searchInIndex(query) {
31
- var i;
32
- var results = [];
33
- query = query.toLowerCase();
34
- for (i = 0; i < search_index.length; i++) {
35
- if (search_index[i].method.indexOf(query) != -1) {
36
- results.push(search_index[i]);
37
- }
38
- }
39
- return results;
40
- }
1
+ var search_box = document.getElementById('search');
2
+ var search_timeout;
3
+ var search_value = search_box.value;
41
4
 
42
- function buildHtmlForResults(results) {
43
- var html = "";
44
- var i;
45
- for (i = 0; i < results.length; i++) {
46
- html += '<li>' + results[i].html + '</li>';
47
- }
48
- return html;
49
- }
5
+ function performSearch(e) {
6
+ if (e) {
7
+ e.preventDefault();
8
+ }
9
+ if (search.value === search_value) {
10
+ return;
11
+ }
12
+ search_value = search_box.value;
50
13
 
51
- function performSearch() {
52
- var query = $F('search');
53
- if (query == '') {
54
- $('index-entries').show();
55
- $('search-results').hide();
14
+ if (search_value == '') {
15
+ document.querySelectorAll("#index-entries li.hide").forEach(elem => {
16
+ elem.classList.remove('hide');
17
+ });
56
18
  } else {
57
- var results = searchInIndex(query);
58
- $('search-results').update(buildHtmlForResults(results));
59
- $('index-entries').hide();
60
- $('search-results').show();
61
- }
62
- return false;
19
+ document.querySelectorAll("#index-entries span.method_name").forEach(elem => {
20
+ var value = elem.getAttribute('value');
21
+ var li_classes = elem.parentElement.parentElement.classList;
22
+ if (value && value.includes(search_value)) {
23
+ li_classes.remove('hide');
24
+ } else {
25
+ li_classes.add('hide');
26
+ }
27
+ });
28
+ }
63
29
  }
30
+
31
+ document.getElementById('search_form').onsubmit = performSearch;
32
+
33
+ search.oninput = function(e) {
34
+ if (search_timeout) {
35
+ clearTimeout(search_timeout);
36
+ }
37
+ search_timeout = setTimeout(performSearch, 300);
38
+ };
39
+
40
+ document.getElementById('clear_button').onclick = function(e) {
41
+ e.stopPropagation();
42
+ search_box.value = '';
43
+ performSearch();
44
+ search_box.focus();
45
+ };
@@ -0,0 +1,48 @@
1
+ <%
2
+ values = values[:values] if values[:values]
3
+ file_page = !values[:classmod]
4
+ title_in_description = values[:entry].description && values[:entry].description =~ /^\s*<h1>/m
5
+ %><div class='header'>
6
+ <%
7
+ title = if file_page
8
+ h(values[:file].name)
9
+ else
10
+ "<span class='type'>#{values[:classmod]}</span>\n#{h values[:entry].full_name}"
11
+ end
12
+
13
+ if title_in_description %><div class='name'><%= title %></div>
14
+ <% else %><h1 class='name'><%= title %>
15
+ </h1>
16
+ <% end
17
+
18
+ if file_page %><div class='paths'>
19
+ <%=h values[:file].relative_name %>
20
+ </div>
21
+ <% else %><ol class='paths'>
22
+ <% values[:entry].in_files.each_with_index do |file, index| %><li<%= " class='other'" if index > 0 %>>
23
+ <%= link_to(file.full_name, Pathname.new(file.path).relative_path_from(Pathname.new(values[:entry].path).dirname)) %>
24
+ </li>
25
+ <% end
26
+ if values[:entry].in_files.size > 1 %><li>
27
+ <a class='show' href='#' onclick='this.parentNode.parentNode.className += &quot; expanded&quot;; this.parentNode.removeChild(this); return false'>show all</a>
28
+ </li>
29
+ <% end %></ol>
30
+ <% end
31
+
32
+ if !file_page && values[:entry].type == "class" %><div class='parent'>
33
+ Superclass:
34
+ <strong><%= (values[:entry].superclass.kind_of?(String) || !values[:entry].superclass) ? h(values[:entry].superclass) : link_to(values[:entry].superclass.name, Pathname.new(class_dir) + Pathname.new(values[:entry].superclass.path).relative_path_from(Pathname.new values[:entry].path)) %></strong>
35
+ </div>
36
+ <% end
37
+
38
+ if values[:entry].respond_to?(:last_modified) and values[:entry].last_modified %><div class='last-update'>
39
+ Last Update:
40
+ <span class='datetime'><%=h values[:entry].last_modified %></span>
41
+ </div>
42
+ <% end %></div>
43
+ <div id='content'>
44
+ <div id='text'>
45
+ <% if values[:description] %><div id='description'><%= frame_link(values[:description]) %></div>
46
+ <% end %><%= frame_link(block.call) %>
47
+ </div>
48
+ </div>
@@ -0,0 +1,92 @@
1
+ <%
2
+ values = values[:values] if values[:values]
3
+ unless values[:entry].classes_and_modules.empty? %><div id='class-list'>
4
+ <h2>Classes and Modules</h2>
5
+ <ol>
6
+ <% (values[:entry].modules.sort + values[:entry].classes.sort).each do |mod| %><li><%= link_to(mod.full_name, values[:entry].aref_to(mod.path)) %></li>
7
+ <% end %></ol>
8
+ </div>
9
+ <% end
10
+
11
+ values[:sections].sort_by{|s, h| s.title.to_s}.each do |section, h|
12
+ constants, attributes, alias_types, method_types = h.values_at(:constants, :attributes, :alias_types, :method_types)
13
+ %><div id='section'>
14
+ <% if section.title.to_s != '' %><h2>
15
+ <a name='<%=h section.aref %>'><%=h section.title %></a>
16
+ <% if section.comment %><div class='section-comment'><%= section.description %></div>
17
+ <% end %></h2>
18
+ <% end
19
+ unless constants.empty? %><div id='constants-list'>
20
+ <h2>Constants</h2>
21
+ <div class='name-list'>
22
+ <table summary='Constants'>
23
+ <% constants.each do |const| %><tr class='top-aligned-row context-row'>
24
+ <td class='context-item-name'><%= const.name %></td>
25
+ <td>=</td>
26
+ <td class='context-item-value'><%= const.value %></td>
27
+ <% if const.description %><td>&nbsp;</td>
28
+ <td class='context-item-desc'><%= const.description %></td>
29
+ <% end %></tr>
30
+ <% end %></table>
31
+ </div>
32
+ </div>
33
+ <% end
34
+ unless alias_types.empty?
35
+ alias_types.each do |type, aliases|
36
+ %><div id='aliases-list'>
37
+ <h2><%= type %> Aliases</h2>
38
+ <div class='name-list'>
39
+ <table summary='<%= type %> Aliases'>
40
+ <% aliases.each do |alia| %><tr class='top-aligned-row context-row'>
41
+ <td class='context-item-name'><%= alia.name %></td>
42
+ <td>-&gt;</td>
43
+ <td class='context-item-value'><%= link_to(alia.is_alias_for.name, "##{alia.is_alias_for.aref}") %></td>
44
+ <% unless alia.description.empty? %><td class='context-item-desc'><%= alia.description %></td>
45
+ <% end %></tr>
46
+ <% end %></table>
47
+ </div>
48
+ </div>
49
+ <% end
50
+ end
51
+ unless attributes.empty? %><div id='attribute-list'>
52
+ <h2 class='section-bar'>Attributes</h2>
53
+ <div class='name-list'>
54
+ <table>
55
+ <% attributes.each do |attrib| %><tr class='top-aligned-row context-row'>
56
+ <td class='context-item-name'>
57
+ <a name='<%=h attrib.aref %>'><%= attrib.name %></a>
58
+ </td>
59
+ <td class='context-item-value'><%= attrib.rw ? "[#{attrib.rw}]" : '&nbsp;' %></td>
60
+ <td class='context-item-desc'><%= attrib.description %></td>
61
+ </tr>
62
+ <% end %></table>
63
+ </div>
64
+ </div>
65
+ <% end
66
+ unless method_types.empty? %><div id='methods'>
67
+ <% method_types.each do |type, list| next if list.empty? %><h2><%= type %> methods</h2>
68
+ <% list.each do |method| %><div class='method <%= "#{type.gsub(/\s+/, '-')}".downcase %>' id='method-<%= method.aref %>'>
69
+ <a name='<%= method.aref %>'></a>
70
+ <div class='synopsis'>
71
+ <% if method.call_seq %><span class='name'>
72
+ <% method.call_seq.split(/\r?\n/).each do |seq| %><div><%= seq %></div>
73
+ </span>
74
+ <% end
75
+ else %><span class='name'><%= method.name %></span><span class='arguments'><%= method.params %></span>
76
+
77
+ <% end %></div>
78
+ <% if method.description %><div class='description'>
79
+ <%= method.description %>
80
+ </div>
81
+ <% end
82
+ if method.markup_code
83
+ name = "#{method.aref}-source" %><div class='source'>
84
+ <a class='source-toggle' href='#' onclick='toggleCode(&#39;<%= name %>&#39;); return false'>
85
+ [show source]
86
+ </a>
87
+ <pre id='<%= name %>'><%= method.markup_code %></pre>
88
+ </div>
89
+ <% end %></div>
90
+ <% end
91
+ end %></div>
92
+ <% end %></div><% end %>