rdoc 7.2.0 → 8.0.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 +4 -4
- data/CONTRIBUTING.md +3 -4
- data/LICENSE.rdoc +4 -0
- data/README.md +43 -2
- data/doc/markup_reference/markdown.md +104 -3
- data/lib/rdoc/code_object/alias.rb +2 -8
- data/lib/rdoc/code_object/any_method.rb +11 -6
- data/lib/rdoc/code_object/attr.rb +11 -6
- data/lib/rdoc/code_object/class_module.rb +62 -32
- data/lib/rdoc/code_object/constant.rb +29 -3
- data/lib/rdoc/code_object/context/section.rb +4 -35
- data/lib/rdoc/code_object/context.rb +39 -34
- data/lib/rdoc/code_object/method_attr.rb +9 -15
- data/lib/rdoc/code_object/mixin.rb +2 -2
- data/lib/rdoc/code_object/top_level.rb +9 -3
- data/lib/rdoc/code_object.rb +2 -4
- data/lib/rdoc/comment.rb +0 -65
- data/lib/rdoc/cross_reference.rb +7 -27
- data/lib/rdoc/encoding.rb +3 -3
- data/lib/rdoc/generator/aliki.rb +17 -0
- data/lib/rdoc/generator/darkfish.rb +12 -6
- data/lib/rdoc/generator/json_index.rb +2 -2
- data/lib/rdoc/generator/markup.rb +56 -31
- data/lib/rdoc/generator/template/aliki/DESIGN.md +536 -0
- data/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +1 -1
- data/lib/rdoc/generator/template/aliki/_head.rhtml +1 -1
- data/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +8 -6
- data/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +8 -6
- data/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +1 -1
- data/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +2 -2
- data/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +1 -1
- data/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +1 -1
- data/lib/rdoc/generator/template/aliki/class.rhtml +56 -46
- data/lib/rdoc/generator/template/aliki/css/rdoc.css +337 -111
- data/lib/rdoc/generator/template/aliki/index.rhtml +1 -1
- data/lib/rdoc/generator/template/aliki/js/aliki.js +20 -18
- 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 +2 -2
- data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +8 -6
- data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +8 -6
- data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +1 -1
- data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +1 -1
- data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +1 -1
- data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +5 -5
- data/lib/rdoc/generator/template/darkfish/class.rhtml +18 -21
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +0 -1
- data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +3 -3
- data/lib/rdoc/i18n/text.rb +3 -3
- data/lib/rdoc/markdown.kpeg +15 -10
- data/lib/rdoc/markdown.rb +289 -104
- data/lib/rdoc/markup/document.rb +2 -2
- data/lib/rdoc/markup/formatter.rb +24 -34
- data/lib/rdoc/markup/heading.rb +1 -4
- data/lib/rdoc/markup/indented_paragraph.rb +1 -1
- data/lib/rdoc/markup/list.rb +2 -2
- data/lib/rdoc/markup/list_item.rb +2 -2
- data/lib/rdoc/markup/pre_process.rb +0 -25
- data/lib/rdoc/markup/to_ansi.rb +1 -1
- data/lib/rdoc/markup/to_bs.rb +1 -1
- data/lib/rdoc/markup/to_html.rb +131 -53
- data/lib/rdoc/markup/to_html_crossref.rb +97 -71
- data/lib/rdoc/markup/to_html_snippet.rb +5 -5
- data/lib/rdoc/markup/to_joined_paragraph.rb +0 -5
- data/lib/rdoc/markup/to_label.rb +2 -2
- data/lib/rdoc/markup/to_markdown.rb +1 -1
- data/lib/rdoc/markup/to_rdoc.rb +2 -2
- data/lib/rdoc/markup/to_table_of_contents.rb +1 -1
- data/lib/rdoc/markup/to_tt_only.rb +0 -7
- data/lib/rdoc/markup/verbatim.rb +1 -1
- data/lib/rdoc/options.rb +36 -51
- data/lib/rdoc/parser/c.rb +7 -6
- data/lib/rdoc/parser/rbs.rb +275 -0
- data/lib/rdoc/parser/ruby.rb +954 -2066
- data/lib/rdoc/parser/ruby_colorizer.rb +253 -0
- data/lib/rdoc/parser.rb +3 -2
- data/lib/rdoc/rbs_helper.rb +186 -0
- data/lib/rdoc/rdoc.rb +196 -24
- data/lib/rdoc/ri/driver.rb +8 -2
- data/lib/rdoc/ri/paths.rb +1 -1
- data/lib/rdoc/{servlet.rb → ri/servlet.rb} +5 -5
- data/lib/rdoc/ri.rb +4 -3
- data/lib/rdoc/rubygems_hook.rb +11 -11
- data/lib/rdoc/server.rb +460 -0
- data/lib/rdoc/stats.rb +147 -124
- data/lib/rdoc/store.rb +212 -4
- data/lib/rdoc/task.rb +16 -15
- data/lib/rdoc/text.rb +1 -118
- data/lib/rdoc/token_stream.rb +11 -33
- data/lib/rdoc/version.rb +1 -1
- data/lib/rdoc.rb +35 -7
- data/lib/rubygems_plugin.rb +2 -11
- data/rdoc-logo.svg +43 -0
- data/rdoc.gemspec +6 -4
- metadata +35 -18
- data/lib/rdoc/code_object/anon_class.rb +0 -10
- data/lib/rdoc/code_object/ghost_method.rb +0 -6
- data/lib/rdoc/code_object/meta_method.rb +0 -6
- data/lib/rdoc/parser/prism_ruby.rb +0 -1112
- data/lib/rdoc/parser/ripper_state_lex.rb +0 -302
- data/lib/rdoc/parser/ruby_tools.rb +0 -163
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<%= render '_header.rhtml' %>
|
|
4
4
|
<%= render '_sidebar_toggle.rhtml' %>
|
|
5
5
|
|
|
6
|
-
<nav id="navigation" role="navigation" hidden>
|
|
6
|
+
<nav id="sidebar-navigation" role="navigation" hidden>
|
|
7
7
|
<%= render '_sidebar_pages.rhtml' %>
|
|
8
8
|
<%= render '_sidebar_classes.rhtml' %>
|
|
9
9
|
</nav>
|
|
@@ -137,32 +137,32 @@ function hookFocus() {
|
|
|
137
137
|
/* ===== Mobile Navigation ===== */
|
|
138
138
|
|
|
139
139
|
function hookSidebar() {
|
|
140
|
-
const
|
|
141
|
-
const
|
|
140
|
+
const sidebarNavigation = document.querySelector('#sidebar-navigation');
|
|
141
|
+
const sidebarNavigationToggle = document.querySelector('#sidebar-navigation-toggle');
|
|
142
142
|
|
|
143
|
-
if (!
|
|
143
|
+
if (!sidebarNavigation || !sidebarNavigationToggle) return;
|
|
144
144
|
|
|
145
145
|
const closeNav = () => {
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
document.body.classList.remove('
|
|
146
|
+
sidebarNavigation.hidden = true;
|
|
147
|
+
sidebarNavigationToggle.ariaExpanded = 'false';
|
|
148
|
+
document.body.classList.remove('sidebar-navigation-open');
|
|
149
149
|
};
|
|
150
150
|
|
|
151
151
|
const openNav = () => {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
document.body.classList.add('
|
|
152
|
+
sidebarNavigation.hidden = false;
|
|
153
|
+
sidebarNavigationToggle.ariaExpanded = 'true';
|
|
154
|
+
document.body.classList.add('sidebar-navigation-open');
|
|
155
155
|
};
|
|
156
156
|
|
|
157
157
|
const toggleNav = () => {
|
|
158
|
-
if (
|
|
158
|
+
if (sidebarNavigation.hidden) {
|
|
159
159
|
openNav();
|
|
160
160
|
} else {
|
|
161
161
|
closeNav();
|
|
162
162
|
}
|
|
163
163
|
};
|
|
164
164
|
|
|
165
|
-
|
|
165
|
+
sidebarNavigationToggle.addEventListener('click', (e) => {
|
|
166
166
|
e.stopPropagation();
|
|
167
167
|
toggleNav();
|
|
168
168
|
});
|
|
@@ -174,18 +174,20 @@ function hookSidebar() {
|
|
|
174
174
|
// This is better than the opposite approach of hiding it with JavaScript
|
|
175
175
|
// because it avoids flickering the sidebar when the page is loaded, especially on mobile devices
|
|
176
176
|
if (isSmallViewport) {
|
|
177
|
+
closeNav();
|
|
178
|
+
|
|
177
179
|
// Close nav when clicking links inside it
|
|
178
180
|
document.addEventListener('click', (e) => {
|
|
179
|
-
if (e.target.closest('#navigation a')) {
|
|
181
|
+
if (e.target.closest('#sidebar-navigation a')) {
|
|
180
182
|
closeNav();
|
|
181
183
|
}
|
|
182
184
|
});
|
|
183
185
|
|
|
184
186
|
// Close nav when clicking backdrop
|
|
185
187
|
document.addEventListener('click', (e) => {
|
|
186
|
-
if (!
|
|
187
|
-
!e.target.closest('#navigation') &&
|
|
188
|
-
!e.target.closest('#navigation-toggle')) {
|
|
188
|
+
if (!sidebarNavigation.hidden &&
|
|
189
|
+
!e.target.closest('#sidebar-navigation') &&
|
|
190
|
+
!e.target.closest('#sidebar-navigation-toggle')) {
|
|
189
191
|
closeNav();
|
|
190
192
|
}
|
|
191
193
|
});
|
|
@@ -233,7 +235,7 @@ function generateToc() {
|
|
|
233
235
|
tocNav.appendChild(tocList);
|
|
234
236
|
} else {
|
|
235
237
|
// Hide TOC if no headings found
|
|
236
|
-
const tocContainer = document.querySelector('
|
|
238
|
+
const tocContainer = document.querySelector('#table-of-contents');
|
|
237
239
|
if (tocContainer) {
|
|
238
240
|
tocContainer.style.display = 'none';
|
|
239
241
|
}
|
|
@@ -435,8 +437,8 @@ function wrapCodeBlocksWithCopyButton() {
|
|
|
435
437
|
// not directly in rhtml templates
|
|
436
438
|
// - Modifying the formatter would require extending RDoc's core internals
|
|
437
439
|
|
|
438
|
-
//
|
|
439
|
-
const preElements = document.querySelectorAll('main pre:not(.
|
|
440
|
+
// Target code examples and source code; skip type signature blocks
|
|
441
|
+
const preElements = document.querySelectorAll('main pre:not(.method-type-signature)');
|
|
440
442
|
|
|
441
443
|
preElements.forEach((pre) => {
|
|
442
444
|
// Skip if already wrapped
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<%= render '_header.rhtml' %>
|
|
4
4
|
<%= render '_sidebar_toggle.rhtml' %>
|
|
5
5
|
|
|
6
|
-
<nav id="navigation" role="navigation" hidden>
|
|
6
|
+
<nav id="sidebar-navigation" role="navigation" hidden>
|
|
7
7
|
<%= render '_sidebar_pages.rhtml' %>
|
|
8
8
|
<%= render '_sidebar_classes.rhtml' %>
|
|
9
9
|
</nav>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<body role="document">
|
|
2
2
|
<%= render '_sidebar_toggle.rhtml' %>
|
|
3
3
|
|
|
4
|
-
<nav id="navigation" role="navigation" hidden>
|
|
4
|
+
<nav id="sidebar-navigation" role="navigation" hidden>
|
|
5
5
|
<div id="project-navigation">
|
|
6
6
|
<div id="home-section" class="nav-section">
|
|
7
7
|
<h2>
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
|
|
43
43
|
<%- gems = installed.select { |_, _, _, type,| type == :gem } %>
|
|
44
44
|
<%- missing = gems.reject { |_, _, exists,| exists } %>
|
|
45
|
-
<%- unless missing.empty?
|
|
45
|
+
<%- unless missing.empty? %>
|
|
46
46
|
<h2>Missing Gem Documentation</h2>
|
|
47
47
|
|
|
48
48
|
<p>You are missing documentation for some of your installed gems.
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
<%- unless klass.extends.empty?
|
|
1
|
+
<%- unless klass.extends.empty? %>
|
|
2
2
|
<div id="extends-section" class="nav-section">
|
|
3
3
|
<h3>Extended With Modules</h3>
|
|
4
4
|
|
|
5
5
|
<ul class="link-list">
|
|
6
6
|
<%- klass.extends.each do |ext| %>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
<li>
|
|
8
|
+
<%- unless String === ext.module %>
|
|
9
|
+
<a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a>
|
|
10
|
+
<%- else %>
|
|
11
|
+
<span class="extend"><%= ext.name %></span>
|
|
12
|
+
<%- end %>
|
|
13
|
+
</li>
|
|
12
14
|
<%- end %>
|
|
13
15
|
</ul>
|
|
14
16
|
</div>
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
<%- unless klass.includes.empty?
|
|
1
|
+
<%- unless klass.includes.empty? %>
|
|
2
2
|
<div id="includes-section" class="nav-section">
|
|
3
3
|
<h3>Included Modules</h3>
|
|
4
4
|
|
|
5
5
|
<ul class="link-list">
|
|
6
6
|
<%- klass.includes.each do |inc| %>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
<li>
|
|
8
|
+
<%- unless String === inc.module %>
|
|
9
|
+
<a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a>
|
|
10
|
+
<%- else %>
|
|
11
|
+
<span class="include"><%= inc.name %></span>
|
|
12
|
+
<%- end %>
|
|
13
|
+
</li>
|
|
12
14
|
<%- end %>
|
|
13
15
|
</ul>
|
|
14
16
|
</div>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
<%- comment = if current.respond_to? :comment_location
|
|
1
|
+
<%- comment = if current.respond_to? :comment_location
|
|
2
2
|
current.comment_location
|
|
3
3
|
else
|
|
4
4
|
current.comment
|
|
5
5
|
end
|
|
6
6
|
table = current.parse(comment).table_of_contents.dup
|
|
7
7
|
|
|
8
|
-
if table.length > 1
|
|
8
|
+
if table.length > 1 %>
|
|
9
9
|
<div class="nav-section">
|
|
10
10
|
<h3>Table of Contents</h3>
|
|
11
11
|
|
|
@@ -17,18 +17,18 @@
|
|
|
17
17
|
<%- level = table.first&.level %>
|
|
18
18
|
<%- while table.first && table.first.level >= level %>
|
|
19
19
|
<%- heading = table.shift %>
|
|
20
|
+
<li>
|
|
20
21
|
<%- if table.first.nil? || table.first.level <= heading.level %>
|
|
21
|
-
|
|
22
|
+
<% display_link.call heading %>
|
|
22
23
|
<%- else %>
|
|
23
|
-
<li>
|
|
24
24
|
<details open>
|
|
25
25
|
<summary><%- display_link.call heading %></summary>
|
|
26
26
|
<ul class="link-list" role="directory">
|
|
27
27
|
<% list_siblings.call %>
|
|
28
28
|
</ul>
|
|
29
29
|
</details>
|
|
30
|
-
</li>
|
|
31
30
|
<%- end %>
|
|
31
|
+
</li>
|
|
32
32
|
<%- end %>
|
|
33
33
|
<%- end %>
|
|
34
34
|
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
<% if namespace[:self] %>
|
|
27
27
|
<span><%= namespace[:name] %></span>
|
|
28
28
|
<% else %>
|
|
29
|
-
<a href="<%= namespace[:path] %>"><%= namespace[:name] %></a><span>::</span>
|
|
29
|
+
<a href="<%= namespace[:path] %>"><%= namespace[:name] %></a><span class="separator">::</span>
|
|
30
30
|
<% end %>
|
|
31
31
|
</li>
|
|
32
32
|
<% end %>
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
<%- klass.each_section do |section, constants, attributes| %>
|
|
46
46
|
<span id="<%= section.legacy_aref %>" class="legacy-anchor"></span>
|
|
47
47
|
<section id="<%= section.aref %>" class="documentation-section anchor-link">
|
|
48
|
-
<%- if section.title
|
|
48
|
+
<%- if section.title %>
|
|
49
49
|
<header class="documentation-section-title">
|
|
50
50
|
<h2>
|
|
51
51
|
<%= section.title %>
|
|
@@ -56,13 +56,13 @@
|
|
|
56
56
|
</header>
|
|
57
57
|
<%- end %>
|
|
58
58
|
|
|
59
|
-
<%- if section.comment
|
|
59
|
+
<%- if section.comment %>
|
|
60
60
|
<div>
|
|
61
61
|
<%= section.description %>
|
|
62
62
|
</div>
|
|
63
63
|
<%- end %>
|
|
64
64
|
|
|
65
|
-
<%- unless constants.empty?
|
|
65
|
+
<%- unless constants.empty? %>
|
|
66
66
|
<section class="constants-list">
|
|
67
67
|
<header>
|
|
68
68
|
<h3>Constants</h3>
|
|
@@ -70,9 +70,9 @@
|
|
|
70
70
|
<dl>
|
|
71
71
|
<%- constants.each do |const| %>
|
|
72
72
|
<dt id="<%= const.name %>"><%= const.name %></dt>
|
|
73
|
-
<%- if const.comment
|
|
73
|
+
<%- if const.comment %>
|
|
74
74
|
<dd>
|
|
75
|
-
<%- if const.mixin_from
|
|
75
|
+
<%- if const.mixin_from %>
|
|
76
76
|
<div class="mixin-from">
|
|
77
77
|
Included from <a href="<%= klass.aref_to(const.mixin_from.path) %>"><%= const.mixin_from.full_name %></a>
|
|
78
78
|
</div>
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
</section>
|
|
88
88
|
<%- end %>
|
|
89
89
|
|
|
90
|
-
<%- unless attributes.empty?
|
|
90
|
+
<%- unless attributes.empty? %>
|
|
91
91
|
<section class="attribute-method-details method-section">
|
|
92
92
|
<header>
|
|
93
93
|
<h3>Attributes</h3>
|
|
@@ -103,12 +103,12 @@
|
|
|
103
103
|
</div>
|
|
104
104
|
|
|
105
105
|
<div class="method-description">
|
|
106
|
-
<%- if attrib.mixin_from
|
|
106
|
+
<%- if attrib.mixin_from %>
|
|
107
107
|
<div class="mixin-from">
|
|
108
108
|
<%= attrib.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(attrib.mixin_from.path) %>"><%= attrib.mixin_from.full_name %></a>
|
|
109
109
|
</div>
|
|
110
110
|
<%- end %>
|
|
111
|
-
<%- if attrib.comment
|
|
111
|
+
<%- if attrib.comment %>
|
|
112
112
|
<%= attrib.description.strip %>
|
|
113
113
|
<%- else %>
|
|
114
114
|
<p class="missing-docs">(Not documented)</p>
|
|
@@ -131,7 +131,7 @@
|
|
|
131
131
|
<%- methods.each do |method| %>
|
|
132
132
|
<div id="<%= method.aref %>" class="method-detail anchor-link <%= method.is_alias_for ? "method-alias" : '' %>">
|
|
133
133
|
<div class="method-header">
|
|
134
|
-
<%- if (call_seq = method.call_seq)
|
|
134
|
+
<%- if (call_seq = method.call_seq) %>
|
|
135
135
|
<%- call_seq.strip.split("\n").each_with_index do |call_seq, i| %>
|
|
136
136
|
<div class="method-heading">
|
|
137
137
|
<a href="#<%= method.aref %>" title="Link to this method">
|
|
@@ -143,7 +143,7 @@
|
|
|
143
143
|
</a>
|
|
144
144
|
</div>
|
|
145
145
|
<%- end %>
|
|
146
|
-
<%- elsif method.has_call_seq?
|
|
146
|
+
<%- elsif method.has_call_seq? %>
|
|
147
147
|
<div class="method-heading">
|
|
148
148
|
<a href="#<%= method.aref %>" title="Link to this method">
|
|
149
149
|
<span class="method-name"><%= h method.name %></span>
|
|
@@ -170,31 +170,28 @@
|
|
|
170
170
|
</div>
|
|
171
171
|
<%- end %>
|
|
172
172
|
|
|
173
|
-
<%- unless method.skip_description?
|
|
173
|
+
<%- unless method.skip_description? %>
|
|
174
174
|
<div class="method-description">
|
|
175
|
-
<%- if method.mixin_from
|
|
175
|
+
<%- if method.mixin_from %>
|
|
176
176
|
<div class="mixin-from">
|
|
177
177
|
<%= method.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(method.mixin_from.path) %>"><%= method.mixin_from.full_name %></a>
|
|
178
178
|
</div>
|
|
179
179
|
<%- end %>
|
|
180
|
-
<%- if method.comment
|
|
180
|
+
<%- if method.comment %>
|
|
181
181
|
<%= method.description.strip %>
|
|
182
182
|
<%- else %>
|
|
183
183
|
<p class="missing-docs">(Not documented)</p>
|
|
184
184
|
<%- end %>
|
|
185
|
-
<%- if method.calls_super
|
|
185
|
+
<%- if method.calls_super %>
|
|
186
186
|
<div class="method-calls-super">
|
|
187
187
|
Calls superclass method
|
|
188
|
-
<%=
|
|
189
|
-
method.superclass_method ?
|
|
190
|
-
method.formatter.link(method.superclass_method.full_name, method.superclass_method.full_name) : nil
|
|
191
|
-
%>
|
|
188
|
+
<%= method.superclass_method_link %>
|
|
192
189
|
</div>
|
|
193
190
|
<%- end %>
|
|
194
191
|
</div>
|
|
195
192
|
<%- end %>
|
|
196
193
|
|
|
197
|
-
<%- unless method.aliases.empty?
|
|
194
|
+
<%- unless method.aliases.empty? %>
|
|
198
195
|
<div class="aliases">
|
|
199
196
|
Also aliased as: <%= method.aliases.map do |aka|
|
|
200
197
|
if aka.parent then # HACK lib/rexml/encodings
|
|
@@ -206,7 +203,7 @@
|
|
|
206
203
|
</div>
|
|
207
204
|
<%- end %>
|
|
208
205
|
|
|
209
|
-
<%- if method.is_alias_for
|
|
206
|
+
<%- if method.is_alias_for %>
|
|
210
207
|
<div class="aliases">
|
|
211
208
|
Alias for: <a href="<%= klass.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
|
|
212
209
|
</div>
|
|
@@ -449,7 +449,6 @@ main h6 {
|
|
|
449
449
|
.ruby-ivar { color: #B57614; } /* Brown */
|
|
450
450
|
.ruby-operator { color: #427B58; } /* Dark Teal */
|
|
451
451
|
.ruby-identifier { color: #076678; } /* Deep Teal */
|
|
452
|
-
.ruby-node { color: #8F3F71; } /* Plum */
|
|
453
452
|
.ruby-comment { color: #928374; font-style: italic; } /* Gray */
|
|
454
453
|
.ruby-regexp { color: #8F3F71; } /* Plum */
|
|
455
454
|
.ruby-value { color: #AF3A03; } /* Dark Orange */
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
<h1 class="class"><%= h @title %></h1>
|
|
15
15
|
|
|
16
16
|
<%- simple_files = @files.select { |f| f.text? } %>
|
|
17
|
-
<%- unless simple_files.empty?
|
|
17
|
+
<%- unless simple_files.empty? %>
|
|
18
18
|
<h2 id="pages">Pages</h2>
|
|
19
19
|
<ul>
|
|
20
20
|
<%- simple_files.sort.each do |file| %>
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
<%
|
|
24
24
|
# HACK table_of_contents should not exist on Document
|
|
25
25
|
table = file.parse(file.comment).table_of_contents
|
|
26
|
-
unless table.empty?
|
|
26
|
+
unless table.empty? %>
|
|
27
27
|
<ul>
|
|
28
28
|
<%- table.each do |heading| %>
|
|
29
29
|
<li><a href="<%= h file.path %>#<%= heading.aref %>"><%= heading.plain_html %></a></li>
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
table.concat klass.parse(klass.comment_location).table_of_contents
|
|
45
45
|
table.concat klass.section_contents
|
|
46
46
|
|
|
47
|
-
unless table.empty?
|
|
47
|
+
unless table.empty? %>
|
|
48
48
|
<ul>
|
|
49
49
|
<%- table.each do |item| %>
|
|
50
50
|
<%- label = item.respond_to?(:label) ? item.label(klass) : item.aref %>
|
data/lib/rdoc/i18n/text.rb
CHANGED
|
@@ -89,9 +89,9 @@ class RDoc::I18n::Text
|
|
|
89
89
|
case raw
|
|
90
90
|
when RDoc::Comment
|
|
91
91
|
raw.text.each_line(&block)
|
|
92
|
-
when
|
|
93
|
-
raw.
|
|
94
|
-
each_line(comment, &block)
|
|
92
|
+
when Hash
|
|
93
|
+
raw.each_value do |comments|
|
|
94
|
+
comments.each { |comment| each_line(comment, &block) }
|
|
95
95
|
end
|
|
96
96
|
else
|
|
97
97
|
raw.each_line(&block)
|
data/lib/rdoc/markdown.kpeg
CHANGED
|
@@ -403,6 +403,8 @@
|
|
|
403
403
|
# the note order list for proper display at the end of the document.
|
|
404
404
|
|
|
405
405
|
def note_for ref
|
|
406
|
+
return unless @note_order
|
|
407
|
+
|
|
406
408
|
@note_order << ref
|
|
407
409
|
|
|
408
410
|
label = @note_order.length
|
|
@@ -617,8 +619,8 @@ BlockQuote = BlockQuoteRaw:a
|
|
|
617
619
|
|
|
618
620
|
BlockQuoteRaw = @StartList:a
|
|
619
621
|
(( ">" " "? Line:l { a << l } )
|
|
620
|
-
( !">" !@BlankLine Line:c { a << c } )*
|
|
621
|
-
( @BlankLine:n { a << n } )*
|
|
622
|
+
( !">" !@BlankLine !(AtxStart @Spacechar) !Bullet !Enumerator !( &{ github? } Ticks3 ) Line:c { a << c } )*
|
|
623
|
+
( ">" @BlankLine:n { a << n } )*
|
|
622
624
|
)+
|
|
623
625
|
{ inner_parse a.join }
|
|
624
626
|
|
|
@@ -975,6 +977,7 @@ Inline = Str
|
|
|
975
977
|
| InlineNote
|
|
976
978
|
| Code
|
|
977
979
|
| RawHtml
|
|
980
|
+
| StrippedComment
|
|
978
981
|
| Entity
|
|
979
982
|
| EscapedChar
|
|
980
983
|
| Symbol
|
|
@@ -1152,8 +1155,8 @@ Code = ( Ticks1 < (
|
|
|
1152
1155
|
)
|
|
1153
1156
|
{ code text }
|
|
1154
1157
|
|
|
1155
|
-
RawHtml = <
|
|
1156
|
-
|
|
1158
|
+
RawHtml = < HtmlBlockScript | HtmlTag > { html? ? text : '' }
|
|
1159
|
+
StrippedComment = HtmlComment { '' }
|
|
1157
1160
|
|
|
1158
1161
|
BlankLine = @Sp @Newline { "\n" }
|
|
1159
1162
|
|
|
@@ -1233,10 +1236,12 @@ InlineNote = &{ notes? }
|
|
|
1233
1236
|
@StartList:a
|
|
1234
1237
|
( !"]" Inline:l { a << l } )+
|
|
1235
1238
|
"]"
|
|
1236
|
-
{
|
|
1237
|
-
|
|
1239
|
+
{ if @note_order
|
|
1240
|
+
ref = [:inline, @note_order.length]
|
|
1241
|
+
@footnotes[ref] = paragraph a
|
|
1238
1242
|
|
|
1239
|
-
|
|
1243
|
+
note_for ref
|
|
1244
|
+
end
|
|
1240
1245
|
}
|
|
1241
1246
|
|
|
1242
1247
|
Notes = ( Note | SkipBlock )*
|
|
@@ -1249,7 +1254,7 @@ RawNoteBlock = @StartList:a
|
|
|
1249
1254
|
# Markdown extensions added by RDoc follow
|
|
1250
1255
|
|
|
1251
1256
|
CodeFence = &{ github? }
|
|
1252
|
-
Ticks3 (@Sp StrChunk:format)?
|
|
1257
|
+
Ticks3 (@Sp StrChunk:format)? @Sp @Newline? < (
|
|
1253
1258
|
( !"`" Nonspacechar )+ |
|
|
1254
1259
|
!Ticks3 /`+/ |
|
|
1255
1260
|
Spacechar |
|
|
@@ -1270,13 +1275,13 @@ Table = &{ github? }
|
|
|
1270
1275
|
TableHead = TableItem2+:items "|"? @Newline
|
|
1271
1276
|
{ items }
|
|
1272
1277
|
|
|
1273
|
-
TableRow = ( ( TableItem:item1 TableItem2
|
|
1278
|
+
TableRow = ( ( TableItem:item1 TableItem2+:items { [item1, *items] } ):row | TableItem2+:row ) "|"? @Newline
|
|
1274
1279
|
{ row }
|
|
1275
1280
|
TableItem2 = "|" TableItem
|
|
1276
1281
|
TableItem = < /(?:\\.|[^|\n])+/ >
|
|
1277
1282
|
{ text.strip.gsub(/\\([|])/, '\1') }
|
|
1278
1283
|
|
|
1279
|
-
TableLine = ( ( TableAlign:align1 TableAlign2
|
|
1284
|
+
TableLine = ( ( TableAlign:align1 TableAlign2+:aligns {[align1, *aligns] } ):line | TableAlign2+:line ) "|"? @Newline
|
|
1280
1285
|
{ line }
|
|
1281
1286
|
TableAlign2 = "|" @Sp TableAlign
|
|
1282
1287
|
TableAlign = < /:?-+:?/ > @Sp
|