rdoc 7.0.1 → 7.0.2
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/lib/rdoc/code_object/class_module.rb +5 -3
- data/lib/rdoc/generator/darkfish.rb +3 -1
- data/lib/rdoc/generator/template/aliki/class.rhtml +7 -7
- data/lib/rdoc/generator/template/aliki/css/rdoc.css +0 -1
- data/lib/rdoc/generator/template/aliki/index.rhtml +1 -1
- data/lib/rdoc/generator/template/aliki/js/aliki.js +24 -17
- data/lib/rdoc/generator/template/aliki/js/search_controller.js +9 -0
- data/lib/rdoc/generator/template/aliki/page.rhtml +1 -1
- data/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +1 -1
- data/lib/rdoc/generator/template/aliki/servlet_root.rhtml +1 -1
- data/lib/rdoc/generator/template/darkfish/class.rhtml +6 -6
- data/lib/rdoc/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e4554f502b1e5285ff99533998dcd2d234b6baa2523c8cba370cc01a1cbda0ed
|
|
4
|
+
data.tar.gz: e43dd25c7f053ff9d7961ce8f3e909cfac96630f0423acfcd7e79273face142b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8671e63c809b9dad72fdeb59e826e8957607997544e589cbbc14f76d803ed20781f51b4d89dba71070c2b6a87cba263967fe808e64c639467361585bacaacdd0
|
|
7
|
+
data.tar.gz: 826f81bfe0cf97176f2e2320980ed2f781723023642575092ffa3651b00fe232a922cef6aeecdb1f567a46d3cfb2e4d27afec9ed483d519f4e569228fe0d43fb
|
|
@@ -807,11 +807,13 @@ class RDoc::ClassModule < RDoc::Context
|
|
|
807
807
|
cm_alias = cm.dup
|
|
808
808
|
cm_alias.name = const.name
|
|
809
809
|
|
|
810
|
-
|
|
811
|
-
|
|
810
|
+
if full_name == 'Object'
|
|
811
|
+
# Don't move top-level aliases under Object, they look ugly there
|
|
812
|
+
cm_alias.parent = top_level
|
|
813
|
+
else
|
|
812
814
|
cm_alias.parent = self
|
|
813
|
-
cm_alias.full_name = nil # force update for new parent
|
|
814
815
|
end
|
|
816
|
+
cm_alias.full_name = nil # force update for new parent
|
|
815
817
|
|
|
816
818
|
cm_alias.aliases.clear
|
|
817
819
|
cm_alias.is_alias_for = cm
|
|
@@ -356,7 +356,9 @@ class RDoc::Generator::Darkfish
|
|
|
356
356
|
|
|
357
357
|
current = nil
|
|
358
358
|
|
|
359
|
-
|
|
359
|
+
# Document files are generated only for non-alias classes/modules
|
|
360
|
+
@classes.reject(&:is_alias_for).each do |klass|
|
|
361
|
+
|
|
360
362
|
current = klass
|
|
361
363
|
|
|
362
364
|
generate_class klass, template_file
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<%= render '_header.rhtml' %>
|
|
4
4
|
<%= render '_sidebar_toggle.rhtml' %>
|
|
5
5
|
|
|
6
|
-
<nav id="navigation" role="navigation">
|
|
6
|
+
<nav id="navigation" role="navigation" hidden>
|
|
7
7
|
<%= render '_sidebar_pages.rhtml' %>
|
|
8
8
|
<%= render '_sidebar_sections.rhtml' %>
|
|
9
9
|
<%= render '_sidebar_ancestors.rhtml' %>
|
|
@@ -110,10 +110,10 @@
|
|
|
110
110
|
</section>
|
|
111
111
|
<%- end %>
|
|
112
112
|
|
|
113
|
-
<%- klass.methods_by_type(section).each do |type, visibilities|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
113
|
+
<%- klass.methods_by_type(section).each do |type, visibilities| %>
|
|
114
|
+
<%- next if visibilities.empty? %>
|
|
115
|
+
<%- visibilities.each do |visibility, methods| %>
|
|
116
|
+
<%- next if methods.empty? %>
|
|
117
117
|
<section id="<%= visibility %>-<%= type %>-<%= section.aref %>-method-details" class="method-section anchor-link">
|
|
118
118
|
<header>
|
|
119
119
|
<h3 id="<%= visibility %>-<%= type %>-methods"><a href="#<%= visibility %>-<%= type %>-methods"><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</a></h3>
|
|
@@ -206,8 +206,8 @@
|
|
|
206
206
|
|
|
207
207
|
<%- end %>
|
|
208
208
|
</section>
|
|
209
|
-
<%- end
|
|
210
|
-
|
|
209
|
+
<%- end %>
|
|
210
|
+
<%- end %>
|
|
211
211
|
</section>
|
|
212
212
|
<%- end %>
|
|
213
213
|
</main>
|
|
@@ -67,15 +67,7 @@ function createSearchInstance(input, result) {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
search.select = function(result) {
|
|
70
|
-
|
|
71
|
-
const query = this.input.value;
|
|
72
|
-
if (query) {
|
|
73
|
-
const url = new URL(href, window.location.origin);
|
|
74
|
-
url.searchParams.set('q', query);
|
|
75
|
-
url.searchParams.set('nav', '0');
|
|
76
|
-
href = url.toString();
|
|
77
|
-
}
|
|
78
|
-
window.location.href = href;
|
|
70
|
+
window.location.href = result.firstChild.firstChild.href;
|
|
79
71
|
}
|
|
80
72
|
|
|
81
73
|
search.scrollIntoView = search.scrollInWindow;
|
|
@@ -97,15 +89,27 @@ function hookSearch() {
|
|
|
97
89
|
const search = createSearchInstance(input, result);
|
|
98
90
|
if (!search) return;
|
|
99
91
|
|
|
92
|
+
// Hide search results when clicking outside the search area
|
|
93
|
+
document.addEventListener('click', (e) => {
|
|
94
|
+
if (!e.target.closest('.navbar-search-desktop')) {
|
|
95
|
+
search.hide();
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
// Show search results when focusing on input (if there's a query)
|
|
100
|
+
input.addEventListener('focus', () => {
|
|
101
|
+
if (input.value.trim()) {
|
|
102
|
+
search.show();
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
100
106
|
// Check for ?q= URL parameter and trigger search automatically
|
|
101
107
|
if (typeof URLSearchParams !== 'undefined') {
|
|
102
108
|
const urlParams = new URLSearchParams(window.location.search);
|
|
103
109
|
const queryParam = urlParams.get('q');
|
|
104
110
|
if (queryParam) {
|
|
105
|
-
const navParam = urlParams.get('nav');
|
|
106
|
-
const autoSelect = navParam !== '0';
|
|
107
111
|
input.value = queryParam;
|
|
108
|
-
search.search(queryParam,
|
|
112
|
+
search.search(queryParam, false);
|
|
109
113
|
}
|
|
110
114
|
}
|
|
111
115
|
}
|
|
@@ -158,9 +162,12 @@ function hookSidebar() {
|
|
|
158
162
|
});
|
|
159
163
|
|
|
160
164
|
const isSmallViewport = window.matchMedia("(max-width: 1023px)").matches;
|
|
161
|
-
if (isSmallViewport) {
|
|
162
|
-
closeNav();
|
|
163
165
|
|
|
166
|
+
// The sidebar is hidden by default with the `hidden` attribute
|
|
167
|
+
// On large viewports, we display the sidebar with JavaScript
|
|
168
|
+
// This is better than the opposite approach of hiding it with JavaScript
|
|
169
|
+
// because it avoids flickering the sidebar when the page is loaded, especially on mobile devices
|
|
170
|
+
if (isSmallViewport) {
|
|
164
171
|
// Close nav when clicking links inside it
|
|
165
172
|
document.addEventListener('click', (e) => {
|
|
166
173
|
if (e.target.closest('#navigation a')) {
|
|
@@ -176,6 +183,8 @@ function hookSidebar() {
|
|
|
176
183
|
closeNav();
|
|
177
184
|
}
|
|
178
185
|
});
|
|
186
|
+
} else {
|
|
187
|
+
openNav();
|
|
179
188
|
}
|
|
180
189
|
}
|
|
181
190
|
|
|
@@ -378,9 +387,7 @@ function hookSearchModal() {
|
|
|
378
387
|
if (queryParam && isSmallViewport) {
|
|
379
388
|
openSearchModal();
|
|
380
389
|
searchInput.value = queryParam;
|
|
381
|
-
|
|
382
|
-
const autoSelect = navParam !== '0';
|
|
383
|
-
mobileSearch.search(queryParam, autoSelect);
|
|
390
|
+
mobileSearch.search(queryParam, false);
|
|
384
391
|
}
|
|
385
392
|
}
|
|
386
393
|
}
|
|
@@ -116,5 +116,14 @@ SearchController.prototype = Object.assign({}, SearchNavigation, new function()
|
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
this.hide = function() {
|
|
120
|
+
this.result.setAttribute('aria-expanded', 'false');
|
|
121
|
+
this.setNavigationActive(false);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
this.show = function() {
|
|
125
|
+
this.result.setAttribute('aria-expanded', 'true');
|
|
126
|
+
this.setNavigationActive(true);
|
|
127
|
+
}
|
|
119
128
|
});
|
|
120
129
|
|
|
@@ -117,10 +117,10 @@
|
|
|
117
117
|
</section>
|
|
118
118
|
<%- end %>
|
|
119
119
|
|
|
120
|
-
<%- klass.methods_by_type(section).each do |type, visibilities|
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
120
|
+
<%- klass.methods_by_type(section).each do |type, visibilities| %>
|
|
121
|
+
<%- next if visibilities.empty? %>
|
|
122
|
+
<%- visibilities.each do |visibility, methods| %>
|
|
123
|
+
<%- next if methods.empty? %>
|
|
124
124
|
<section id="<%= visibility %>-<%= type %>-<%= section.aref %>-method-details" class="method-section anchor-link">
|
|
125
125
|
<header>
|
|
126
126
|
<h3><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3>
|
|
@@ -213,8 +213,8 @@
|
|
|
213
213
|
|
|
214
214
|
<%- end %>
|
|
215
215
|
</section>
|
|
216
|
-
<%- end
|
|
217
|
-
|
|
216
|
+
<%- end %>
|
|
217
|
+
<%- end %>
|
|
218
218
|
</section>
|
|
219
219
|
<%- end %>
|
|
220
220
|
</main>
|
data/lib/rdoc/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rdoc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 7.0.
|
|
4
|
+
version: 7.0.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eric Hodel
|
|
@@ -13,7 +13,7 @@ authors:
|
|
|
13
13
|
- ITOYANAGI Sakura
|
|
14
14
|
bindir: exe
|
|
15
15
|
cert_chain: []
|
|
16
|
-
date: 2025-12-
|
|
16
|
+
date: 2025-12-22 00:00:00.000000000 Z
|
|
17
17
|
dependencies:
|
|
18
18
|
- !ruby/object:Gem::Dependency
|
|
19
19
|
name: psych
|