hanna-nouveau 1.0.4 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +105 -0
- data/LICENSE +1 -1
- data/README.rdoc +22 -46
- data/lib/hanna-nouveau/template_files/class_index.erb +4 -0
- data/lib/hanna-nouveau/template_files/file_index.erb +9 -0
- data/lib/hanna-nouveau/template_files/index.erb +15 -0
- data/lib/hanna-nouveau/template_files/layout.erb +34 -0
- data/lib/hanna-nouveau/template_files/method_index.erb +11 -0
- data/lib/hanna-nouveau/template_files/method_list.erb +58 -0
- data/lib/hanna-nouveau/template_files/method_search.js +41 -59
- data/lib/hanna-nouveau/template_files/page.erb +48 -0
- data/lib/hanna-nouveau/template_files/sections.erb +92 -0
- data/lib/hanna-nouveau/template_files/styles.css +353 -0
- data/lib/hanna-nouveau.rb +111 -161
- metadata +28 -29
- data/Rakefile +0 -13
- data/VERSION +0 -1
- data/lib/hanna-nouveau/template_files/class_index.haml +0 -3
- data/lib/hanna-nouveau/template_files/file_index.haml +0 -12
- data/lib/hanna-nouveau/template_files/index.haml +0 -11
- data/lib/hanna-nouveau/template_files/layout.haml +0 -34
- data/lib/hanna-nouveau/template_files/method_index.haml +0 -13
- data/lib/hanna-nouveau/template_files/method_list.haml +0 -56
- data/lib/hanna-nouveau/template_files/page.haml +0 -48
- data/lib/hanna-nouveau/template_files/prototype-1.6.0.3.js +0 -4320
- data/lib/hanna-nouveau/template_files/sections.haml +0 -88
- data/lib/hanna-nouveau/template_files/styles.sass +0 -370
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 618aada01805b659609dcabd6e8c099dd467bdfa0d246061ea805f95b56f709b
|
4
|
+
data.tar.gz: bc0abba0135a0abb07f3066ec7516b0766443956769bb5737ab9f4a48a639e58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0c5a7ce4269b1f81e05f6f2586a99967c75aaecb8f0904c37a873216542674aab5f6f30d1aef0be46a5e75921cd27757074eea42b5dab86eb737ab0657281fbd
|
7
|
+
data.tar.gz: bedd7d8efa55a9f60c5a0ab2935a14071ba93cb03457245a782eef618d87c6d485f30a9f5af06390188e66034f65ca8a0b866c09847b95cdc386caa93960396d
|
data/CHANGELOG
ADDED
@@ -0,0 +1,105 @@
|
|
1
|
+
# 1.3.0 (2022-06-27)
|
2
|
+
|
3
|
+
* Use details/summary for class index (jeremyevans)
|
4
|
+
|
5
|
+
* Optimize render_class_tree, and avoid creation of O(n^2) regexps (jeremyevans)
|
6
|
+
|
7
|
+
* Use target="_top" for https links as well as http links (jeremyevans)
|
8
|
+
|
9
|
+
# 1.2.0 (2021-12-23)
|
10
|
+
|
11
|
+
* Remove dependency on haml, by switching to stdlib erb (jeremyevans)
|
12
|
+
|
13
|
+
* Remove use of prototype.js for the method index, switching to plain javascript (jeremyevans)
|
14
|
+
|
15
|
+
# 1.1.0 (2021-12-15)
|
16
|
+
|
17
|
+
* Remove dependency on sass, by converting the stylesheet to CSS (jeremyevans)
|
18
|
+
|
19
|
+
* Avoid Ruby verbose mode warnings (jeremyevans)
|
20
|
+
|
21
|
+
# 1.0.4 (2020-06-24)
|
22
|
+
|
23
|
+
* Avoid whitespace between method name and argument list (jeremyevans)
|
24
|
+
|
25
|
+
# 1.0.3 (2018-02-15)
|
26
|
+
|
27
|
+
* Avoid using deprecated sass color operators (jeremyevans)
|
28
|
+
|
29
|
+
# 1.0.2 (2017-07-01)
|
30
|
+
|
31
|
+
* Handle documenting BasicObject (jeremyevans)
|
32
|
+
|
33
|
+
# 1.0.1 (2016-10-12)
|
34
|
+
|
35
|
+
* Remove unneeded and harmful target="docwin" from links (jeremyevans)
|
36
|
+
|
37
|
+
# 1.0.0 (2016-09-21)
|
38
|
+
|
39
|
+
* Support haml 4+ and rdoc 5+ (jeremyevans)
|
40
|
+
|
41
|
+
* Remove no longer needed override of parseable? in rdoc (jeremyevans)
|
42
|
+
|
43
|
+
# 0.4.2 (2014-11-26)
|
44
|
+
|
45
|
+
* Use ruby's built-in syntax parser instead of parser gem to check for valid syntax (jeremyevans)
|
46
|
+
|
47
|
+
# 0.4.1 (2014-08-29)
|
48
|
+
|
49
|
+
* Update syntax highlighting color for comments and strings (jeremyevans)
|
50
|
+
|
51
|
+
# 0.4.0 (2014-08-19)
|
52
|
+
|
53
|
+
* Add parser as a dependency for checking for valid Ruby syntax (jeremyevans)
|
54
|
+
|
55
|
+
* Use table instead of dl for better styling of label/note lists (jeremyevans)
|
56
|
+
|
57
|
+
* Syntax highlight ruby code blocks, not just method source (jeremyevans)
|
58
|
+
|
59
|
+
# 0.3.0 (2014-06-18)
|
60
|
+
|
61
|
+
* Show superclass instead of parent for classes (Quintus, jeremyevans)
|
62
|
+
|
63
|
+
* Add support for RDoc 4 (Atsushi Nagase, jeremyevans)
|
64
|
+
|
65
|
+
# 0.2.7 (2013-03-23)
|
66
|
+
|
67
|
+
* Remove duplicate entries from method index (jeremyevans)
|
68
|
+
|
69
|
+
* Fix attribute links (jeremyevans)
|
70
|
+
|
71
|
+
# 0.2.6 (2013-03-01)
|
72
|
+
|
73
|
+
* Fix homepage in gem (erikh)
|
74
|
+
|
75
|
+
# 0.2.5 (2013-03-01)
|
76
|
+
|
77
|
+
* Restrict rdoc version in gem to ~> 3.1, since the gem doesn't work with RDoc 4 (jeremyevans)
|
78
|
+
|
79
|
+
# 0.2.4 (2011-07-24)
|
80
|
+
|
81
|
+
* Respect markup in section comments (jeremyevans)
|
82
|
+
|
83
|
+
* Fix class/singleton attribute anchors (jeremyevans)
|
84
|
+
|
85
|
+
* Work with RDoc 3.8+ (jeremyevans)
|
86
|
+
|
87
|
+
* Support RDoc sections (jeremyevans)
|
88
|
+
|
89
|
+
* Automatically link classes, modules, included modules, and attributes (jeremyevans)
|
90
|
+
|
91
|
+
# 0.2.3 (2011-05-12)
|
92
|
+
|
93
|
+
* Sort method, aliases, and attribute lists (jeremyevans)
|
94
|
+
|
95
|
+
# 0.2.2 (2010-12-28)
|
96
|
+
|
97
|
+
* Work with RDoc 3.1+ (erikh)
|
98
|
+
|
99
|
+
# 0.2.1 (2010-12-23)
|
100
|
+
|
101
|
+
* Rename internal files to hanna-nouveau (erikh)
|
102
|
+
|
103
|
+
# 0.2.0 (2010-12-23)
|
104
|
+
|
105
|
+
* Initial release
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Copyright (c) 2009 Mislav Marohnić
|
2
2
|
Copyright (c) 2010, 2011 Erik Hollensbe
|
3
|
-
Copyright (c) 2011-
|
3
|
+
Copyright (c) 2011-2022 Jeremy Evans
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
6
|
this software and associated documentation files (the "Software"), to deal in
|
data/README.rdoc
CHANGED
@@ -1,27 +1,12 @@
|
|
1
1
|
= Hanna-nouveau
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
Hanna-nouveau is an RDoc generator that scales. It's implemented in Haml,
|
6
|
-
making the sources clean and readable. It's built with simplicity, beauty
|
3
|
+
Hanna-nouveau is an RDoc generator built with simplicity, beauty
|
7
4
|
and ease of browsing in mind.
|
8
5
|
|
9
|
-
|
6
|
+
== Installation
|
10
7
|
|
11
8
|
gem install hanna-nouveau
|
12
9
|
|
13
|
-
The template was created by {Mislav}[http://mislav.uniqpath.com/] and since then
|
14
|
-
has seen contributions from:
|
15
|
-
|
16
|
-
1. {Tony Strauss}[http://github.com/DesigningPatterns], who participated from
|
17
|
-
the early start and made tons of fixes and enhancements to the template;
|
18
|
-
2. {Hongli Lai}[http://blog.phusion.nl/] with the search filter for methods.
|
19
|
-
3. {Erik Hollensbe}[http://github.com/erikh] a serious refactoring and up to
|
20
|
-
date with RDoc 2.5.x and 3.x, now named 'hanna-nouveau'.
|
21
|
-
4. {James Tucker}[http://github.com/raggi] minor cleanups for Erik.
|
22
|
-
5. {Jeremy Evans}[http://github.com/jeremyevans] RDoc 4 support, maintenance
|
23
|
-
since 2014.
|
24
|
-
|
25
10
|
== Usage
|
26
11
|
|
27
12
|
rdoc -o doc -f hanna lib
|
@@ -34,48 +19,24 @@ This will make RDoc always use hanna-nouveau unless it is explicitly overridden.
|
|
34
19
|
|
35
20
|
== Integrating with RubyGems
|
36
21
|
|
37
|
-
|
22
|
+
If you put the following line in your .gemrc, this will make
|
38
23
|
RubyGems use Hanna for all rdoc generation:
|
39
24
|
|
40
25
|
rdoc: -f hanna
|
41
26
|
|
42
|
-
|
43
|
-
|
27
|
+
After doing this, if you wish to have documentation for all your installed gems
|
28
|
+
to be formatted in hanna:
|
44
29
|
|
45
30
|
gem rdoc --all --overwrite
|
46
31
|
|
47
|
-
The first time. To easily browse your newly created documentation, use:
|
48
|
-
|
49
|
-
gem server
|
50
|
-
|
51
32
|
== Rake task
|
52
33
|
|
53
|
-
For repeated generation of API docs,
|
54
|
-
|
55
|
-
|
56
|
-
gem 'rdoc'
|
57
|
-
require 'rdoc/task'
|
58
|
-
RDoc::Task.new do |rdoc|
|
59
|
-
rdoc.generator = 'hanna'
|
60
|
-
end
|
61
|
-
|
62
|
-
Tip: you can do this in the Rakefile of your Rails project before running
|
63
|
-
`rake doc:rails`.
|
34
|
+
For repeated generation of API docs, you can set up a Rake task. Set
|
35
|
+
hanna as the RDoc generator:
|
64
36
|
|
65
|
-
Here is an example of a task for the {rdbi
|
66
|
-
library}[http://github.com/rdbi/rdbi/tree/master/Rakefile]:
|
67
|
-
|
68
|
-
gem 'rdoc'
|
69
37
|
require 'rdoc/task'
|
70
38
|
RDoc::Task.new do |rdoc|
|
71
|
-
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
72
|
-
|
73
39
|
rdoc.generator = 'hanna'
|
74
|
-
rdoc.main = 'README.rdoc'
|
75
|
-
rdoc.rdoc_dir = 'rdoc'
|
76
|
-
rdoc.title = "RDBI #{version} Documentation"
|
77
|
-
rdoc.rdoc_files.include('README*')
|
78
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
79
40
|
end
|
80
41
|
|
81
42
|
== Modification to RDoc
|
@@ -85,3 +46,18 @@ friendly documentation. It changes label lists to use a table
|
|
85
46
|
instead of a description list, since it is very difficult to
|
86
47
|
get visually appealing styling for description lists without
|
87
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,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 += " expanded"; 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,34 @@
|
|
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 content='text/html; charset=<%=h @options.charset %>' http-equiv='Content-Type'>
|
6
|
+
<link href='<%=h values[:stylesheet] %>' media='screen' rel='stylesheet' type='text/css'>
|
7
|
+
<% if index %><base target='docwin'>
|
8
|
+
<% else %><script type='text/javascript'>
|
9
|
+
function popupCode(url) {
|
10
|
+
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
11
|
+
}
|
12
|
+
|
13
|
+
function toggleCode(id) {
|
14
|
+
var code = document.getElementById(id)
|
15
|
+
|
16
|
+
code.style.display = code.style.display != 'block' ? 'block' : 'none'
|
17
|
+
return true
|
18
|
+
}
|
19
|
+
|
20
|
+
// Make codeblocks hidden by default
|
21
|
+
document.writeln('<' + 'style type="text/css">.method .source pre { display: none }<\/style>')
|
22
|
+
</script>
|
23
|
+
<% end %></head>
|
24
|
+
<body class='<%= index ? 'list' : 'page' %>'>
|
25
|
+
<% if index %><div id='index'><%= yield %></div>
|
26
|
+
<% else %><div class='<%= values[:classmod] ? 'class' : 'file' %>' id='wrapper'>
|
27
|
+
<%= yield %>
|
28
|
+
<div id='footer-push'></div>
|
29
|
+
</div>
|
30
|
+
<div id='footer'>
|
31
|
+
<a href="https://github.com/jeremyevans/hanna-nouveau"><strong>Hanna Nouveau</strong> RDoc template</a>
|
32
|
+
</div>
|
33
|
+
<% end %></body>
|
34
|
+
</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+(#?=>|→)\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
|
-
|
2
|
-
|
3
|
-
|
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
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
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
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
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
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
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 += " expanded"; 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> </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>-></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}]" : ' ' %></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('<%= name %>'); 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 %>
|