rdoc 6.3.4.1 → 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 +195 -0
- data/History.rdoc +65 -63
- data/LEGAL.rdoc +7 -1
- data/LICENSE.rdoc +6 -0
- data/README.md +236 -0
- data/RI.md +842 -0
- data/TODO.rdoc +8 -7
- data/doc/markup_reference/markdown.md +659 -0
- data/doc/markup_reference/rdoc.rdoc +1169 -0
- data/exe/rdoc +0 -1
- data/lib/rdoc/{alias.rb → code_object/alias.rb} +4 -18
- data/lib/rdoc/{any_method.rb → code_object/any_method.rb} +50 -24
- data/lib/rdoc/{attr.rb → code_object/attr.rb} +16 -14
- data/lib/rdoc/{class_module.rb → code_object/class_module.rb} +225 -58
- data/lib/rdoc/{constant.rb → code_object/constant.rb} +44 -10
- data/lib/rdoc/code_object/context/section.rb +182 -0
- data/lib/rdoc/{context.rb → code_object/context.rb} +78 -106
- data/lib/rdoc/{extend.rb → code_object/extend.rb} +0 -1
- data/lib/rdoc/{include.rb → code_object/include.rb} +0 -1
- data/lib/rdoc/{method_attr.rb → code_object/method_attr.rb} +46 -48
- data/lib/rdoc/{mixin.rb → code_object/mixin.rb} +6 -4
- data/lib/rdoc/{normal_class.rb → code_object/normal_class.rb} +2 -3
- data/lib/rdoc/{normal_module.rb → code_object/normal_module.rb} +2 -3
- data/lib/rdoc/{require.rb → code_object/require.rb} +1 -2
- data/lib/rdoc/{single_class.rb → code_object/single_class.rb} +5 -1
- data/lib/rdoc/{top_level.rb → code_object/top_level.rb} +60 -63
- data/lib/rdoc/code_object.rb +11 -39
- data/lib/rdoc/code_objects.rb +1 -2
- data/lib/rdoc/comment.rb +202 -99
- data/lib/rdoc/cross_reference.rb +75 -62
- data/lib/rdoc/encoding.rb +8 -24
- data/lib/rdoc/erb_partial.rb +1 -2
- data/lib/rdoc/erbio.rb +3 -8
- data/lib/rdoc/generator/aliki.rb +200 -0
- data/lib/rdoc/generator/darkfish.rb +156 -122
- data/lib/rdoc/generator/json_index.rb +8 -24
- data/lib/rdoc/generator/markup.rb +70 -34
- data/lib/rdoc/generator/pot/message_extractor.rb +7 -7
- data/lib/rdoc/generator/pot/po.rb +1 -1
- data/lib/rdoc/generator/pot/po_entry.rb +8 -8
- data/lib/rdoc/generator/pot.rb +1 -5
- data/lib/rdoc/generator/ri.rb +1 -2
- data/lib/rdoc/generator/template/aliki/DESIGN.md +536 -0
- 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 +163 -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 +27 -0
- data/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +27 -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 +230 -0
- data/lib/rdoc/generator/template/aliki/css/rdoc.css +2181 -0
- data/lib/rdoc/generator/template/aliki/index.rhtml +22 -0
- data/lib/rdoc/generator/template/aliki/js/aliki.js +513 -0
- data/lib/rdoc/generator/template/aliki/js/bash_highlighter.js +167 -0
- data/lib/rdoc/generator/template/aliki/js/c_highlighter.js +299 -0
- data/lib/rdoc/generator/template/aliki/js/search_controller.js +129 -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 +35 -14
- data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +1 -5
- data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +11 -9
- data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +11 -9
- data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +7 -6
- data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +20 -11
- data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +25 -5
- data/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +4 -9
- data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +2 -1
- data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +4 -4
- data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +28 -7
- data/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
- data/lib/rdoc/generator/template/darkfish/class.rhtml +138 -90
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +420 -358
- data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
- data/lib/rdoc/generator/template/darkfish/index.rhtml +14 -12
- data/lib/rdoc/generator/template/darkfish/js/darkfish.js +59 -3
- data/lib/rdoc/generator/template/darkfish/js/search.js +15 -5
- data/lib/rdoc/generator/template/darkfish/page.rhtml +7 -6
- data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +12 -9
- data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +24 -21
- data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +35 -21
- data/lib/rdoc/generator/template/json_index/js/navigation.js +8 -8
- data/lib/rdoc/generator/template/json_index/js/searcher.js +48 -6
- data/lib/rdoc/generator.rb +6 -5
- data/lib/rdoc/i18n/text.rb +3 -3
- data/lib/rdoc/i18n.rb +1 -1
- data/lib/rdoc/known_classes.rb +5 -4
- data/lib/rdoc/markdown/entities.rb +0 -1
- data/lib/rdoc/markdown/literals.kpeg +0 -2
- data/lib/rdoc/markdown/literals.rb +0 -1
- data/lib/rdoc/markdown.kpeg +140 -62
- data/lib/rdoc/markdown.rb +1015 -873
- data/lib/rdoc/markup/blank_line.rb +25 -24
- data/lib/rdoc/markup/block_quote.rb +1 -2
- data/lib/rdoc/markup/document.rb +10 -11
- data/lib/rdoc/markup/element.rb +21 -0
- data/lib/rdoc/markup/formatter.rb +134 -115
- data/lib/rdoc/markup/hard_break.rb +30 -28
- data/lib/rdoc/markup/heading.rb +163 -72
- data/lib/rdoc/markup/include.rb +3 -4
- data/lib/rdoc/markup/indented_paragraph.rb +4 -5
- data/lib/rdoc/markup/inline_parser.rb +312 -0
- data/lib/rdoc/markup/list.rb +6 -7
- data/lib/rdoc/markup/list_item.rb +6 -7
- data/lib/rdoc/markup/paragraph.rb +2 -3
- data/lib/rdoc/markup/parser.rb +29 -19
- data/lib/rdoc/markup/pre_process.rb +39 -18
- data/lib/rdoc/markup/raw.rb +52 -56
- data/lib/rdoc/markup/rule.rb +2 -3
- data/lib/rdoc/markup/table.rb +49 -32
- data/lib/rdoc/markup/to_ansi.rb +58 -8
- data/lib/rdoc/markup/to_bs.rb +47 -38
- data/lib/rdoc/markup/to_html.rb +343 -105
- data/lib/rdoc/markup/to_html_crossref.rb +143 -58
- data/lib/rdoc/markup/to_html_snippet.rb +78 -76
- data/lib/rdoc/markup/to_joined_paragraph.rb +3 -9
- data/lib/rdoc/markup/to_label.rb +34 -25
- data/lib/rdoc/markup/to_markdown.rb +74 -51
- data/lib/rdoc/markup/to_rdoc.rb +141 -82
- data/lib/rdoc/markup/to_table_of_contents.rb +4 -5
- data/lib/rdoc/markup/to_test.rb +10 -3
- data/lib/rdoc/markup/to_tt_only.rb +17 -31
- data/lib/rdoc/markup/verbatim.rb +5 -6
- data/lib/rdoc/markup.rb +59 -707
- data/lib/rdoc/options.rb +228 -101
- data/lib/rdoc/parser/c.rb +186 -184
- data/lib/rdoc/parser/changelog.rb +57 -13
- data/lib/rdoc/parser/markdown.rb +0 -2
- data/lib/rdoc/parser/rbs.rb +275 -0
- data/lib/rdoc/parser/rd.rb +0 -1
- data/lib/rdoc/parser/ruby.rb +963 -2024
- data/lib/rdoc/parser/ruby_colorizer.rb +253 -0
- data/lib/rdoc/parser/simple.rb +6 -23
- data/lib/rdoc/parser/text.rb +0 -1
- data/lib/rdoc/parser.rb +35 -14
- data/lib/rdoc/rbs_helper.rb +186 -0
- data/lib/rdoc/rd/block_parser.rb +659 -11
- data/lib/rdoc/rd/block_parser.ry +13 -9
- data/lib/rdoc/rd/inline.rb +4 -5
- data/lib/rdoc/rd/inline_parser.rb +646 -2
- data/lib/rdoc/rd.rb +4 -5
- data/lib/rdoc/rdoc.rb +234 -90
- data/lib/rdoc/ri/driver.rb +172 -172
- data/lib/rdoc/ri/paths.rb +3 -3
- data/lib/rdoc/{servlet.rb → ri/servlet.rb} +28 -27
- data/lib/rdoc/ri/store.rb +0 -1
- data/lib/rdoc/ri/task.rb +3 -3
- data/lib/rdoc/ri.rb +5 -5
- data/lib/rdoc/rubygems_hook.rb +106 -25
- data/lib/rdoc/server.rb +460 -0
- data/lib/rdoc/stats/normal.rb +1 -1
- data/lib/rdoc/stats/quiet.rb +1 -2
- data/lib/rdoc/stats/verbose.rb +3 -5
- data/lib/rdoc/stats.rb +158 -136
- data/lib/rdoc/store.rb +267 -48
- data/lib/rdoc/task.rb +54 -28
- data/lib/rdoc/text.rb +60 -120
- data/lib/rdoc/token_stream.rb +30 -45
- data/lib/rdoc/tom_doc.rb +9 -15
- data/lib/rdoc/version.rb +3 -1
- data/lib/rdoc.rb +90 -52
- data/lib/rubygems_plugin.rb +14 -0
- data/man/ri.1 +2 -0
- data/rdoc-logo.svg +43 -0
- data/rdoc.gemspec +25 -200
- metadata +120 -53
- data/CONTRIBUTING.rdoc +0 -220
- data/ExampleMarkdown.md +0 -37
- data/ExampleRDoc.rdoc +0 -208
- data/Gemfile +0 -12
- data/README.rdoc +0 -129
- data/RI.rdoc +0 -57
- data/Rakefile +0 -101
- data/bin/console +0 -7
- data/bin/setup +0 -6
- data/lib/rdoc/anon_class.rb +0 -11
- data/lib/rdoc/context/section.rb +0 -232
- data/lib/rdoc/generator/template/darkfish/.document +0 -0
- data/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +0 -19
- data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +0 -9
- data/lib/rdoc/generator/template/json_index/.document +0 -1
- data/lib/rdoc/ghost_method.rb +0 -7
- data/lib/rdoc/markup/attr_changer.rb +0 -23
- data/lib/rdoc/markup/attr_span.rb +0 -36
- data/lib/rdoc/markup/attribute_manager.rb +0 -409
- data/lib/rdoc/markup/attributes.rb +0 -71
- data/lib/rdoc/markup/regexp_handling.rb +0 -41
- data/lib/rdoc/meta_method.rb +0 -7
- data/lib/rdoc/parser/ripper_state_lex.rb +0 -590
- data/lib/rdoc/parser/ruby_tools.rb +0 -167
|
Binary file
|
|
Binary file
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
<body id="top" role="document" class="file">
|
|
2
|
-
|
|
2
|
+
<%= render '_sidebar_toggle.rhtml' %>
|
|
3
|
+
|
|
4
|
+
<nav id="navigation" role="navigation">
|
|
3
5
|
<div id="project-navigation">
|
|
4
6
|
<%= render '_sidebar_navigation.rhtml' %>
|
|
5
|
-
|
|
6
7
|
<%= render '_sidebar_search.rhtml' %>
|
|
7
8
|
</div>
|
|
8
9
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
<%= render '_sidebar_table_of_contents.rhtml' if defined?(current) %>
|
|
11
|
+
<%= render '_sidebar_pages.rhtml' %>
|
|
12
|
+
<%= render '_sidebar_classes.rhtml' %>
|
|
13
|
+
|
|
14
|
+
<%= render '_footer.rhtml' %>
|
|
13
15
|
</nav>
|
|
14
16
|
|
|
15
17
|
<main role="main">
|
|
16
|
-
<%- if @
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<%- end -%>
|
|
18
|
+
<%- if @main_page %>
|
|
19
|
+
<%= @main_page.description %>
|
|
20
|
+
<%- else %>
|
|
21
|
+
<p>This is the API documentation for <%= h @title %>.</p>
|
|
22
|
+
<%- end %>
|
|
22
23
|
</main>
|
|
24
|
+
</body>
|
|
@@ -34,7 +34,7 @@ function showSource( e ) {
|
|
|
34
34
|
};
|
|
35
35
|
|
|
36
36
|
function hookSourceViews() {
|
|
37
|
-
document.querySelectorAll('.method-
|
|
37
|
+
document.querySelectorAll('.method-source-toggle').forEach(function (codeObject) {
|
|
38
38
|
codeObject.addEventListener('click', showSource);
|
|
39
39
|
});
|
|
40
40
|
};
|
|
@@ -54,7 +54,7 @@ function hookSearch() {
|
|
|
54
54
|
var html = '';
|
|
55
55
|
|
|
56
56
|
// TODO add relative path to <script> per-page
|
|
57
|
-
html += '<p class="search-match"><a href="' + index_rel_prefix + result.path + '">' + this.hlt(result.title);
|
|
57
|
+
html += '<p class="search-match"><a href="' + index_rel_prefix + this.escapeHTML(result.path) + '">' + this.hlt(result.title);
|
|
58
58
|
if (result.params)
|
|
59
59
|
html += '<span class="params">' + result.params + '</span>';
|
|
60
60
|
html += '</a>';
|
|
@@ -72,13 +72,69 @@ function hookSearch() {
|
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
search.select = function(result) {
|
|
75
|
-
|
|
75
|
+
var href = result.firstChild.firstChild.href;
|
|
76
|
+
var query = this.input.value;
|
|
77
|
+
if (query) {
|
|
78
|
+
var url = new URL(href, window.location.origin);
|
|
79
|
+
url.searchParams.set('q', query);
|
|
80
|
+
url.searchParams.set('nav', '0');
|
|
81
|
+
href = url.toString();
|
|
82
|
+
}
|
|
83
|
+
window.location.href = href;
|
|
76
84
|
}
|
|
77
85
|
|
|
78
86
|
search.scrollIntoView = search.scrollInWindow;
|
|
87
|
+
|
|
88
|
+
// Check for ?q= URL parameter and trigger search automatically
|
|
89
|
+
if (typeof URLSearchParams !== 'undefined') {
|
|
90
|
+
var urlParams = new URLSearchParams(window.location.search);
|
|
91
|
+
var queryParam = urlParams.get('q');
|
|
92
|
+
if (queryParam) {
|
|
93
|
+
var navParam = urlParams.get('nav');
|
|
94
|
+
var autoSelect = navParam !== '0';
|
|
95
|
+
input.value = queryParam;
|
|
96
|
+
search.search(queryParam, autoSelect);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
79
99
|
};
|
|
80
100
|
|
|
101
|
+
function hookFocus() {
|
|
102
|
+
document.addEventListener("keydown", (event) => {
|
|
103
|
+
if (document.activeElement.tagName === 'INPUT') {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (event.key === "/") {
|
|
107
|
+
event.preventDefault();
|
|
108
|
+
document.querySelector('#search-field').focus();
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
function hookSidebar() {
|
|
114
|
+
var navigation = document.querySelector('#navigation');
|
|
115
|
+
var navigationToggle = document.querySelector('#navigation-toggle');
|
|
116
|
+
|
|
117
|
+
navigationToggle.addEventListener('click', function() {
|
|
118
|
+
navigation.hidden = !navigation.hidden;
|
|
119
|
+
navigationToggle.ariaExpanded = navigationToggle.ariaExpanded !== 'true';
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
var isSmallViewport = window.matchMedia("(max-width: 1023px)").matches;
|
|
123
|
+
if (isSmallViewport) {
|
|
124
|
+
navigation.hidden = true;
|
|
125
|
+
navigationToggle.ariaExpanded = false;
|
|
126
|
+
document.addEventListener('click', (e) => {
|
|
127
|
+
if (e.target.closest('#navigation a')) {
|
|
128
|
+
navigation.hidden = true;
|
|
129
|
+
navigationToggle.ariaExpanded = false;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
81
135
|
document.addEventListener('DOMContentLoaded', function() {
|
|
82
136
|
hookSourceViews();
|
|
83
137
|
hookSearch();
|
|
138
|
+
hookFocus();
|
|
139
|
+
hookSidebar();
|
|
84
140
|
});
|
|
@@ -15,9 +15,9 @@ Search.prototype = Object.assign({}, Navigation, new function() {
|
|
|
15
15
|
this.init = function() {
|
|
16
16
|
var _this = this;
|
|
17
17
|
var observer = function(e) {
|
|
18
|
-
switch(e.
|
|
19
|
-
case
|
|
20
|
-
case
|
|
18
|
+
switch(e.key) {
|
|
19
|
+
case 'ArrowUp':
|
|
20
|
+
case 'ArrowDown':
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
23
|
_this.search(_this.input.value);
|
|
@@ -34,6 +34,8 @@ Search.prototype = Object.assign({}, Navigation, new function() {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
this.search = function(value, selectFirstMatch) {
|
|
37
|
+
this.selectFirstMatch = selectFirstMatch;
|
|
38
|
+
|
|
37
39
|
value = value.trim().toLowerCase();
|
|
38
40
|
if (value) {
|
|
39
41
|
this.setNavigationActive(true);
|
|
@@ -76,7 +78,15 @@ Search.prototype = Object.assign({}, Navigation, new function() {
|
|
|
76
78
|
//TODO: ECMAScript
|
|
77
79
|
//if (jQuery.browser.msie) this.$element[0].className += '';
|
|
78
80
|
|
|
79
|
-
if (
|
|
81
|
+
if (this.selectFirstMatch && this.current) {
|
|
82
|
+
this.selectFirstMatch = false;
|
|
83
|
+
this.select(this.current);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (isLast) {
|
|
87
|
+
this.selectFirstMatch = false;
|
|
88
|
+
this.result.setAttribute('aria-busy', 'false');
|
|
89
|
+
}
|
|
80
90
|
}
|
|
81
91
|
|
|
82
92
|
this.move = function(isDown) {
|
|
@@ -101,7 +111,7 @@ Search.prototype = Object.assign({}, Navigation, new function() {
|
|
|
101
111
|
}
|
|
102
112
|
|
|
103
113
|
this.escapeHTML = function(html) {
|
|
104
|
-
return html.replace(/[&<>]/g, function(c) {
|
|
114
|
+
return html.replace(/[&<>"`']/g, function(c) {
|
|
105
115
|
return '&#' + c.charCodeAt(0) + ';';
|
|
106
116
|
});
|
|
107
117
|
}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
<body id="top" role="document" class="file">
|
|
2
|
-
|
|
2
|
+
<%= render '_sidebar_toggle.rhtml' %>
|
|
3
|
+
|
|
4
|
+
<nav id="navigation" role="navigation">
|
|
3
5
|
<div id="project-navigation">
|
|
4
6
|
<%= render '_sidebar_navigation.rhtml' %>
|
|
5
7
|
<%= render '_sidebar_search.rhtml' %>
|
|
6
8
|
</div>
|
|
7
9
|
|
|
8
10
|
<%= render '_sidebar_table_of_contents.rhtml' %>
|
|
11
|
+
<%= render '_sidebar_pages.rhtml' %>
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
<%= render '_sidebar_pages.rhtml' %>
|
|
12
|
-
</div>
|
|
13
|
+
<%= render '_footer.rhtml' %>
|
|
13
14
|
</nav>
|
|
14
15
|
|
|
15
|
-
<main role="main" aria-label="Page <%=h file.full_name%>">
|
|
16
|
+
<main role="main" aria-label="Page <%= h file.full_name %>">
|
|
16
17
|
<%= file.description %>
|
|
17
18
|
</main>
|
|
18
|
-
|
|
19
|
+
</body>
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
<body role="document">
|
|
2
|
-
|
|
3
|
-
<%= render '_sidebar_navigation.rhtml' %>
|
|
2
|
+
<%= render '_sidebar_toggle.rhtml' %>
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
<%= render '
|
|
9
|
-
<%= render '_sidebar_classes.rhtml' %>
|
|
4
|
+
<nav id="navigation" role="navigation">
|
|
5
|
+
<div id="project-navigation">
|
|
6
|
+
<%= render '_sidebar_navigation.rhtml' %>
|
|
7
|
+
<%= render '_sidebar_search.rhtml' %>
|
|
10
8
|
</div>
|
|
9
|
+
|
|
10
|
+
<%= render '_sidebar_pages.rhtml' %>
|
|
11
|
+
<%= render '_sidebar_classes.rhtml' %>
|
|
12
|
+
|
|
13
|
+
<%= render '_footer.rhtml' %>
|
|
11
14
|
</nav>
|
|
12
15
|
|
|
13
16
|
<main role="main">
|
|
14
17
|
<h1>Not Found</h1>
|
|
15
18
|
|
|
16
|
-
<p><%= message
|
|
19
|
+
<p><%= message %></p>
|
|
17
20
|
</main>
|
|
18
|
-
|
|
21
|
+
</body>
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<body role="document">
|
|
2
|
-
|
|
2
|
+
<%= render '_sidebar_toggle.rhtml' %>
|
|
3
|
+
|
|
4
|
+
<nav id="navigation" role="navigation">
|
|
3
5
|
<div id="project-navigation">
|
|
4
6
|
<div id="home-section" class="nav-section">
|
|
5
7
|
<h2>
|
|
@@ -10,53 +12,54 @@
|
|
|
10
12
|
<%= render '_sidebar_search.rhtml' %>
|
|
11
13
|
</div>
|
|
12
14
|
|
|
13
|
-
<%= render '_sidebar_installed.rhtml' %>
|
|
15
|
+
<%= render '_sidebar_installed.rhtml' %>
|
|
16
|
+
<%= render '_footer.rhtml' %>
|
|
14
17
|
</nav>
|
|
15
18
|
|
|
16
19
|
<main role="main">
|
|
17
20
|
<h1>Local RDoc Documentation</h1>
|
|
18
21
|
|
|
19
22
|
<p>Here you can browse local documentation from the ruby standard library and
|
|
20
|
-
your installed gems
|
|
23
|
+
your installed gems.</p>
|
|
21
24
|
|
|
22
|
-
<%- extra_dirs = installed.select { |_, _, _, type,| type == :extra }
|
|
23
|
-
<%- unless extra_dirs.empty?
|
|
25
|
+
<%- extra_dirs = installed.select { |_, _, _, type,| type == :extra } %>
|
|
26
|
+
<%- unless extra_dirs.empty? %>
|
|
24
27
|
<h2>Extra Documentation Directories</h2>
|
|
25
28
|
|
|
26
29
|
<p>The following additional documentation directories are available:</p>
|
|
27
30
|
|
|
28
31
|
<ol>
|
|
29
|
-
<%- extra_dirs.each do |name, href, exists, _, path|
|
|
32
|
+
<%- extra_dirs.each do |name, href, exists, _, path| %>
|
|
30
33
|
<li>
|
|
31
|
-
<%- if exists
|
|
34
|
+
<%- if exists %>
|
|
32
35
|
<a href="<%= href %>"><%= h name %></a> (<%= h path %>)
|
|
33
|
-
<%- else
|
|
36
|
+
<%- else %>
|
|
34
37
|
<%= h name %> (<%= h path %>; <i>not available</i>)
|
|
35
|
-
<%- end
|
|
38
|
+
<%- end %>
|
|
36
39
|
</li>
|
|
37
|
-
<%- end
|
|
40
|
+
<%- end %>
|
|
38
41
|
</ol>
|
|
39
|
-
<%- end
|
|
42
|
+
<%- end %>
|
|
40
43
|
|
|
41
|
-
<%- gems = installed.select { |_, _, _, type,| type == :gem }
|
|
42
|
-
<%- missing = gems.reject { |_, _, exists,| exists }
|
|
43
|
-
<%- unless missing.empty?
|
|
44
|
+
<%- gems = installed.select { |_, _, _, type,| type == :gem } %>
|
|
45
|
+
<%- missing = gems.reject { |_, _, exists,| exists } %>
|
|
46
|
+
<%- unless missing.empty? %>
|
|
44
47
|
<h2>Missing Gem Documentation</h2>
|
|
45
48
|
|
|
46
49
|
<p>You are missing documentation for some of your installed gems.
|
|
47
50
|
You can install missing documentation for gems by running
|
|
48
51
|
<kbd>gem rdoc --all</kbd>. After installing the missing documentation you
|
|
49
52
|
only need to reload this page. The newly created documentation will
|
|
50
|
-
automatically appear
|
|
53
|
+
automatically appear.</p>
|
|
51
54
|
|
|
52
55
|
<p>You can also install documentation for a specific gem by running one of
|
|
53
|
-
the following commands
|
|
56
|
+
the following commands.</p>
|
|
54
57
|
|
|
55
58
|
<ul>
|
|
56
|
-
<%-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
<%- end -%>
|
|
59
|
+
<%- missing.map { |name,| name.sub(/-([^-]*)$/, '') }.uniq.each do |name| %>
|
|
60
|
+
<li><kbd>gem rdoc <%= h name %></kbd></li>
|
|
61
|
+
<%- end %>
|
|
60
62
|
</ul>
|
|
61
|
-
<%- end
|
|
63
|
+
<%- end %>
|
|
62
64
|
</main>
|
|
65
|
+
</body>
|
|
@@ -1,58 +1,72 @@
|
|
|
1
1
|
<body id="top" class="table-of-contents">
|
|
2
|
+
<%= render '_sidebar_toggle.rhtml' %>
|
|
3
|
+
|
|
4
|
+
<nav id="navigation" role="navigation">
|
|
5
|
+
<div id="project-navigation">
|
|
6
|
+
<%= render '_sidebar_navigation.rhtml' %>
|
|
7
|
+
|
|
8
|
+
<%= render '_sidebar_search.rhtml' %>
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<%= render '_footer.rhtml' %>
|
|
12
|
+
</nav>
|
|
2
13
|
<main role="main">
|
|
3
14
|
<h1 class="class"><%= h @title %></h1>
|
|
4
15
|
|
|
5
|
-
<%- simple_files = @files.select { |f| f.text? }
|
|
6
|
-
<%- unless simple_files.empty?
|
|
16
|
+
<%- simple_files = @files.select { |f| f.text? } %>
|
|
17
|
+
<%- unless simple_files.empty? %>
|
|
7
18
|
<h2 id="pages">Pages</h2>
|
|
8
19
|
<ul>
|
|
9
|
-
<%- simple_files.sort.each do |file|
|
|
20
|
+
<%- simple_files.sort.each do |file| %>
|
|
10
21
|
<li class="file">
|
|
11
|
-
<a href="<%= file.path %>"><%= h file.page_name %></a>
|
|
22
|
+
<a href="<%= h file.path %>"><%= h file.page_name %></a>
|
|
12
23
|
<%
|
|
13
24
|
# HACK table_of_contents should not exist on Document
|
|
14
25
|
table = file.parse(file.comment).table_of_contents
|
|
15
|
-
unless table.empty?
|
|
26
|
+
unless table.empty? %>
|
|
16
27
|
<ul>
|
|
17
|
-
<%- table.each do |heading|
|
|
18
|
-
<li><a href="<%= file.path %>#<%= heading.aref %>"><%= heading.plain_html %></a>
|
|
19
|
-
<%-
|
|
28
|
+
<%- table.each do |heading| %>
|
|
29
|
+
<li><a href="<%= h file.path %>#<%= heading.aref %>"><%= heading.plain_html %></a></li>
|
|
30
|
+
<%- end %>
|
|
20
31
|
</ul>
|
|
21
|
-
<%- end
|
|
32
|
+
<%- end %>
|
|
22
33
|
</li>
|
|
23
|
-
<%- end
|
|
34
|
+
<%- end %>
|
|
24
35
|
</ul>
|
|
25
|
-
<%- end
|
|
36
|
+
<%- end %>
|
|
26
37
|
|
|
27
38
|
<h2 id="classes">Classes and Modules</h2>
|
|
28
39
|
<ul>
|
|
29
|
-
<%- @modsort.each do |klass|
|
|
40
|
+
<%- @modsort.each do |klass| %>
|
|
30
41
|
<li class="<%= klass.type %>">
|
|
31
42
|
<a href="<%= klass.path %>"><%= klass.full_name %></a>
|
|
32
43
|
<%- table = []
|
|
33
44
|
table.concat klass.parse(klass.comment_location).table_of_contents
|
|
34
45
|
table.concat klass.section_contents
|
|
35
46
|
|
|
36
|
-
unless table.empty?
|
|
47
|
+
unless table.empty? %>
|
|
37
48
|
<ul>
|
|
38
|
-
<%- table.each do |item|
|
|
39
|
-
|
|
40
|
-
|
|
49
|
+
<%- table.each do |item| %>
|
|
50
|
+
<%- label = item.respond_to?(:label) ? item.label(klass) : item.aref %>
|
|
51
|
+
<li><a href="<%= klass.path %>#<%= label %>"><%= item.plain_html %></a></li>
|
|
52
|
+
<%- end %>
|
|
41
53
|
</ul>
|
|
42
|
-
<%- end
|
|
54
|
+
<%- end %>
|
|
43
55
|
</li>
|
|
44
|
-
<%- end
|
|
56
|
+
<%- end %>
|
|
45
57
|
</ul>
|
|
46
58
|
|
|
47
59
|
<h2 id="methods">Methods</h2>
|
|
48
60
|
<ul>
|
|
49
|
-
<%- @store.all_classes_and_modules.
|
|
61
|
+
<%- @store.all_classes_and_modules.flat_map do |mod|
|
|
50
62
|
mod.method_list
|
|
51
|
-
end.
|
|
63
|
+
end.sort.each do |method| %>
|
|
52
64
|
<li class="method">
|
|
53
65
|
<a href="<%= method.path %>"><%= h method.pretty_name %></a>
|
|
54
66
|
—
|
|
55
67
|
<span class="container"><%= method.parent.full_name %></span>
|
|
56
|
-
|
|
68
|
+
</li>
|
|
69
|
+
<%- end %>
|
|
57
70
|
</ul>
|
|
58
71
|
</main>
|
|
72
|
+
</body>
|
|
@@ -23,24 +23,24 @@ Navigation = new function() {
|
|
|
23
23
|
|
|
24
24
|
this.onkeydown = function(e) {
|
|
25
25
|
if (!this.navigationActive) return;
|
|
26
|
-
switch(e.
|
|
27
|
-
case
|
|
26
|
+
switch(e.key) {
|
|
27
|
+
case 'ArrowLeft':
|
|
28
28
|
if (this.moveLeft()) e.preventDefault();
|
|
29
29
|
break;
|
|
30
|
-
case
|
|
31
|
-
if (e.
|
|
30
|
+
case 'ArrowUp':
|
|
31
|
+
if (e.key == 'ArrowUp' || e.ctrlKey) {
|
|
32
32
|
if (this.moveUp()) e.preventDefault();
|
|
33
33
|
}
|
|
34
34
|
break;
|
|
35
|
-
case
|
|
35
|
+
case 'ArrowRight':
|
|
36
36
|
if (this.moveRight()) e.preventDefault();
|
|
37
37
|
break;
|
|
38
|
-
case
|
|
39
|
-
if (e.
|
|
38
|
+
case 'ArrowDown':
|
|
39
|
+
if (e.key == 'ArrowDown' || e.ctrlKey) {
|
|
40
40
|
if (this.moveDown()) e.preventDefault();
|
|
41
41
|
}
|
|
42
42
|
break;
|
|
43
|
-
case
|
|
43
|
+
case 'Enter':
|
|
44
44
|
if (this.current) e.preventDefault();
|
|
45
45
|
this.select(this.current);
|
|
46
46
|
break;
|
|
@@ -29,7 +29,7 @@ Searcher.prototype = new function() {
|
|
|
29
29
|
|
|
30
30
|
var results =
|
|
31
31
|
performSearch(_this.data, regexps, queries, highlighters, state);
|
|
32
|
-
var hasMore = (state.limit > 0 && state.pass <
|
|
32
|
+
var hasMore = (state.limit > 0 && state.pass < 6);
|
|
33
33
|
|
|
34
34
|
triggerResults.call(_this, results, !hasMore);
|
|
35
35
|
if (hasMore) {
|
|
@@ -57,8 +57,17 @@ Searcher.prototype = new function() {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
function buildRegexps(queries) {
|
|
60
|
+
// A small minority of older browsers don't have RegExp.escape
|
|
61
|
+
// but it's not worth including a complex polyfill.
|
|
62
|
+
var escape = RegExp.escape || function(s) { return s };
|
|
63
|
+
|
|
60
64
|
return queries.map(function(query) {
|
|
61
|
-
|
|
65
|
+
var pattern = [];
|
|
66
|
+
for (var i = 0; i < query.length; i++) {
|
|
67
|
+
var char = escape(query[i]);
|
|
68
|
+
pattern.push('([' + char + '])([^' + char + ']*?)');
|
|
69
|
+
}
|
|
70
|
+
return new RegExp(pattern.join(''), 'i');
|
|
62
71
|
});
|
|
63
72
|
}
|
|
64
73
|
|
|
@@ -80,6 +89,30 @@ Searcher.prototype = new function() {
|
|
|
80
89
|
|
|
81
90
|
/* ----- Mathchers ------ */
|
|
82
91
|
|
|
92
|
+
/*
|
|
93
|
+
* This record matches if both the index and longIndex exactly equal queries[0]
|
|
94
|
+
* and the record matches all of the regexps. This ensures top-level exact matches
|
|
95
|
+
* like "String" are prioritized over nested classes like "Gem::Module::String".
|
|
96
|
+
*/
|
|
97
|
+
function matchPassExact(index, longIndex, queries) {
|
|
98
|
+
return index == queries[0] && longIndex == queries[0];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/*
|
|
102
|
+
* This record matches if the index without "()" exactly equals queries[0].
|
|
103
|
+
* This prioritizes methods like "attribute()" when searching for "attribute".
|
|
104
|
+
*/
|
|
105
|
+
function matchPassExactMethod(index, longIndex, queries, regexps) {
|
|
106
|
+
var indexWithoutParens = index.replace(/\(\)$/, '');
|
|
107
|
+
if (indexWithoutParens != queries[0]) return false;
|
|
108
|
+
if (index === indexWithoutParens) return false; // Not a method (no parens to remove)
|
|
109
|
+
for (var i=1, l = regexps.length; i < l; i++) {
|
|
110
|
+
if (!index.match(regexps[i]) && !longIndex.match(regexps[i]))
|
|
111
|
+
return false;
|
|
112
|
+
};
|
|
113
|
+
return true;
|
|
114
|
+
}
|
|
115
|
+
|
|
83
116
|
/*
|
|
84
117
|
* This record matches if the index starts with queries[0] and the record
|
|
85
118
|
* matches all of the regexps
|
|
@@ -187,17 +220,26 @@ Searcher.prototype = new function() {
|
|
|
187
220
|
var togo = CHUNK_SIZE;
|
|
188
221
|
var matchFunc, hltFunc;
|
|
189
222
|
|
|
190
|
-
|
|
223
|
+
var isLowercaseQuery = queries[0] === queries[0].toLowerCase();
|
|
224
|
+
|
|
225
|
+
while (state.pass < 6 && state.limit > 0 && togo > 0) {
|
|
226
|
+
// When query is lowercase, prioritize methods over classes
|
|
191
227
|
if (state.pass == 0) {
|
|
192
|
-
matchFunc =
|
|
228
|
+
matchFunc = isLowercaseQuery ? matchPassExactMethod : matchPassExact;
|
|
193
229
|
hltFunc = highlightQuery;
|
|
194
230
|
} else if (state.pass == 1) {
|
|
195
|
-
matchFunc =
|
|
231
|
+
matchFunc = isLowercaseQuery ? matchPassExact : matchPassExactMethod;
|
|
196
232
|
hltFunc = highlightQuery;
|
|
197
233
|
} else if (state.pass == 2) {
|
|
198
|
-
matchFunc =
|
|
234
|
+
matchFunc = matchPassBeginning;
|
|
199
235
|
hltFunc = highlightQuery;
|
|
200
236
|
} else if (state.pass == 3) {
|
|
237
|
+
matchFunc = matchPassLongIndex;
|
|
238
|
+
hltFunc = highlightQuery;
|
|
239
|
+
} else if (state.pass == 4) {
|
|
240
|
+
matchFunc = matchPassContains;
|
|
241
|
+
hltFunc = highlightQuery;
|
|
242
|
+
} else if (state.pass == 5) {
|
|
201
243
|
matchFunc = matchPassRegexp;
|
|
202
244
|
hltFunc = highlightRegexp;
|
|
203
245
|
}
|
data/lib/rdoc/generator.rb
CHANGED
|
@@ -41,11 +41,12 @@
|
|
|
41
41
|
|
|
42
42
|
module RDoc::Generator
|
|
43
43
|
|
|
44
|
-
autoload :Markup,
|
|
44
|
+
autoload :Markup, "#{__dir__}/generator/markup"
|
|
45
45
|
|
|
46
|
-
autoload :
|
|
47
|
-
autoload :
|
|
48
|
-
autoload :
|
|
49
|
-
autoload :
|
|
46
|
+
autoload :Aliki, "#{__dir__}/generator/aliki"
|
|
47
|
+
autoload :Darkfish, "#{__dir__}/generator/darkfish"
|
|
48
|
+
autoload :JsonIndex, "#{__dir__}/generator/json_index"
|
|
49
|
+
autoload :RI, "#{__dir__}/generator/ri"
|
|
50
|
+
autoload :POT, "#{__dir__}/generator/pot"
|
|
50
51
|
|
|
51
52
|
end
|
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/i18n.rb
CHANGED
data/lib/rdoc/known_classes.rb
CHANGED
|
@@ -25,6 +25,7 @@ module RDoc
|
|
|
25
25
|
"rb_cObject" => "Object",
|
|
26
26
|
"rb_cProc" => "Proc",
|
|
27
27
|
"rb_cRange" => "Range",
|
|
28
|
+
"rb_cRefinement" => "Refinement",
|
|
28
29
|
"rb_cRegexp" => "Regexp",
|
|
29
30
|
"rb_cRubyVM" => "RubyVM",
|
|
30
31
|
"rb_cSocket" => "Socket",
|
|
@@ -35,7 +36,7 @@ module RDoc
|
|
|
35
36
|
"rb_cTime" => "Time",
|
|
36
37
|
"rb_cTrueClass" => "TrueClass",
|
|
37
38
|
|
|
38
|
-
"rb_eArgError" => "
|
|
39
|
+
"rb_eArgError" => "ArgumentError",
|
|
39
40
|
"rb_eEOFError" => "EOFError",
|
|
40
41
|
"rb_eException" => "Exception",
|
|
41
42
|
"rb_eFatal" => "fatal",
|
|
@@ -45,8 +46,8 @@ module RDoc
|
|
|
45
46
|
"rb_eInterrupt" => "Interrupt",
|
|
46
47
|
"rb_eLoadError" => "LoadError",
|
|
47
48
|
"rb_eNameError" => "NameError",
|
|
48
|
-
"rb_eNoMemError" => "
|
|
49
|
-
"rb_eNotImpError" => "
|
|
49
|
+
"rb_eNoMemError" => "NoMemoryError",
|
|
50
|
+
"rb_eNotImpError" => "NotImplementedError",
|
|
50
51
|
"rb_eRangeError" => "RangeError",
|
|
51
52
|
"rb_eRuntimeError" => "RuntimeError",
|
|
52
53
|
"rb_eScriptError" => "ScriptError",
|
|
@@ -57,7 +58,7 @@ module RDoc
|
|
|
57
58
|
"rb_eSystemCallError" => "SystemCallError",
|
|
58
59
|
"rb_eSystemExit" => "SystemExit",
|
|
59
60
|
"rb_eTypeError" => "TypeError",
|
|
60
|
-
"rb_eZeroDivError" => "
|
|
61
|
+
"rb_eZeroDivError" => "ZeroDivisionError",
|
|
61
62
|
|
|
62
63
|
"rb_mComparable" => "Comparable",
|
|
63
64
|
"rb_mEnumerable" => "Enumerable",
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
# :markup: markdown
|
|
7
7
|
|
|
8
8
|
##
|
|
9
|
-
#--
|
|
10
9
|
# This set of literals is for Ruby 1.9 regular expressions and gives full
|
|
11
10
|
# unicode support.
|
|
12
11
|
#
|
|
@@ -20,4 +19,3 @@ BOM = "\uFEFF"
|
|
|
20
19
|
Newline = /\n|\r\n?|\p{Zl}|\p{Zp}/
|
|
21
20
|
NonAlphanumeric = /\p{^Word}/
|
|
22
21
|
Spacechar = /\t|\p{Zs}/
|
|
23
|
-
|