rdoc 6.16.1 → 6.17.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4714e3abeb6a0311e1571d60b94bd73313031928f083cf4210ea59972da2fa2f
4
- data.tar.gz: c16eded024105e7c746b9b61294699ab31b53e45ac74d0576c96243b09ce4816
3
+ metadata.gz: 2bb82d9eff1cf5ae3ee5276c97b12d57694d28c64a70ee9f318d4468c904999e
4
+ data.tar.gz: f7073f27e9b4a15e3b7792f777bb8b2bc991bde74409e15cdb5bd7be1900f2db
5
5
  SHA512:
6
- metadata.gz: cd1e0d7980fabb57130891c6d39db9ba83a1ab02d28feeaedae98a3e894d31e0c6bc6a57bc4006dd6e4677d74b433e7f1f1030eac40adc3d5e6810be2ac19692
7
- data.tar.gz: ed843f9890ad564647b3b5f5cae1b33afe1402a8647cdd6251704ea7ba768314f594e68e525e117be545334f415d4e07e8ff86edc70624a04f6e3a2c41ac9438
6
+ metadata.gz: 76a11b7a7529c4b008488ba22f4aa0c8c5dd2cbfff19ec795f0fa5f16e0d7c7f4913d69c2cc11d18653f8d0a4bde559f2b2a893b9dba9d8aec34faaec557b935
7
+ data.tar.gz: 5af47e79dc6fde12b8aa9809a0eb845db18031a907140484ea95ef16399a592c879445b8f725ae4eabfbfe5d3250656926698fa2a35b3426605420ca9961579f
@@ -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,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>
@@ -1,6 +1,16 @@
1
1
  <%- if klass.type == 'class' && (ancestors = klass.super_classes).any? %>
2
2
  <div id="parent-class-section" class="nav-section">
3
- <h3>Ancestors</h3>
4
- <%= generate_ancestor_list(ancestors, klass) %>
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>
5
15
  </div>
6
16
  <%- end %>
@@ -1,5 +1,15 @@
1
1
  <div id="classindex-section" class="nav-section">
2
- <h3>Class and Module Index</h3>
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>
3
12
 
4
- <%= generate_class_index_content(@classes, rel_prefix) %>
13
+ <%= generate_class_index_content(@classes, rel_prefix) %>
14
+ </details>
5
15
  </div>
@@ -1,15 +1,25 @@
1
1
  <%- unless klass.extends.empty? then %>
2
2
  <div id="extends-section" class="nav-section">
3
- <h3>Extended With Modules</h3>
3
+ <details class="nav-section-collapsible" open>
4
+ <summary class="nav-section-header">
5
+ <span class="nav-section-icon">
6
+ <svg><use href="#icon-extends"></use></svg>
7
+ </span>
8
+ <span class="nav-section-title">Extended With Modules</span>
9
+ <span class="nav-section-chevron">
10
+ <svg><use href="#icon-chevron"></use></svg>
11
+ </span>
12
+ </summary>
4
13
 
5
- <ul class="link-list">
6
- <%- klass.extends.each do |ext| %>
7
- <%- unless String === ext.module then %>
8
- <li><a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a></li>
9
- <%- else %>
10
- <li><span class="extend"><%= ext.name %></span></li>
11
- <%- end %>
12
- <%- end %>
13
- </ul>
14
+ <ul class="nav-list">
15
+ <%- klass.extends.each do |ext| %>
16
+ <%- unless String === ext.module then %>
17
+ <li><a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a></li>
18
+ <%- else %>
19
+ <li><span class="extend"><%= ext.name %></span></li>
20
+ <%- end %>
21
+ <%- end %>
22
+ </ul>
23
+ </details>
14
24
  </div>
15
25
  <%- end %>
@@ -1,15 +1,25 @@
1
1
  <%- unless klass.includes.empty? then %>
2
2
  <div id="includes-section" class="nav-section">
3
- <h3>Included Modules</h3>
3
+ <details class="nav-section-collapsible" open>
4
+ <summary class="nav-section-header">
5
+ <span class="nav-section-icon">
6
+ <svg><use href="#icon-includes"></use></svg>
7
+ </span>
8
+ <span class="nav-section-title">Included Modules</span>
9
+ <span class="nav-section-chevron">
10
+ <svg><use href="#icon-chevron"></use></svg>
11
+ </span>
12
+ </summary>
4
13
 
5
- <ul class="link-list">
6
- <%- klass.includes.each do |inc| %>
7
- <%- unless String === inc.module then %>
8
- <li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a></li>
9
- <%- else %>
10
- <li><span class="include"><%= inc.name %></span></li>
11
- <%- end %>
12
- <%- end %>
13
- </ul>
14
+ <ul class="nav-list">
15
+ <%- klass.includes.each do |inc| %>
16
+ <%- unless String === inc.module then %>
17
+ <li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a></li>
18
+ <%- else %>
19
+ <li><span class="include"><%= inc.name %></span></li>
20
+ <%- end %>
21
+ <%- end %>
22
+ </ul>
23
+ </details>
14
24
  </div>
15
25
  <%- end %>
@@ -1,21 +1,41 @@
1
1
  <% if (class_methods = klass.class_method_list.sort).any? %>
2
2
  <div class="nav-section">
3
- <h3>Class Methods</h3>
4
- <ul class="link-list" role="directory">
5
- <%- class_methods.each do |meth| %>
6
- <li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= h meth.name -%></a></li>
7
- <%- end %>
8
- </ul>
3
+ <details class="nav-section-collapsible" open>
4
+ <summary class="nav-section-header">
5
+ <span class="nav-section-icon">
6
+ <svg><use href="#icon-class-methods"></use></svg>
7
+ </span>
8
+ <span class="nav-section-title">Class Methods</span>
9
+ <span class="nav-section-chevron">
10
+ <svg><use href="#icon-chevron"></use></svg>
11
+ </span>
12
+ </summary>
13
+ <ul class="nav-list" role="directory">
14
+ <%- class_methods.each do |meth| %>
15
+ <li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= h meth.name -%></a></li>
16
+ <%- end %>
17
+ </ul>
18
+ </details>
9
19
  </div>
10
20
  <% end %>
11
21
 
12
22
  <% if (instance_methods = klass.instance_methods.sort).any? %>
13
23
  <div class="nav-section">
14
- <h3>Instance Methods</h3>
15
- <ul class="link-list" role="directory">
16
- <%- instance_methods.each do |meth| %>
17
- <li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= h meth.name -%></a></li>
18
- <%- end %>
19
- </ul>
24
+ <details class="nav-section-collapsible" open>
25
+ <summary class="nav-section-header">
26
+ <span class="nav-section-icon">
27
+ <svg><use href="#icon-instance-methods"></use></svg>
28
+ </span>
29
+ <span class="nav-section-title">Instance Methods</span>
30
+ <span class="nav-section-chevron">
31
+ <svg><use href="#icon-chevron"></use></svg>
32
+ </span>
33
+ </summary>
34
+ <ul class="nav-list" role="directory">
35
+ <%- instance_methods.each do |meth| %>
36
+ <li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= h meth.name -%></a></li>
37
+ <%- end %>
38
+ </ul>
39
+ </details>
20
40
  </div>
21
41
  <% end %>
@@ -1,37 +1,67 @@
1
1
  <%- simple_files = @files.select { |f| f.text? } %>
2
+
2
3
  <%- if defined?(current) && current.respond_to?(:page_name) %>
3
4
  <%- dir = current.full_name[%r{\A[^/]+(?=/)}] || current.page_name %>
4
5
  <%- end %>
6
+
5
7
  <%- unless simple_files.empty? then %>
6
8
  <div id="fileindex-section" class="nav-section">
7
- <h3>Pages</h3>
8
-
9
- <ul class="link-list">
10
- <%- grouped_files = simple_files.group_by { |f| f.full_name[%r{\A[^/]+(?=/)}] || f.page_name } %>
11
- <%- grouped_files.each do |n, files| %>
12
- <%- f = files.shift %>
13
- <%- if files.empty? %>
14
- <li><a href="<%= rel_prefix %>/<%= h f.path %>"><%= h f.page_name %></a></li>
15
- <%- next %>
16
- <%- end %>
17
- <li>
18
- <details <%= dir == n ? ' open' : '' %>>
19
- <summary>
20
- <% if n == f.page_name %>
21
- <a href="<%= rel_prefix %>/<%= h f.path %>"><%= h n %></a>
22
- <% else %>
23
- <%= h n %>
24
- <% files.unshift(f) %>
25
- <% end %>
26
- </summary>
27
- <ul class="link-list">
28
- <%- files.each do |f| %>
29
- <li><a href="<%= rel_prefix %>/<%= h f.path %>"><%= h f.page_name %></a></li>
9
+ <details class="nav-section-collapsible" <%= 'open' unless @inside_class_file %>>
10
+ <summary class="nav-section-header">
11
+ <span class="nav-section-icon">
12
+ <svg>
13
+ <use href="#icon-file"></use>
14
+ </svg>
15
+ </span>
16
+
17
+ <span class="nav-section-title">Pages</span>
18
+
19
+ <span class="nav-section-chevron">
20
+ <svg>
21
+ <use href="#icon-chevron"></use>
22
+ </svg>
23
+ </span>
24
+ </summary>
25
+
26
+ <ul class="nav-list">
27
+ <%- grouped_files = simple_files.group_by { |f| f.full_name[%r{\A[^/]+(?=/)}] || f.page_name } %>
28
+
29
+ <%- grouped_files.each do |n, files| %>
30
+ <%- f = files.shift %>
31
+
32
+ <%- if files.empty? %>
33
+ <li>
34
+ <a href="<%= rel_prefix %>/<%= h f.path %>">
35
+ <%= h f.page_name %>
36
+ </a>
37
+ </li>
38
+ <%- next %>
30
39
  <%- end %>
31
- </ul>
32
- </details>
33
- </li>
34
- <%- end %>
35
- </ul>
40
+
41
+ <li>
42
+ <details <%= dir == n ? ' open' : '' %>>
43
+ <summary>
44
+ <% if n == f.page_name %>
45
+ <a href="<%= rel_prefix %>/<%= h f.path %>"><%= h n %></a>
46
+ <% else %>
47
+ <%= h n %>
48
+ <% files.unshift(f) %>
49
+ <% end %>
50
+ </summary>
51
+
52
+ <ul class="link-list">
53
+ <%- files.each do |f| %>
54
+ <li>
55
+ <a href="<%= rel_prefix %>/<%= h f.path %>">
56
+ <%= h f.page_name %>
57
+ </a>
58
+ </li>
59
+ <%- end %>
60
+ </ul>
61
+ </details>
62
+ </li>
63
+ <%- end %>
64
+ </ul>
65
+ </details>
36
66
  </div>
37
67
  <%- end %>
@@ -1,11 +1,21 @@
1
1
  <%- unless klass.sections.length == 1 then %>
2
2
  <div id="sections-section" class="nav-section">
3
- <h3>Sections</h3>
3
+ <details class="nav-section-collapsible" open>
4
+ <summary class="nav-section-header">
5
+ <span class="nav-section-icon">
6
+ <svg><use href="#icon-list"></use></svg>
7
+ </span>
8
+ <span class="nav-section-title">Sections</span>
9
+ <span class="nav-section-chevron">
10
+ <svg><use href="#icon-chevron"></use></svg>
11
+ </span>
12
+ </summary>
4
13
 
5
- <ul class="link-list" role="directory">
6
- <%- klass.sort_sections.each do |section| %>
7
- <li><a href="#<%= section.aref %>"><%= h section.title %></a></li>
8
- <%- end %>
9
- </ul>
14
+ <ul class="nav-list" role="directory">
15
+ <%- klass.sort_sections.each do |section| %>
16
+ <li><a href="#<%= section.aref %>"><%= h section.title %></a></li>
17
+ <%- end %>
18
+ </ul>
19
+ </details>
10
20
  </div>
11
21
  <%- end %>
@@ -1,4 +1,5 @@
1
1
  <body role="document" class="<%= klass.type %> has-toc">
2
+ <%= render '_icons.rhtml' %>
2
3
  <%= render '_header.rhtml' %>
3
4
  <%= render '_sidebar_toggle.rhtml' %>
4
5
 
@@ -146,8 +146,8 @@
146
146
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 10%), 0 8px 10px -6px rgb(0 0 0 / 10%);
147
147
 
148
148
  /* Layout Dimensions */
149
- --layout-sidebar-width: 280px;
150
- --layout-sidebar-width-min: 240px;
149
+ --layout-sidebar-width: 300px;
150
+ --layout-sidebar-width-min: 300px;
151
151
  --layout-sidebar-width-max: 15%;
152
152
  --layout-toc-width-min: 240px;
153
153
  --layout-toc-width-max: 18%;
@@ -228,13 +228,13 @@ body {
228
228
 
229
229
  /* Grid layout with header, sidebar, main, and footer */
230
230
  display: grid;
231
- grid-template: "header header" var(--layout-header-height) "nav main" 1fr "nav footer" auto / minmax(var(--layout-sidebar-width-min), var(--layout-sidebar-width-max)) 1fr;
231
+ grid-template: "header header" var(--layout-header-height) "nav main" 1fr "nav footer" auto / var(--layout-sidebar-width) 1fr;
232
232
  min-height: 100vh;
233
233
  }
234
234
 
235
235
  /* Three-column layout when TOC is present */
236
236
  body.has-toc {
237
- grid-template: "header header header" var(--layout-header-height) "nav main toc" 1fr "nav footer toc" auto / minmax(var(--layout-sidebar-width-min), var(--layout-sidebar-width-max)) 1fr minmax(var(--layout-toc-width-min), var(--layout-toc-width-max));
237
+ grid-template: "header header header" var(--layout-header-height) "nav main toc" 1fr "nav footer toc" auto / var(--layout-sidebar-width) 1fr minmax(var(--layout-toc-width-min), var(--layout-toc-width-max));
238
238
  min-height: 100vh;
239
239
  }
240
240
 
@@ -542,7 +542,6 @@ nav {
542
542
  position: sticky;
543
543
  top: var(--layout-header-height);
544
544
  height: calc(100vh - var(--layout-header-height));
545
- align-self: start;
546
545
  }
547
546
 
548
547
  /* Mobile navigation */
@@ -664,6 +663,8 @@ nav footer a {
664
663
  cursor: pointer;
665
664
  transition: color var(--transition-fast);
666
665
  line-height: 1;
666
+ user-select: none;
667
+ -webkit-user-select: none;
667
668
  }
668
669
 
669
670
  #navigation-toggle:hover {
@@ -671,31 +672,148 @@ nav footer a {
671
672
  }
672
673
  }
673
674
 
674
- nav ul li details > summary {
675
- list-style: none; /* Remove the default marker */
676
- position: relative; /* So that the open/close triangle can position itself absolutely inside */
675
+ /*
676
+ * Shared Collapsible Animation using ::details-content pseudo-element.
677
+ * This is the modern CSS approach for animating <details> elements.
678
+ * Uses block-size animation with interpolate-size for smooth height transitions.
679
+ * Both nav-section-collapsible and nested link-list details share this pattern.
680
+ */
681
+ nav details {
682
+ interpolate-size: allow-keywords;
677
683
  }
678
684
 
679
- nav ul li details > summary::-webkit-details-marker {
680
- display: none; /* Removes the default marker, in Safari 18. */
685
+ nav details::details-content {
686
+ overflow: hidden;
687
+ block-size: 0;
688
+ transition: block-size 200ms ease, content-visibility 200ms ease allow-discrete;
681
689
  }
682
690
 
683
- nav ul li details > summary::after {
684
- content: '▶'; /* Unicode right-pointing triangle */
685
- position: absolute;
686
- font-size: 0.8em;
687
- bottom: 0.1em;
688
- margin-left: 0.3em;
691
+ nav details[open]::details-content {
692
+ block-size: auto;
693
+ }
694
+
695
+ /* Collapsible Navigation Section Headers */
696
+
697
+ nav .nav-section-header {
698
+ display: flex;
699
+ align-items: center;
700
+ gap: var(--space-3);
701
+ padding: var(--space-3) 0;
702
+ cursor: pointer;
703
+ list-style: none;
704
+ user-select: none;
705
+ -webkit-user-select: none;
706
+ border-bottom: 1px solid var(--color-border-default);
707
+ margin-bottom: var(--space-3);
708
+ transition: color var(--transition-fast);
709
+ }
710
+
711
+ nav .nav-section-header::-webkit-details-marker {
712
+ display: none;
713
+ }
714
+
715
+ nav .nav-section-header:hover {
716
+ color: var(--color-accent-primary);
717
+ }
718
+
719
+ nav .nav-section-icon {
720
+ display: flex;
721
+ align-items: center;
722
+ justify-content: center;
723
+ width: 1.25rem;
724
+ height: 1.25rem;
725
+ flex-shrink: 0;
726
+ color: var(--color-accent-primary);
727
+ }
728
+
729
+ nav .nav-section-icon svg {
730
+ width: 100%;
731
+ height: 100%;
732
+ }
733
+
734
+ nav .nav-section-title {
735
+ font-size: var(--font-size-base);
736
+ font-weight: var(--font-weight-semibold);
737
+ color: inherit;
738
+ }
739
+
740
+ nav .nav-section-chevron {
741
+ display: flex;
742
+ align-items: center;
743
+ justify-content: center;
744
+ width: 1rem;
745
+ height: 1rem;
746
+ flex-shrink: 0;
747
+ color: var(--color-text-tertiary);
689
748
  transition: transform var(--transition-base);
690
749
  }
691
750
 
692
- nav ul li details[open] > summary::after {
693
- transform: rotate(90deg); /* Rotate the triangle when open */
751
+ nav .nav-section-chevron svg {
752
+ width: 100%;
753
+ height: 100%;
694
754
  }
695
755
 
696
- /* Global link hover state is defined after navigation to keep specificity ordering */
697
- a:hover {
698
- color: var(--color-link-hover);
756
+ /* Rotate chevron when open */
757
+ nav .nav-section-collapsible[open] > .nav-section-header .nav-section-chevron {
758
+ transform: rotate(90deg);
759
+ }
760
+
761
+ nav .nav-section-collapsible > ul,
762
+ nav .nav-section-collapsible > dl,
763
+ nav .nav-section-collapsible > p {
764
+ margin-top: 0;
765
+ }
766
+
767
+ nav .nav-section-collapsible > .nav-list {
768
+ padding-left: var(--space-5);
769
+ border-left: 1px solid var(--color-border-subtle);
770
+ margin-left: 9px; /* Align with the section icon center */
771
+ }
772
+
773
+ nav .nav-section-collapsible .nav-list .link-list {
774
+ border-left: none;
775
+ margin-left: 0;
776
+ padding-left: var(--space-5);
777
+ }
778
+
779
+ /*
780
+ Improve chevron styling for details under link-list, using SVG chevron that matches nav-section-chevron
781
+ We need to avoid adding the element in class content generation so it doesn't break darkfish styles
782
+ */
783
+ nav li details:has(.link-list) > summary {
784
+ display: inline-flex;
785
+ align-items: center;
786
+ gap: var(--space-2);
787
+ cursor: pointer;
788
+ }
789
+
790
+ nav li details:has(.link-list) > summary::after {
791
+ content: '';
792
+ position: static;
793
+ display: inline-block;
794
+ width: 1rem;
795
+ height: 1rem;
796
+ flex-shrink: 0;
797
+ margin-left: 0;
798
+ background-color: var(--color-text-secondary);
799
+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
800
+ mask-size: contain;
801
+ mask-repeat: no-repeat;
802
+ mask-position: center;
803
+ -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='9 18 15 12 9 6'%3E%3C/polyline%3E%3C/svg%3E");
804
+ -webkit-mask-size: contain;
805
+ -webkit-mask-repeat: no-repeat;
806
+ -webkit-mask-position: center;
807
+ transition: transform var(--transition-base), background-color var(--transition-fast);
808
+ }
809
+
810
+ nav li details:has(.link-list) > summary:hover::after {
811
+ background-color: var(--color-accent-primary);
812
+ }
813
+
814
+ nav li details:has(.link-list)[open] > summary::after {
815
+ transform: rotate(90deg);
816
+ background-color: var(--color-accent-primary);
699
817
  }
700
818
 
701
819
  /* 8. Main Content (Center Column) */
@@ -1001,6 +1119,8 @@ main .method-source-code {
1001
1119
 
1002
1120
  main .method-source-code pre {
1003
1121
  border-color: var(--color-accent-hover);
1122
+ width: 100%;
1123
+ box-sizing: border-box;
1004
1124
  }
1005
1125
 
1006
1126
  main .method-source-code.active-menu {
@@ -1025,6 +1145,7 @@ main .method-detail:target {
1025
1145
 
1026
1146
  main .method-header {
1027
1147
  display: inline-block;
1148
+ max-width: calc(100% - 6em); /* 6em is the width of the source code toggle */
1028
1149
  }
1029
1150
 
1030
1151
  main .method-heading {
@@ -1316,6 +1437,14 @@ aside.table-of-contents .toc-sticky nav {
1316
1437
  height: auto;
1317
1438
  }
1318
1439
 
1440
+ aside.table-of-contents .toc-list > .toc-h2 {
1441
+ margin-left: var(--space-4);
1442
+ }
1443
+
1444
+ aside.table-of-contents .toc-list > .toc-h3 {
1445
+ margin-left: var(--space-8);
1446
+ }
1447
+
1319
1448
  /* Hide TOC on mobile/tablet */
1320
1449
  @media (width <= 1279px) {
1321
1450
  aside.table-of-contents {
@@ -1323,7 +1452,7 @@ aside.table-of-contents .toc-sticky nav {
1323
1452
  }
1324
1453
 
1325
1454
  body.has-toc {
1326
- grid-template-columns: minmax(var(--layout-sidebar-width-min), var(--layout-sidebar-width-max)) 1fr;
1455
+ grid-template-columns: var(--layout-sidebar-width) 1fr;
1327
1456
  grid-template-areas:
1328
1457
  "header header"
1329
1458
  "nav main"
@@ -1333,10 +1462,6 @@ aside.table-of-contents .toc-sticky nav {
1333
1462
 
1334
1463
  /* Tablet adjustments (between mobile and desktop) */
1335
1464
  @media (width >= 768px) and (width <= 1023px) {
1336
- nav {
1337
- width: 240px;
1338
- }
1339
-
1340
1465
  header.top-navbar {
1341
1466
  padding: 0 var(--space-6);
1342
1467
  }
@@ -1,4 +1,5 @@
1
1
  <body role="document" class="file has-toc">
2
+ <%= render '_icons.rhtml' %>
2
3
  <%= render '_header.rhtml' %>
3
4
  <%= render '_sidebar_toggle.rhtml' %>
4
5
 
@@ -1,4 +1,5 @@
1
1
  <body role="document" class="file has-toc">
2
+ <%= render '_icons.rhtml' %>
2
3
  <%= render '_header.rhtml' %>
3
4
  <%= render '_sidebar_toggle.rhtml' %>
4
5
 
@@ -81,6 +81,10 @@ class RDoc::Markup::ToAnsi < RDoc::Markup::ToRdoc
81
81
  end
82
82
  end
83
83
 
84
+ def calculate_text_width(text)
85
+ text.gsub(/\e\[[\d;]*m/, '').size
86
+ end
87
+
84
88
  ##
85
89
  # Starts accepting with a reset screen
86
90
 
@@ -65,6 +65,10 @@ class RDoc::Markup::ToBs < RDoc::Markup::ToRdoc
65
65
  end
66
66
  end
67
67
 
68
+ def calculate_text_width(text)
69
+ text.gsub(/_\x08/, '').gsub(/\x08./, '').size
70
+ end
71
+
68
72
  ##
69
73
  # Turns on or off regexp handling for +convert_string+
70
74
 
@@ -250,8 +250,10 @@ class RDoc::Markup::ToRdoc < RDoc::Markup::Formatter
250
250
  # Adds +table+ to the output
251
251
 
252
252
  def accept_table(header, body, aligns)
253
+ header = header.map { |h| attributes h }
254
+ body = body.map { |row| row.map { |t| attributes t } }
253
255
  widths = header.zip(*body).map do |cols|
254
- cols.map(&:size).max
256
+ cols.map { |col| calculate_text_width(col) }.max
255
257
  end
256
258
  aligns = aligns.map do |a|
257
259
  case a
@@ -264,16 +266,22 @@ class RDoc::Markup::ToRdoc < RDoc::Markup::Formatter
264
266
  end
265
267
  end
266
268
  @res << header.zip(widths, aligns).map do |h, w, a|
267
- h.__send__(a, w)
269
+ extra_width = h.size - calculate_text_width(h)
270
+ h.__send__(a, w + extra_width)
268
271
  end.join("|").rstrip << "\n"
269
272
  @res << widths.map {|w| "-" * w }.join("|") << "\n"
270
273
  body.each do |row|
271
274
  @res << row.zip(widths, aligns).map do |t, w, a|
272
- t.__send__(a, w)
275
+ extra_width = t.size - calculate_text_width(t)
276
+ t.__send__(a, w + extra_width)
273
277
  end.join("|").rstrip << "\n"
274
278
  end
275
279
  end
276
280
 
281
+ def calculate_text_width(text)
282
+ text.size
283
+ end
284
+
277
285
  ##
278
286
  # Applies attribute-specific markup to +text+ using RDoc::AttributeManager
279
287
 
data/lib/rdoc/version.rb CHANGED
@@ -5,6 +5,6 @@ module RDoc
5
5
  ##
6
6
  # RDoc version you are using
7
7
 
8
- VERSION = '6.16.1'
8
+ VERSION = '6.17.0'
9
9
 
10
10
  end
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: 6.16.1
4
+ version: 6.17.0
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-11-28 00:00:00.000000000 Z
16
+ date: 2025-12-07 00:00:00.000000000 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: psych
@@ -137,6 +137,7 @@ files:
137
137
  - lib/rdoc/generator/template/aliki/_footer.rhtml
138
138
  - lib/rdoc/generator/template/aliki/_head.rhtml
139
139
  - lib/rdoc/generator/template/aliki/_header.rhtml
140
+ - lib/rdoc/generator/template/aliki/_icons.rhtml
140
141
  - lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml
141
142
  - lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml
142
143
  - lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml