rdoc 6.15.0 → 7.0.1
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.
- checksums.yaml +4 -4
- data/CONTRIBUTING.md +187 -0
- data/History.rdoc +1 -1
- data/LEGAL.rdoc +6 -0
- data/README.md +20 -3
- data/lib/rdoc/code_object/any_method.rb +15 -7
- data/lib/rdoc/code_object/class_module.rb +13 -0
- data/lib/rdoc/code_object/constant.rb +9 -0
- data/lib/rdoc/code_object/method_attr.rb +13 -1
- data/lib/rdoc/code_object/top_level.rb +31 -18
- data/lib/rdoc/comment.rb +190 -8
- data/lib/rdoc/generator/aliki.rb +183 -0
- data/lib/rdoc/generator/darkfish.rb +5 -1
- data/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +8 -0
- data/lib/rdoc/generator/template/aliki/_footer.rhtml +23 -0
- data/lib/rdoc/generator/template/aliki/_head.rhtml +158 -0
- data/lib/rdoc/generator/template/aliki/_header.rhtml +56 -0
- data/lib/rdoc/generator/template/aliki/_icons.rhtml +208 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml +16 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml +15 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +25 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +25 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +16 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_methods.rhtml +41 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +67 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +15 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +21 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +3 -0
- data/lib/rdoc/generator/template/aliki/class.rhtml +218 -0
- data/lib/rdoc/generator/template/aliki/css/rdoc.css +1944 -0
- data/lib/rdoc/generator/template/aliki/index.rhtml +22 -0
- data/lib/rdoc/generator/template/aliki/js/aliki.js +498 -0
- data/lib/rdoc/generator/template/aliki/js/c_highlighter.js +299 -0
- data/lib/rdoc/generator/template/aliki/js/search_controller.js +120 -0
- data/lib/rdoc/generator/template/aliki/js/search_navigation.js +105 -0
- data/lib/rdoc/generator/template/aliki/js/search_ranker.js +239 -0
- data/lib/rdoc/generator/template/aliki/js/theme-toggle.js +112 -0
- data/lib/rdoc/generator/template/aliki/page.rhtml +18 -0
- data/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +14 -0
- data/lib/rdoc/generator/template/aliki/servlet_root.rhtml +65 -0
- data/lib/rdoc/generator/template/darkfish/_footer.rhtml +3 -3
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +14 -19
- data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +8 -8
- data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +8 -8
- data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +7 -6
- data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +6 -6
- data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +19 -19
- data/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +2 -2
- data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +1 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +3 -3
- data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +14 -14
- data/lib/rdoc/generator/template/darkfish/class.rhtml +62 -62
- data/lib/rdoc/generator/template/darkfish/index.rhtml +4 -3
- data/lib/rdoc/generator/template/darkfish/page.rhtml +2 -1
- data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +2 -1
- data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +19 -19
- data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +19 -17
- data/lib/rdoc/generator/template/json_index/js/searcher.js +43 -6
- data/lib/rdoc/generator.rb +1 -0
- data/lib/rdoc/markup/pre_process.rb +34 -10
- data/lib/rdoc/markup/to_ansi.rb +4 -0
- data/lib/rdoc/markup/to_bs.rb +4 -0
- data/lib/rdoc/markup/to_html.rb +6 -4
- data/lib/rdoc/markup/to_rdoc.rb +11 -3
- data/lib/rdoc/options.rb +21 -10
- data/lib/rdoc/parser/c.rb +15 -46
- data/lib/rdoc/parser/prism_ruby.rb +121 -113
- data/lib/rdoc/parser/ruby.rb +8 -8
- data/lib/rdoc/parser/ruby_tools.rb +5 -7
- data/lib/rdoc/parser/simple.rb +4 -21
- data/lib/rdoc/rdoc.rb +1 -0
- data/lib/rdoc/rubygems_hook.rb +3 -3
- data/lib/rdoc/text.rb +1 -1
- data/lib/rdoc/token_stream.rb +13 -1
- data/lib/rdoc/tom_doc.rb +1 -1
- data/lib/rdoc/version.rb +1 -1
- data/rdoc.gemspec +1 -1
- metadata +33 -5
- data/CONTRIBUTING.rdoc +0 -219
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'uri'
|
|
4
|
+
|
|
5
|
+
##
|
|
6
|
+
# Aliki theme for RDoc documentation
|
|
7
|
+
#
|
|
8
|
+
# Author: Stan Lo
|
|
9
|
+
#
|
|
10
|
+
|
|
11
|
+
class RDoc::Generator::Aliki < RDoc::Generator::Darkfish
|
|
12
|
+
RDoc::RDoc.add_generator self
|
|
13
|
+
|
|
14
|
+
def initialize(store, options)
|
|
15
|
+
super
|
|
16
|
+
aliki_template_dir = File.expand_path(File.join(__dir__, 'template', 'aliki'))
|
|
17
|
+
@template_dir = Pathname.new(aliki_template_dir)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
##
|
|
21
|
+
# Generate documentation. Overrides Darkfish to use Aliki's own search index
|
|
22
|
+
# instead of the JsonIndex generator.
|
|
23
|
+
|
|
24
|
+
def generate
|
|
25
|
+
setup
|
|
26
|
+
|
|
27
|
+
write_style_sheet
|
|
28
|
+
generate_index
|
|
29
|
+
generate_class_files
|
|
30
|
+
generate_file_files
|
|
31
|
+
generate_table_of_contents
|
|
32
|
+
write_search_index
|
|
33
|
+
|
|
34
|
+
copy_static
|
|
35
|
+
|
|
36
|
+
rescue => e
|
|
37
|
+
debug_msg "%s: %s\n %s" % [
|
|
38
|
+
e.class.name, e.message, e.backtrace.join("\n ")
|
|
39
|
+
]
|
|
40
|
+
|
|
41
|
+
raise
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
##
|
|
45
|
+
# Copy only the static assets required by the Aliki theme. Unlike Darkfish we
|
|
46
|
+
# don't ship embedded fonts or image sprites, so limit the asset list to keep
|
|
47
|
+
# generated documentation lightweight.
|
|
48
|
+
|
|
49
|
+
def write_style_sheet
|
|
50
|
+
debug_msg "Copying Aliki static files"
|
|
51
|
+
options = { verbose: $DEBUG_RDOC, noop: @dry_run }
|
|
52
|
+
|
|
53
|
+
install_rdoc_static_file @template_dir + 'css/rdoc.css', "./css/rdoc.css", options
|
|
54
|
+
|
|
55
|
+
unless @options.template_stylesheets.empty?
|
|
56
|
+
FileUtils.cp @options.template_stylesheets, '.', **options
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
Dir[(@template_dir + 'js/**/*').to_s].each do |path|
|
|
60
|
+
next if File.directory?(path)
|
|
61
|
+
next if File.basename(path).start_with?('.')
|
|
62
|
+
|
|
63
|
+
dst = Pathname.new(path).relative_path_from(@template_dir)
|
|
64
|
+
|
|
65
|
+
install_rdoc_static_file @template_dir + path, dst, options
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
##
|
|
70
|
+
# Build a search index array for Aliki's searcher.
|
|
71
|
+
|
|
72
|
+
def build_search_index
|
|
73
|
+
setup
|
|
74
|
+
|
|
75
|
+
index = []
|
|
76
|
+
|
|
77
|
+
@classes.each do |klass|
|
|
78
|
+
next unless klass.display?
|
|
79
|
+
|
|
80
|
+
index << build_class_module_entry(klass)
|
|
81
|
+
|
|
82
|
+
klass.constants.each do |const|
|
|
83
|
+
next unless const.display?
|
|
84
|
+
|
|
85
|
+
index << build_constant_entry(const, klass)
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
@methods.each do |method|
|
|
90
|
+
next unless method.display?
|
|
91
|
+
|
|
92
|
+
index << build_method_entry(method)
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
index
|
|
96
|
+
end
|
|
97
|
+
|
|
98
|
+
##
|
|
99
|
+
# Write the search index as a JavaScript file
|
|
100
|
+
# Format: var search_data = { index: [...] }
|
|
101
|
+
#
|
|
102
|
+
# We still write to a .js instead of a .json because loading a JSON file triggers CORS check in browsers.
|
|
103
|
+
# And if we simply inspect the generated pages using file://, which is often the case due to lack of the server mode,
|
|
104
|
+
# the JSON file will be blocked by the browser.
|
|
105
|
+
|
|
106
|
+
def write_search_index
|
|
107
|
+
debug_msg "Writing Aliki search index"
|
|
108
|
+
|
|
109
|
+
index = build_search_index
|
|
110
|
+
|
|
111
|
+
FileUtils.mkdir_p 'js' unless @dry_run
|
|
112
|
+
|
|
113
|
+
search_index_path = 'js/search_data.js'
|
|
114
|
+
return if @dry_run
|
|
115
|
+
|
|
116
|
+
data = { index: index }
|
|
117
|
+
File.write search_index_path, "var search_data = #{JSON.generate(data)};"
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
##
|
|
121
|
+
# Resolves a URL for use in templates. Absolute URLs are returned unchanged.
|
|
122
|
+
# Relative URLs are prefixed with rel_prefix to ensure they resolve correctly from any page.
|
|
123
|
+
|
|
124
|
+
def resolve_url(rel_prefix, url)
|
|
125
|
+
uri = URI.parse(url)
|
|
126
|
+
if uri.absolute?
|
|
127
|
+
url
|
|
128
|
+
else
|
|
129
|
+
"#{rel_prefix}/#{url}"
|
|
130
|
+
end
|
|
131
|
+
rescue URI::InvalidURIError
|
|
132
|
+
"#{rel_prefix}/#{url}"
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
private
|
|
136
|
+
|
|
137
|
+
def build_class_module_entry(klass)
|
|
138
|
+
type = case klass
|
|
139
|
+
when RDoc::NormalClass then 'class'
|
|
140
|
+
when RDoc::NormalModule then 'module'
|
|
141
|
+
else 'class'
|
|
142
|
+
end
|
|
143
|
+
|
|
144
|
+
entry = {
|
|
145
|
+
name: klass.name,
|
|
146
|
+
full_name: klass.full_name,
|
|
147
|
+
type: type,
|
|
148
|
+
path: klass.path
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
snippet = klass.search_snippet
|
|
152
|
+
entry[:snippet] = snippet unless snippet.empty?
|
|
153
|
+
entry
|
|
154
|
+
end
|
|
155
|
+
|
|
156
|
+
def build_method_entry(method)
|
|
157
|
+
type = method.singleton ? 'class_method' : 'instance_method'
|
|
158
|
+
|
|
159
|
+
entry = {
|
|
160
|
+
name: method.name,
|
|
161
|
+
full_name: method.full_name,
|
|
162
|
+
type: type,
|
|
163
|
+
path: method.path
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
snippet = method.search_snippet
|
|
167
|
+
entry[:snippet] = snippet unless snippet.empty?
|
|
168
|
+
entry
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def build_constant_entry(const, parent)
|
|
172
|
+
entry = {
|
|
173
|
+
name: const.name,
|
|
174
|
+
full_name: "#{parent.full_name}::#{const.name}",
|
|
175
|
+
type: 'constant',
|
|
176
|
+
path: parent.path
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
snippet = const.search_snippet
|
|
180
|
+
entry[:snippet] = snippet unless snippet.empty?
|
|
181
|
+
entry
|
|
182
|
+
end
|
|
183
|
+
end
|
|
@@ -314,6 +314,8 @@ class RDoc::Generator::Darkfish
|
|
|
314
314
|
# Generates a class file for +klass+
|
|
315
315
|
|
|
316
316
|
def generate_class(klass, template_file = nil)
|
|
317
|
+
# This is used to auto-collapse Pages section on class/module pages
|
|
318
|
+
@inside_class_file = true
|
|
317
319
|
current = klass
|
|
318
320
|
|
|
319
321
|
template_file ||= @template_dir + 'class.rhtml'
|
|
@@ -338,6 +340,8 @@ class RDoc::Generator::Darkfish
|
|
|
338
340
|
here.local_variable_set(:asset_rel_prefix, asset_rel_prefix)
|
|
339
341
|
here
|
|
340
342
|
end
|
|
343
|
+
ensure
|
|
344
|
+
@inside_class_file = false
|
|
341
345
|
end
|
|
342
346
|
|
|
343
347
|
##
|
|
@@ -764,7 +768,7 @@ class RDoc::Generator::Darkfish
|
|
|
764
768
|
end
|
|
765
769
|
|
|
766
770
|
def traverse_classes(klasses, grouped_classes, rel_prefix, solo = false)
|
|
767
|
-
content = +'<ul class="link-list">'
|
|
771
|
+
content = +'<ul class="link-list nav-list">'
|
|
768
772
|
|
|
769
773
|
klasses.each do |index_klass|
|
|
770
774
|
if children = grouped_classes[index_klass.full_name]
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
<aside class="table-of-contents" role="complementary" aria-label="Table of Contents">
|
|
2
|
+
<div class="toc-sticky">
|
|
3
|
+
<h3 class="toc-heading">On This Page</h3>
|
|
4
|
+
<nav class="toc-nav" id="toc-nav" aria-label="Page sections">
|
|
5
|
+
<!-- Generated by JavaScript based on page headings -->
|
|
6
|
+
</nav>
|
|
7
|
+
</div>
|
|
8
|
+
</aside>
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<footer class="site-footer">
|
|
2
|
+
<% if @options.footer_content && !@options.footer_content.empty? %>
|
|
3
|
+
<div class="footer-content">
|
|
4
|
+
<% @options.footer_content.each do |column_title, links| %>
|
|
5
|
+
<div>
|
|
6
|
+
<h3><%= h column_title %></h3>
|
|
7
|
+
<ul>
|
|
8
|
+
<% links.each do |text, url| %>
|
|
9
|
+
<li><a href="<%= h resolve_url(rel_prefix, url) %>"><%= h text %></a></li>
|
|
10
|
+
<% end %>
|
|
11
|
+
</ul>
|
|
12
|
+
</div>
|
|
13
|
+
<% end %>
|
|
14
|
+
</div>
|
|
15
|
+
<% end %>
|
|
16
|
+
|
|
17
|
+
<div class="footer-bottom">
|
|
18
|
+
<p>
|
|
19
|
+
Generated by <a href="https://ruby.github.io/rdoc/">RDoc <%= RDoc::VERSION %></a>
|
|
20
|
+
using the Aliki theme by <a href="http://st0012.dev">Stan Lo</a>
|
|
21
|
+
</p>
|
|
22
|
+
</div>
|
|
23
|
+
</footer>
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
<meta charset="<%= @options.charset %>">
|
|
2
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
3
|
+
|
|
4
|
+
<title><%= h @title %></title>
|
|
5
|
+
|
|
6
|
+
<%- if defined?(klass) %>
|
|
7
|
+
<meta
|
|
8
|
+
name="keywords"
|
|
9
|
+
content="ruby,<%= h "#{klass.type},#{klass.full_name}" %>"
|
|
10
|
+
>
|
|
11
|
+
<%- if klass.comment.empty? %>
|
|
12
|
+
<meta
|
|
13
|
+
name="description"
|
|
14
|
+
content="Documentation for the <%= h "#{klass.full_name} #{klass.type}" %>"
|
|
15
|
+
>
|
|
16
|
+
<%- else %>
|
|
17
|
+
<meta
|
|
18
|
+
name="description"
|
|
19
|
+
content="<%= h "#{klass.type} #{klass.full_name}: #{excerpt(klass.comment)}" %>"
|
|
20
|
+
>
|
|
21
|
+
<%- end %>
|
|
22
|
+
<%- elsif defined?(file) %>
|
|
23
|
+
<meta name="keywords" content="ruby,documentation,<%= h file.page_name %>">
|
|
24
|
+
<meta
|
|
25
|
+
name="description"
|
|
26
|
+
content="<%= h "#{file.page_name}: #{excerpt(file.comment)}" %>"
|
|
27
|
+
>
|
|
28
|
+
<%- elsif @title %>
|
|
29
|
+
<meta name="keywords" content="ruby,documentation,<%= h @title %>">
|
|
30
|
+
<%- if @options.main_page and
|
|
31
|
+
main_page = @files.find { |f| f.full_name == @options.main_page } then %>
|
|
32
|
+
<meta
|
|
33
|
+
name="description"
|
|
34
|
+
content="<%= h "#{@title}: #{excerpt(main_page.comment)}" %>"
|
|
35
|
+
>
|
|
36
|
+
<%- else %>
|
|
37
|
+
<meta name="description" content="Documentation for <%= h @title %>">
|
|
38
|
+
<%- end %>
|
|
39
|
+
<%- end %>
|
|
40
|
+
|
|
41
|
+
<%- if canonical_url = @options.canonical_root %>
|
|
42
|
+
<% canonical_url = current.canonical_url if defined?(current) %>
|
|
43
|
+
<link rel="canonical" href="<%= canonical_url %>">
|
|
44
|
+
<%- end %>
|
|
45
|
+
|
|
46
|
+
<!-- Open Graph / Facebook -->
|
|
47
|
+
<meta property="og:type" content="website">
|
|
48
|
+
<meta property="og:title" content="<%= h @title %>">
|
|
49
|
+
|
|
50
|
+
<%- if defined?(klass) %>
|
|
51
|
+
<%- if klass.comment.empty? %>
|
|
52
|
+
<meta
|
|
53
|
+
property="og:description"
|
|
54
|
+
content="Documentation for <%= h klass.full_name %> <%= h klass.type %> - API reference and code examples"
|
|
55
|
+
>
|
|
56
|
+
<%- else %>
|
|
57
|
+
<meta property="og:description" content="<%= h excerpt(klass.comment) %>">
|
|
58
|
+
<%- end %>
|
|
59
|
+
<%- elsif defined?(file) %>
|
|
60
|
+
<%- if file.comment.empty? %>
|
|
61
|
+
<meta
|
|
62
|
+
property="og:description"
|
|
63
|
+
content="<%= h file.page_name %> - <%= h @title %> documentation"
|
|
64
|
+
>
|
|
65
|
+
<%- else %>
|
|
66
|
+
<meta property="og:description" content="<%= h excerpt(file.comment) %>">
|
|
67
|
+
<%- end %>
|
|
68
|
+
<%- else %>
|
|
69
|
+
<meta
|
|
70
|
+
property="og:description"
|
|
71
|
+
content="API documentation for <%= h @title %> - Browse classes, modules, and methods"
|
|
72
|
+
>
|
|
73
|
+
<%- end %>
|
|
74
|
+
|
|
75
|
+
<%- if canonical_url = @options.canonical_root %>
|
|
76
|
+
<% canonical_url = current.canonical_url if defined?(current) %>
|
|
77
|
+
<meta property="og:url" content="<%= canonical_url %>">
|
|
78
|
+
<%- end %>
|
|
79
|
+
|
|
80
|
+
<!-- Twitter -->
|
|
81
|
+
<meta name="twitter:card" content="summary">
|
|
82
|
+
<meta name="twitter:title" content="<%= h @title %>">
|
|
83
|
+
|
|
84
|
+
<%- if defined?(klass) %>
|
|
85
|
+
<%- if klass.comment.empty? %>
|
|
86
|
+
<meta
|
|
87
|
+
name="twitter:description"
|
|
88
|
+
content="Documentation for <%= h klass.full_name %> <%= h klass.type %> - API reference and code examples"
|
|
89
|
+
>
|
|
90
|
+
<%- else %>
|
|
91
|
+
<meta name="twitter:description" content="<%= h excerpt(klass.comment) %>">
|
|
92
|
+
<%- end %>
|
|
93
|
+
<%- elsif defined?(file) %>
|
|
94
|
+
<%- if file.comment.empty? %>
|
|
95
|
+
<meta
|
|
96
|
+
name="twitter:description"
|
|
97
|
+
content="<%= h file.page_name %> - <%= h @title %> documentation"
|
|
98
|
+
>
|
|
99
|
+
<%- else %>
|
|
100
|
+
<meta name="twitter:description" content="<%= h excerpt(file.comment) %>">
|
|
101
|
+
<%- end %>
|
|
102
|
+
<%- else %>
|
|
103
|
+
<meta
|
|
104
|
+
name="twitter:description"
|
|
105
|
+
content="API documentation for <%= h @title %> - Browse classes, modules, and methods"
|
|
106
|
+
>
|
|
107
|
+
<%- end %>
|
|
108
|
+
|
|
109
|
+
<script type="text/javascript">
|
|
110
|
+
var rdoc_rel_prefix = "<%= h asset_rel_prefix %>/";
|
|
111
|
+
var index_rel_prefix = "<%= h rel_prefix %>/";
|
|
112
|
+
</script>
|
|
113
|
+
|
|
114
|
+
<script
|
|
115
|
+
src="<%= h asset_rel_prefix %>/js/theme-toggle.js?v=<%= h RDoc::VERSION %>"
|
|
116
|
+
></script>
|
|
117
|
+
|
|
118
|
+
<script
|
|
119
|
+
src="<%= h asset_rel_prefix %>/js/search_navigation.js?v=<%= h RDoc::VERSION %>"
|
|
120
|
+
defer
|
|
121
|
+
></script>
|
|
122
|
+
|
|
123
|
+
<script
|
|
124
|
+
src="<%= h asset_rel_prefix %>/js/search_data.js?v=<%= h RDoc::VERSION %>"
|
|
125
|
+
defer
|
|
126
|
+
></script>
|
|
127
|
+
|
|
128
|
+
<script
|
|
129
|
+
src="<%= h asset_rel_prefix %>/js/search_ranker.js?v=<%= h RDoc::VERSION %>"
|
|
130
|
+
defer
|
|
131
|
+
></script>
|
|
132
|
+
|
|
133
|
+
<script
|
|
134
|
+
src="<%= h asset_rel_prefix %>/js/search_controller.js?v=<%= h RDoc::VERSION %>"
|
|
135
|
+
defer
|
|
136
|
+
></script>
|
|
137
|
+
|
|
138
|
+
<script
|
|
139
|
+
src="<%= h asset_rel_prefix %>/js/c_highlighter.js?v=<%= h RDoc::VERSION %>"
|
|
140
|
+
defer
|
|
141
|
+
></script>
|
|
142
|
+
|
|
143
|
+
<script
|
|
144
|
+
src="<%= h asset_rel_prefix %>/js/aliki.js?v=<%= h RDoc::VERSION %>"
|
|
145
|
+
defer
|
|
146
|
+
></script>
|
|
147
|
+
|
|
148
|
+
<link
|
|
149
|
+
href="<%= h asset_rel_prefix %>/css/rdoc.css?v=<%= h RDoc::VERSION %>"
|
|
150
|
+
rel="stylesheet"
|
|
151
|
+
>
|
|
152
|
+
|
|
153
|
+
<%- @options.template_stylesheets.each do |stylesheet| %>
|
|
154
|
+
<link
|
|
155
|
+
href="<%= h asset_rel_prefix %>/<%= h File.basename stylesheet %>?v=<%= h RDoc::VERSION %>"
|
|
156
|
+
rel="stylesheet"
|
|
157
|
+
>
|
|
158
|
+
<%- end %>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<header class="top-navbar">
|
|
2
|
+
<a href="<%= rel_prefix %>/index.html" class="navbar-brand">
|
|
3
|
+
<%= h @options.title %>
|
|
4
|
+
</a>
|
|
5
|
+
|
|
6
|
+
<!-- Desktop search bar -->
|
|
7
|
+
<div class="navbar-search navbar-search-desktop" role="search">
|
|
8
|
+
<form action="#" method="get" accept-charset="utf-8">
|
|
9
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
|
10
|
+
aria-autocomplete="list" aria-controls="search-results-desktop"
|
|
11
|
+
type="text" name="search" placeholder="Search (/) for a class, method..."
|
|
12
|
+
spellcheck="false" autocomplete="off"
|
|
13
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
|
14
|
+
<ul id="search-results-desktop" aria-label="Search Results"
|
|
15
|
+
aria-busy="false" aria-expanded="false"
|
|
16
|
+
aria-atomic="false" class="initially-hidden search-results"></ul>
|
|
17
|
+
</form>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<!-- Mobile search icon button -->
|
|
21
|
+
<button id="search-toggle" class="navbar-search-mobile" aria-label="Open search" type="button">
|
|
22
|
+
<span aria-hidden="true">🔍</span>
|
|
23
|
+
</button>
|
|
24
|
+
|
|
25
|
+
<!-- Theme toggle button -->
|
|
26
|
+
<button id="theme-toggle" class="theme-toggle" aria-label="Switch to dark mode" type="button">
|
|
27
|
+
<span class="theme-toggle-icon" aria-hidden="true">🌙</span>
|
|
28
|
+
</button>
|
|
29
|
+
</header>
|
|
30
|
+
|
|
31
|
+
<!-- Search Modal (Mobile) -->
|
|
32
|
+
<div id="search-modal" class="search-modal" hidden aria-modal="true" role="dialog" aria-label="Search">
|
|
33
|
+
<div class="search-modal-backdrop"></div>
|
|
34
|
+
<div class="search-modal-content">
|
|
35
|
+
<div class="search-modal-header">
|
|
36
|
+
<form class="search-modal-form" action="#" method="get" accept-charset="utf-8">
|
|
37
|
+
<span class="search-modal-icon" aria-hidden="true">🔍</span>
|
|
38
|
+
<input id="search-field-mobile" role="combobox" aria-label="Search"
|
|
39
|
+
aria-autocomplete="list" aria-controls="search-results-mobile"
|
|
40
|
+
type="text" name="search" placeholder="Search documentation"
|
|
41
|
+
spellcheck="false" autocomplete="off">
|
|
42
|
+
<button type="button" class="search-modal-close" aria-label="Close search" id="search-modal-close">
|
|
43
|
+
<span aria-hidden="true">esc</span>
|
|
44
|
+
</button>
|
|
45
|
+
</form>
|
|
46
|
+
</div>
|
|
47
|
+
<div class="search-modal-body">
|
|
48
|
+
<ul id="search-results-mobile" aria-label="Search Results"
|
|
49
|
+
aria-busy="false" aria-expanded="false"
|
|
50
|
+
aria-atomic="false" class="search-results search-modal-results initially-hidden"></ul>
|
|
51
|
+
<div class="search-modal-empty">
|
|
52
|
+
<p>No recent searches</p>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" style="display: none;">
|
|
2
|
+
<!-- Chevron (right arrow) - used for expand/collapse -->
|
|
3
|
+
<symbol
|
|
4
|
+
id="icon-chevron"
|
|
5
|
+
viewBox="0 0 24 24"
|
|
6
|
+
fill="none"
|
|
7
|
+
stroke="currentColor"
|
|
8
|
+
stroke-width="2"
|
|
9
|
+
stroke-linecap="round"
|
|
10
|
+
stroke-linejoin="round"
|
|
11
|
+
>
|
|
12
|
+
<polyline points="9 18 15 12 9 6"></polyline>
|
|
13
|
+
</symbol>
|
|
14
|
+
|
|
15
|
+
<!-- File/Document - Pages section -->
|
|
16
|
+
<symbol
|
|
17
|
+
id="icon-file"
|
|
18
|
+
viewBox="0 0 24 24"
|
|
19
|
+
fill="none"
|
|
20
|
+
stroke="currentColor"
|
|
21
|
+
stroke-width="2"
|
|
22
|
+
stroke-linecap="round"
|
|
23
|
+
stroke-linejoin="round"
|
|
24
|
+
>
|
|
25
|
+
<path
|
|
26
|
+
d="M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"
|
|
27
|
+
></path>
|
|
28
|
+
|
|
29
|
+
<polyline points="14 2 14 8 20 8"></polyline>
|
|
30
|
+
</symbol>
|
|
31
|
+
|
|
32
|
+
<!-- Layers/Stack - Classes and Modules section -->
|
|
33
|
+
<symbol
|
|
34
|
+
id="icon-layers"
|
|
35
|
+
viewBox="0 0 24 24"
|
|
36
|
+
fill="none"
|
|
37
|
+
stroke="currentColor"
|
|
38
|
+
stroke-width="2"
|
|
39
|
+
stroke-linecap="round"
|
|
40
|
+
stroke-linejoin="round"
|
|
41
|
+
>
|
|
42
|
+
<polygon points="12 2 2 7 12 12 22 7 12 2"></polygon>
|
|
43
|
+
<polyline points="2 17 12 22 22 17"></polyline>
|
|
44
|
+
<polyline points="2 12 12 17 22 12"></polyline>
|
|
45
|
+
</symbol>
|
|
46
|
+
|
|
47
|
+
<!-- Curly braces with C - Class Methods section -->
|
|
48
|
+
<symbol
|
|
49
|
+
id="icon-class-methods"
|
|
50
|
+
viewBox="0 0 24 24"
|
|
51
|
+
fill="none"
|
|
52
|
+
stroke="currentColor"
|
|
53
|
+
stroke-width="2"
|
|
54
|
+
stroke-linecap="round"
|
|
55
|
+
stroke-linejoin="round"
|
|
56
|
+
>
|
|
57
|
+
<path d="M6 3C3.5 3 2 4.5 2 7v3c0 1.5-1 2-1 2s1 .5 1 2v5c0 2.5 1.5 4 4 4"></path>
|
|
58
|
+
<path d="M18 3c2.5 0 4 1.5 4 4v3c0 1.5 1 2 1 2s-1 .5-1 2v5c0 2.5-1.5 4-4 4"></path>
|
|
59
|
+
|
|
60
|
+
<text
|
|
61
|
+
x="12"
|
|
62
|
+
y="17"
|
|
63
|
+
text-anchor="middle"
|
|
64
|
+
font-size="13"
|
|
65
|
+
font-weight="bold"
|
|
66
|
+
fill="currentColor"
|
|
67
|
+
stroke="none"
|
|
68
|
+
>
|
|
69
|
+
C
|
|
70
|
+
</text>
|
|
71
|
+
</symbol>
|
|
72
|
+
|
|
73
|
+
<!-- Curly braces with I - Instance Methods section -->
|
|
74
|
+
<symbol
|
|
75
|
+
id="icon-instance-methods"
|
|
76
|
+
viewBox="0 0 24 24"
|
|
77
|
+
fill="none"
|
|
78
|
+
stroke="currentColor"
|
|
79
|
+
stroke-width="2"
|
|
80
|
+
stroke-linecap="round"
|
|
81
|
+
stroke-linejoin="round"
|
|
82
|
+
>
|
|
83
|
+
<path d="M6 3C3.5 3 2 4.5 2 7v3c0 1.5-1 2-1 2s1 .5 1 2v5c0 2.5 1.5 4 4 4"></path>
|
|
84
|
+
<path d="M18 3c2.5 0 4 1.5 4 4v3c0 1.5 1 2 1 2s-1 .5-1 2v5c0 2.5-1.5 4-4 4"></path>
|
|
85
|
+
|
|
86
|
+
<text
|
|
87
|
+
x="12"
|
|
88
|
+
y="17"
|
|
89
|
+
text-anchor="middle"
|
|
90
|
+
font-size="13"
|
|
91
|
+
font-weight="bold"
|
|
92
|
+
fill="currentColor"
|
|
93
|
+
stroke="none"
|
|
94
|
+
>
|
|
95
|
+
I
|
|
96
|
+
</text>
|
|
97
|
+
</symbol>
|
|
98
|
+
|
|
99
|
+
<!-- Double chevrons up - Ancestors section -->
|
|
100
|
+
<symbol
|
|
101
|
+
id="icon-ancestors"
|
|
102
|
+
viewBox="0 0 24 24"
|
|
103
|
+
fill="none"
|
|
104
|
+
stroke="currentColor"
|
|
105
|
+
stroke-width="2"
|
|
106
|
+
stroke-linecap="round"
|
|
107
|
+
stroke-linejoin="round"
|
|
108
|
+
>
|
|
109
|
+
<polyline points="17 11 12 6 7 11"></polyline>
|
|
110
|
+
<polyline points="17 18 12 13 7 18"></polyline>
|
|
111
|
+
</symbol>
|
|
112
|
+
|
|
113
|
+
<!-- User with plus - Included Modules section -->
|
|
114
|
+
<symbol
|
|
115
|
+
id="icon-includes"
|
|
116
|
+
viewBox="0 0 24 24"
|
|
117
|
+
fill="none"
|
|
118
|
+
stroke="currentColor"
|
|
119
|
+
stroke-width="2"
|
|
120
|
+
stroke-linecap="round"
|
|
121
|
+
stroke-linejoin="round"
|
|
122
|
+
>
|
|
123
|
+
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
|
|
124
|
+
<circle cx="8.5" cy="7" r="4"></circle>
|
|
125
|
+
|
|
126
|
+
<line
|
|
127
|
+
x1="20"
|
|
128
|
+
y1="8"
|
|
129
|
+
x2="20"
|
|
130
|
+
y2="14"
|
|
131
|
+
></line>
|
|
132
|
+
|
|
133
|
+
<line
|
|
134
|
+
x1="23"
|
|
135
|
+
y1="11"
|
|
136
|
+
x2="17"
|
|
137
|
+
y2="11"
|
|
138
|
+
></line>
|
|
139
|
+
</symbol>
|
|
140
|
+
|
|
141
|
+
<!-- User with check - Extended Modules section -->
|
|
142
|
+
<symbol
|
|
143
|
+
id="icon-extends"
|
|
144
|
+
viewBox="0 0 24 24"
|
|
145
|
+
fill="none"
|
|
146
|
+
stroke="currentColor"
|
|
147
|
+
stroke-width="2"
|
|
148
|
+
stroke-linecap="round"
|
|
149
|
+
stroke-linejoin="round"
|
|
150
|
+
>
|
|
151
|
+
<path d="M16 21v-2a4 4 0 0 0-4-4H5a4 4 0 0 0-4 4v2"></path>
|
|
152
|
+
<circle cx="8.5" cy="7" r="4"></circle>
|
|
153
|
+
<polyline points="17 11 19 13 23 9"></polyline>
|
|
154
|
+
</symbol>
|
|
155
|
+
|
|
156
|
+
<!-- List - Sections section -->
|
|
157
|
+
<symbol
|
|
158
|
+
id="icon-list"
|
|
159
|
+
viewBox="0 0 24 24"
|
|
160
|
+
fill="none"
|
|
161
|
+
stroke="currentColor"
|
|
162
|
+
stroke-width="2"
|
|
163
|
+
stroke-linecap="round"
|
|
164
|
+
stroke-linejoin="round"
|
|
165
|
+
>
|
|
166
|
+
<line
|
|
167
|
+
x1="8"
|
|
168
|
+
y1="6"
|
|
169
|
+
x2="21"
|
|
170
|
+
y2="6"
|
|
171
|
+
></line>
|
|
172
|
+
|
|
173
|
+
<line
|
|
174
|
+
x1="8"
|
|
175
|
+
y1="12"
|
|
176
|
+
x2="21"
|
|
177
|
+
y2="12"
|
|
178
|
+
></line>
|
|
179
|
+
|
|
180
|
+
<line
|
|
181
|
+
x1="8"
|
|
182
|
+
y1="18"
|
|
183
|
+
x2="21"
|
|
184
|
+
y2="18"
|
|
185
|
+
></line>
|
|
186
|
+
|
|
187
|
+
<line
|
|
188
|
+
x1="3"
|
|
189
|
+
y1="6"
|
|
190
|
+
x2="3.01"
|
|
191
|
+
y2="6"
|
|
192
|
+
></line>
|
|
193
|
+
|
|
194
|
+
<line
|
|
195
|
+
x1="3"
|
|
196
|
+
y1="12"
|
|
197
|
+
x2="3.01"
|
|
198
|
+
y2="12"
|
|
199
|
+
></line>
|
|
200
|
+
|
|
201
|
+
<line
|
|
202
|
+
x1="3"
|
|
203
|
+
y1="18"
|
|
204
|
+
x2="3.01"
|
|
205
|
+
y2="18"
|
|
206
|
+
></line>
|
|
207
|
+
</symbol>
|
|
208
|
+
</svg>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<%- if klass.type == 'class' && (ancestors = klass.super_classes).any? %>
|
|
2
|
+
<div id="parent-class-section" class="nav-section">
|
|
3
|
+
<details class="nav-section-collapsible" open>
|
|
4
|
+
<summary class="nav-section-header">
|
|
5
|
+
<span class="nav-section-icon">
|
|
6
|
+
<svg><use href="#icon-ancestors"></use></svg>
|
|
7
|
+
</span>
|
|
8
|
+
<span class="nav-section-title">Ancestors</span>
|
|
9
|
+
<span class="nav-section-chevron">
|
|
10
|
+
<svg><use href="#icon-chevron"></use></svg>
|
|
11
|
+
</span>
|
|
12
|
+
</summary>
|
|
13
|
+
<%= generate_ancestor_list(ancestors, klass) %>
|
|
14
|
+
</details>
|
|
15
|
+
</div>
|
|
16
|
+
<%- end %>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<div id="classindex-section" class="nav-section">
|
|
2
|
+
<details class="nav-section-collapsible" open>
|
|
3
|
+
<summary class="nav-section-header">
|
|
4
|
+
<span class="nav-section-icon">
|
|
5
|
+
<svg><use href="#icon-layers"></use></svg>
|
|
6
|
+
</span>
|
|
7
|
+
<span class="nav-section-title">Classes and Modules</span>
|
|
8
|
+
<span class="nav-section-chevron">
|
|
9
|
+
<svg><use href="#icon-chevron"></use></svg>
|
|
10
|
+
</span>
|
|
11
|
+
</summary>
|
|
12
|
+
|
|
13
|
+
<%= generate_class_index_content(@classes, rel_prefix) %>
|
|
14
|
+
</details>
|
|
15
|
+
</div>
|