rdoc 6.3.3 → 6.5.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rdoc might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/CONTRIBUTING.rdoc +1 -2
- data/LEGAL.rdoc +1 -1
- data/exe/rdoc +0 -1
- data/lib/rdoc/any_method.rb +6 -3
- data/lib/rdoc/code_objects.rb +1 -2
- data/lib/rdoc/context/section.rb +2 -0
- data/lib/rdoc/context.rb +1 -3
- data/lib/rdoc/cross_reference.rb +44 -20
- data/lib/rdoc/generator/darkfish.rb +2 -2
- data/lib/rdoc/generator/markup.rb +1 -1
- data/lib/rdoc/generator/template/darkfish/_head.rhtml +11 -13
- data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +27 -3
- data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +22 -2
- data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +25 -4
- data/lib/rdoc/generator/template/darkfish/class.rhtml +22 -20
- data/lib/rdoc/generator/template/darkfish/css/rdoc.css +24 -1
- 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 +1 -1
- data/lib/rdoc/generator/template/darkfish/js/darkfish.js +1 -1
- data/lib/rdoc/generator/template/darkfish/js/search.js +1 -1
- data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +2 -2
- data/lib/rdoc/generator.rb +5 -5
- data/lib/rdoc/i18n.rb +1 -1
- data/lib/rdoc/known_classes.rb +5 -4
- data/lib/rdoc/markdown/literals.rb +24 -8
- data/lib/rdoc/markdown.kpeg +25 -18
- data/lib/rdoc/markdown.rb +323 -226
- data/lib/rdoc/markup/attribute_manager.rb +29 -35
- data/lib/rdoc/markup/parser.rb +12 -6
- data/lib/rdoc/markup/pre_process.rb +2 -0
- data/lib/rdoc/markup/to_html.rb +20 -16
- data/lib/rdoc/markup/to_label.rb +1 -1
- data/lib/rdoc/markup/to_rdoc.rb +3 -20
- data/lib/rdoc/markup.rb +35 -667
- data/lib/rdoc/method_attr.rb +1 -1
- data/lib/rdoc/normal_class.rb +1 -1
- data/lib/rdoc/normal_module.rb +1 -1
- data/lib/rdoc/options.rb +63 -19
- data/lib/rdoc/parser/c.rb +110 -110
- data/lib/rdoc/parser/ruby.rb +43 -10
- data/lib/rdoc/parser.rb +19 -2
- data/lib/rdoc/rd/block_parser.rb +13 -9
- data/lib/rdoc/rd/block_parser.ry +12 -8
- data/lib/rdoc/rd/inline_parser.rb +1 -1
- data/lib/rdoc/rd.rb +3 -4
- data/lib/rdoc/rdoc.rb +19 -33
- data/lib/rdoc/ri/driver.rb +22 -82
- data/lib/rdoc/ri.rb +4 -5
- data/lib/rdoc/rubygems_hook.rb +4 -2
- data/lib/rdoc/servlet.rb +1 -1
- data/lib/rdoc/single_class.rb +5 -0
- data/lib/rdoc/stats.rb +3 -4
- data/lib/rdoc/store.rb +4 -4
- data/lib/rdoc/task.rb +3 -3
- data/lib/rdoc/text.rb +12 -4
- data/lib/rdoc/version.rb +3 -1
- data/lib/rdoc.rb +46 -46
- metadata +9 -14
- data/Gemfile +0 -12
- data/Rakefile +0 -101
- data/bin/console +0 -7
- data/bin/setup +0 -6
- data/rdoc.gemspec +0 -249
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acfa378032b35ef7563cf5255d5d3127b1fa8066dd5c5255088d7d13fdabb757
|
4
|
+
data.tar.gz: 0bbc31e7348fcc5227a9b4319dc48cfb5e40143eeaeeb471921a5b2c6b098220
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7ad2f4cdcf3e7ffa7f81bc8d5795b1481d9c8f7feeba0f2a6455555cecbee603c5fb24e4e612929a7ff314ff027f69b561a0d8cf343c4099ea554db216ad3078
|
7
|
+
data.tar.gz: 93bf81edf3cd84b35db94038b5978abd548042919a1dd3cd039431a681736a3aafe098135c86abe0701dbf3f242bae8af64b293d2f908b2a258ce5075f1519b3
|
data/CONTRIBUTING.rdoc
CHANGED
@@ -34,8 +34,7 @@ RDoc uses bundler for development. To get ready to work on RDoc run:
|
|
34
34
|
This will install all the necessary dependencies for development with rake,
|
35
35
|
generate documentation and run the tests for the first time.
|
36
36
|
|
37
|
-
If the tests don't pass on the first run check the {
|
38
|
-
RDoc}[https://travis-ci.org/ruby/rdoc] to see if there are any known failures
|
37
|
+
If the tests don't pass on the first run check the {GitHub Actions page}[https://github.com/ruby/rdoc/actions] to see if there are any known failures
|
39
38
|
(there shouldn't be).
|
40
39
|
|
41
40
|
You can now use `rake` and `autotest` to run the tests.
|
data/LEGAL.rdoc
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
The files in this distribution are covered by the Ruby license (see LICENSE) except the features mentioned below:
|
6
6
|
|
7
7
|
Darkfish::
|
8
|
-
Darkfish was written by Michael Granger and is included under the
|
8
|
+
Darkfish was written by Michael Granger and is included under the BSD 3-Clause
|
9
9
|
license. Darkfish contains images from the Silk Icons set by Mark James.
|
10
10
|
|
11
11
|
See lib/rdoc/generator/darkfish.rb for license information.
|
data/exe/rdoc
CHANGED
data/lib/rdoc/any_method.rb
CHANGED
@@ -26,6 +26,9 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
26
26
|
|
27
27
|
attr_accessor :c_function
|
28
28
|
|
29
|
+
# The section title of the method (if defined in a C file via +:category:+)
|
30
|
+
attr_accessor :section_title
|
31
|
+
|
29
32
|
# Parameters for this method
|
30
33
|
|
31
34
|
attr_accessor :params
|
@@ -347,15 +350,15 @@ class RDoc::AnyMethod < RDoc::MethodAttr
|
|
347
350
|
ignore << is_alias_for.name
|
348
351
|
ignore.concat is_alias_for.aliases.map(&:name)
|
349
352
|
end
|
350
|
-
ignore.map! { |n| n =~ /\A\[/ ?
|
353
|
+
ignore.map! { |n| n =~ /\A\[/ ? /\[.*\]/ : n}
|
351
354
|
ignore.delete(method_name)
|
352
355
|
ignore = Regexp.union(ignore)
|
353
356
|
|
354
357
|
matching = entries.reject do |entry|
|
355
|
-
entry =~ /^\w*\.?#{ignore}/ or
|
358
|
+
entry =~ /^\w*\.?#{ignore}[$\(\s]/ or
|
356
359
|
entry =~ /\s#{ignore}\s/
|
357
360
|
end
|
358
361
|
|
359
|
-
matching.join
|
362
|
+
matching.empty? ? nil : matching.join("\n")
|
360
363
|
end
|
361
364
|
end
|
data/lib/rdoc/code_objects.rb
CHANGED
data/lib/rdoc/context/section.rb
CHANGED
data/lib/rdoc/context.rb
CHANGED
@@ -1,6 +1,4 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
-
require 'cgi'
|
3
|
-
|
4
2
|
##
|
5
3
|
# A Context is something that can hold modules, classes, methods, attributes,
|
6
4
|
# aliases, requires, and includes. Classes, modules, and files are all
|
@@ -1261,6 +1259,6 @@ class RDoc::Context < RDoc::CodeObject
|
|
1261
1259
|
klass
|
1262
1260
|
end
|
1263
1261
|
|
1264
|
-
autoload :Section,
|
1262
|
+
autoload :Section, "#{__dir__}/context/section"
|
1265
1263
|
|
1266
1264
|
end
|
data/lib/rdoc/cross_reference.rb
CHANGED
@@ -1,4 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'markup/attribute_manager' # for PROTECT_ATTR
|
4
|
+
|
2
5
|
##
|
3
6
|
# RDoc::CrossReference is a reusable way to create cross references for names.
|
4
7
|
|
@@ -14,12 +17,25 @@ class RDoc::CrossReference
|
|
14
17
|
|
15
18
|
CLASS_REGEXP_STR = '\\\\?((?:\:{2})?[A-Z]\w*(?:\:\:\w+)*)'
|
16
19
|
|
20
|
+
##
|
21
|
+
# Regular expression to match a single method argument.
|
22
|
+
|
23
|
+
METHOD_ARG_REGEXP_STR = '[\w.+*/=<>-]+'
|
24
|
+
|
25
|
+
##
|
26
|
+
# Regular expression to match method arguments.
|
27
|
+
|
28
|
+
METHOD_ARGS_REGEXP_STR = /(?:\((?:#{METHOD_ARG_REGEXP_STR}(?:,\s*#{METHOD_ARG_REGEXP_STR})*)?\))?/.source
|
29
|
+
|
17
30
|
##
|
18
31
|
# Regular expression to match method references.
|
19
32
|
#
|
20
33
|
# See CLASS_REGEXP_STR
|
21
34
|
|
22
|
-
METHOD_REGEXP_STR =
|
35
|
+
METHOD_REGEXP_STR = /(
|
36
|
+
(?!\d)[\w#{RDoc::Markup::AttributeManager::PROTECT_ATTR}]+[!?=]?|
|
37
|
+
%|=(?:==?|~)|![=~]|\[\]=?|<(?:<|=>?)?|>[>=]?|[-+!]@?|\*\*?|[\/%\`|&^~]
|
38
|
+
)#{METHOD_ARGS_REGEXP_STR}/.source.delete("\n ").freeze
|
23
39
|
|
24
40
|
##
|
25
41
|
# Regular expressions matching text that should potentially have
|
@@ -34,12 +50,6 @@ class RDoc::CrossReference
|
|
34
50
|
# A::B::C.meth
|
35
51
|
#{CLASS_REGEXP_STR}(?:[.#]|::)#{METHOD_REGEXP_STR}
|
36
52
|
|
37
|
-
# Stand-alone method (preceded by a #)
|
38
|
-
| \\?\##{METHOD_REGEXP_STR}
|
39
|
-
|
40
|
-
# Stand-alone method (preceded by ::)
|
41
|
-
| ::#{METHOD_REGEXP_STR}
|
42
|
-
|
43
53
|
# A::B::C
|
44
54
|
# The stuff after CLASS_REGEXP_STR is a
|
45
55
|
# nasty hack. CLASS_REGEXP_STR unfortunately matches
|
@@ -56,6 +66,12 @@ class RDoc::CrossReference
|
|
56
66
|
# marker.
|
57
67
|
| #{CLASS_REGEXP_STR}(?=[@\s).?!,;<\000]|\z)
|
58
68
|
|
69
|
+
# Stand-alone method (preceded by a #)
|
70
|
+
| \\?\##{METHOD_REGEXP_STR}
|
71
|
+
|
72
|
+
# Stand-alone method (preceded by ::)
|
73
|
+
| ::#{METHOD_REGEXP_STR}
|
74
|
+
|
59
75
|
# Things that look like filenames
|
60
76
|
# The key thing is that there must be at least
|
61
77
|
# one special character (period, slash, or
|
@@ -82,12 +98,12 @@ class RDoc::CrossReference
|
|
82
98
|
# A::B::C.meth
|
83
99
|
#{CLASS_REGEXP_STR}(?:[.#]|::)#{METHOD_REGEXP_STR}
|
84
100
|
|
85
|
-
# Stand-alone method
|
86
|
-
| \\?#{METHOD_REGEXP_STR}
|
87
|
-
|
88
101
|
# A::B::C
|
89
102
|
| #{CLASS_REGEXP_STR}(?=[@\s).?!,;<\000]|\z)
|
90
103
|
|
104
|
+
# Stand-alone method
|
105
|
+
| \\?#{METHOD_REGEXP_STR}
|
106
|
+
|
91
107
|
# Things that look like filenames
|
92
108
|
| (?:\.\.\/)*[-\/\w]+[_\/.][-\w\/.]+
|
93
109
|
|
@@ -115,15 +131,8 @@ class RDoc::CrossReference
|
|
115
131
|
@seen = {}
|
116
132
|
end
|
117
133
|
|
118
|
-
|
119
|
-
|
120
|
-
#
|
121
|
-
# If the reference is found and +name+ is not documented +text+ will be
|
122
|
-
# returned. If +name+ is escaped +name+ is returned. If +name+ is not
|
123
|
-
# found +text+ is returned.
|
124
|
-
|
125
|
-
def resolve name, text
|
126
|
-
return @seen[name] if @seen.include? name
|
134
|
+
def resolve_method name
|
135
|
+
ref = nil
|
127
136
|
|
128
137
|
if /#{CLASS_REGEXP_STR}([.#]|::)#{METHOD_REGEXP_STR}/o =~ name then
|
129
138
|
type = $2
|
@@ -165,12 +174,27 @@ class RDoc::CrossReference
|
|
165
174
|
end
|
166
175
|
end
|
167
176
|
|
177
|
+
ref
|
178
|
+
end
|
179
|
+
|
180
|
+
##
|
181
|
+
# Returns a reference to +name+.
|
182
|
+
#
|
183
|
+
# If the reference is found and +name+ is not documented +text+ will be
|
184
|
+
# returned. If +name+ is escaped +name+ is returned. If +name+ is not
|
185
|
+
# found +text+ is returned.
|
186
|
+
|
187
|
+
def resolve name, text
|
188
|
+
return @seen[name] if @seen.include? name
|
189
|
+
|
168
190
|
ref = case name
|
169
191
|
when /^\\(#{CLASS_REGEXP_STR})$/o then
|
170
192
|
@context.find_symbol $1
|
171
193
|
else
|
172
194
|
@context.find_symbol name
|
173
|
-
end
|
195
|
+
end
|
196
|
+
|
197
|
+
ref = resolve_method name unless ref
|
174
198
|
|
175
199
|
# Try a page name
|
176
200
|
ref = @store.page name if not ref and name =~ /^[\w.]+$/
|
@@ -220,8 +220,8 @@ class RDoc::Generator::Darkfish
|
|
220
220
|
install_rdoc_static_file @template_dir + item, "./#{item}", options
|
221
221
|
end
|
222
222
|
|
223
|
-
@options.template_stylesheets.
|
224
|
-
FileUtils.cp
|
223
|
+
unless @options.template_stylesheets.empty?
|
224
|
+
FileUtils.cp @options.template_stylesheets, '.', **options
|
225
225
|
end
|
226
226
|
|
227
227
|
Dir[(@template_dir + "{js,images}/**/*").to_s].each do |path|
|
@@ -3,20 +3,18 @@
|
|
3
3
|
<title><%= h @title %></title>
|
4
4
|
|
5
5
|
<script type="text/javascript">
|
6
|
-
var rdoc_rel_prefix = "<%= asset_rel_prefix %>/";
|
7
|
-
var index_rel_prefix = "<%= rel_prefix %>/";
|
6
|
+
var rdoc_rel_prefix = "<%= h asset_rel_prefix %>/";
|
7
|
+
var index_rel_prefix = "<%= h rel_prefix %>/";
|
8
8
|
</script>
|
9
9
|
|
10
|
-
<script src="<%= asset_rel_prefix %>/js/navigation.js" defer></script>
|
11
|
-
<script src="<%= asset_rel_prefix %>/js/search.js" defer></script>
|
12
|
-
<script src="<%= asset_rel_prefix %>/js/search_index.js" defer></script>
|
13
|
-
<script src="<%= asset_rel_prefix %>/js/searcher.js" defer></script>
|
14
|
-
<script src="<%= asset_rel_prefix %>/js/darkfish.js" defer></script>
|
10
|
+
<script src="<%= h asset_rel_prefix %>/js/navigation.js" defer></script>
|
11
|
+
<script src="<%= h asset_rel_prefix %>/js/search.js" defer></script>
|
12
|
+
<script src="<%= h asset_rel_prefix %>/js/search_index.js" defer></script>
|
13
|
+
<script src="<%= h asset_rel_prefix %>/js/searcher.js" defer></script>
|
14
|
+
<script src="<%= h asset_rel_prefix %>/js/darkfish.js" defer></script>
|
15
15
|
|
16
|
-
<link href="<%= asset_rel_prefix %>/css/fonts.css" rel="stylesheet">
|
17
|
-
<link href="<%= asset_rel_prefix %>/css/rdoc.css" rel="stylesheet">
|
18
|
-
<%-
|
19
|
-
|
20
|
-
<link href="<%= asset_rel_prefix %>/<%= File.basename stylesheet %>" rel="stylesheet">
|
21
|
-
<%- end -%>
|
16
|
+
<link href="<%= h asset_rel_prefix %>/css/fonts.css" rel="stylesheet">
|
17
|
+
<link href="<%= h asset_rel_prefix %>/css/rdoc.css" rel="stylesheet">
|
18
|
+
<%- @options.template_stylesheets.each do |stylesheet| -%>
|
19
|
+
<link href="<%= h asset_rel_prefix %>/<%= File.basename stylesheet %>" rel="stylesheet">
|
22
20
|
<%- end -%>
|
@@ -1,9 +1,33 @@
|
|
1
1
|
<div id="classindex-section" class="nav-section">
|
2
2
|
<h3>Class and Module Index</h3>
|
3
3
|
|
4
|
+
<%-
|
5
|
+
all_classes = @classes.group_by do |klass|
|
6
|
+
klass.full_name[/\A[^:]++(?:::[^:]++(?=::))*+(?=::[^:]*+\z)/]
|
7
|
+
end.delete_if do |_, klasses|
|
8
|
+
!klasses.any?(&:display?)
|
9
|
+
end
|
10
|
+
link = proc do |index_klass, display = index_klass.display?|
|
11
|
+
if display
|
12
|
+
-%><code><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.name %></a></code><%-
|
13
|
+
else
|
14
|
+
-%><code><%= index_klass.name %></code><%-
|
15
|
+
end
|
16
|
+
end
|
17
|
+
if top = all_classes[nil]
|
18
|
+
solo = top.one? {|klass| klass.display?}
|
19
|
+
traverse = proc do |klasses| -%>
|
4
20
|
<ul class="link-list">
|
5
|
-
|
6
|
-
|
21
|
+
<%- klasses.each do |index_klass| -%>
|
22
|
+
<%- if children = all_classes[index_klass.full_name] -%>
|
23
|
+
<li><details<% if solo; solo = false %> open<% end %>><summary><% link.call(index_klass) %></summary>
|
24
|
+
<%- traverse.call(children) -%>
|
25
|
+
</ul></details>
|
26
|
+
<%- elsif index_klass.display? -%>
|
27
|
+
<li><% link.call(index_klass, true) %>
|
28
|
+
<%- end -%>
|
29
|
+
<%- end -%>
|
30
|
+
<%- end -%>
|
31
|
+
<%- traverse.call(top) -%>
|
7
32
|
<%- end -%>
|
8
|
-
</ul>
|
9
33
|
</div>
|
@@ -1,11 +1,31 @@
|
|
1
1
|
<%- simple_files = @files.select { |f| f.text? } %>
|
2
|
+
<%- if defined?(current) -%>
|
3
|
+
<%- dir = current.full_name[%r{\A[^/]+(?=/)}] || current.page_name -%>
|
4
|
+
<%- end -%>
|
2
5
|
<%- unless simple_files.empty? then -%>
|
3
6
|
<div id="fileindex-section" class="nav-section">
|
4
7
|
<h3>Pages</h3>
|
5
8
|
|
6
9
|
<ul class="link-list">
|
7
|
-
<%- simple_files.
|
8
|
-
|
10
|
+
<%- simple_files.group_by do |f| -%>
|
11
|
+
<%- f.full_name[%r{\A[^/]+(?=/)}] || f.page_name -%>
|
12
|
+
<%- end.each do |n, files| -%>
|
13
|
+
<%- f = files.shift -%>
|
14
|
+
<%- if files.empty? -%>
|
15
|
+
<li><a href="<%= rel_prefix %>/<%= h f.path %>"><%= h f.page_name %></a>
|
16
|
+
<%- next -%>
|
17
|
+
<%- end -%>
|
18
|
+
<li><details<% if dir == n %> open<% end %>><summary><%
|
19
|
+
if n == f.page_name
|
20
|
+
%><a href="<%= rel_prefix %>/<%= h f.path %>"><%= h n %></a><%
|
21
|
+
else
|
22
|
+
%><%= h n %><% files.unshift(f)
|
23
|
+
end %></summary>
|
24
|
+
<ul class="link-list">
|
25
|
+
<%- files.each do |f| -%>
|
26
|
+
<li><a href="<%= rel_prefix %>/<%= h f.path %>"><%= h f.page_name %></a>
|
27
|
+
<%- end -%>
|
28
|
+
</ul></details>
|
9
29
|
<%- end -%>
|
10
30
|
</ul>
|
11
31
|
</div>
|
@@ -3,16 +3,37 @@
|
|
3
3
|
else
|
4
4
|
current.comment
|
5
5
|
end
|
6
|
-
table = current.parse(comment).table_of_contents
|
6
|
+
table = current.parse(comment).table_of_contents.dup
|
7
7
|
|
8
8
|
if table.length > 1 then %>
|
9
9
|
<div class="nav-section">
|
10
10
|
<h3>Table of Contents</h3>
|
11
11
|
|
12
|
+
<%- display_link = proc do |heading| -%>
|
13
|
+
<a href="#<%= heading.label current %>"><%= heading.plain_html %></a>
|
14
|
+
<%- end -%>
|
15
|
+
|
16
|
+
<%- list_siblings = proc do -%>
|
17
|
+
<%- level = table.first&.level -%>
|
18
|
+
<%- while table.first && table.first.level >= level -%>
|
19
|
+
<%- heading = table.shift -%>
|
20
|
+
<%- if table.first.nil? || table.first.level <= heading.level -%>
|
21
|
+
<li><% display_link.call heading -%>
|
22
|
+
<%- else -%>
|
23
|
+
<li>
|
24
|
+
<details open>
|
25
|
+
<summary><%- display_link.call heading -%></summary>
|
26
|
+
<ul class="link-list" role="directory">
|
27
|
+
<% list_siblings.call %>
|
28
|
+
</ul>
|
29
|
+
</details>
|
30
|
+
</li>
|
31
|
+
<%- end -%>
|
32
|
+
<%- end -%>
|
33
|
+
<%- end -%>
|
34
|
+
|
12
35
|
<ul class="link-list" role="directory">
|
13
|
-
|
14
|
-
<li><a href="#<%= heading.label current %>"><%= heading.plain_html %></a>
|
15
|
-
<%- end -%>
|
36
|
+
<% list_siblings.call %>
|
16
37
|
</ul>
|
17
38
|
</div>
|
18
39
|
<%- end -%>
|
@@ -98,28 +98,30 @@
|
|
98
98
|
|
99
99
|
<%- methods.each do |method| -%>
|
100
100
|
<div id="<%= method.aref %>" class="method-detail <%= method.is_alias_for ? "method-alias" : '' %>">
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
<
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
<
|
117
|
-
class="method-
|
118
|
-
|
119
|
-
|
101
|
+
<div class="method-header">
|
102
|
+
<%- if (call_seq = method.call_seq) then -%>
|
103
|
+
<%- call_seq.strip.split("\n").each_with_index do |call_seq, i| -%>
|
104
|
+
<div class="method-heading">
|
105
|
+
<span class="method-callseq">
|
106
|
+
<%= h(call_seq.strip.
|
107
|
+
gsub( /^\w+\./m, '')).
|
108
|
+
gsub(/(.*)[-=]>/, '\1→') %>
|
109
|
+
</span>
|
110
|
+
<%- if i == 0 and method.token_stream then -%>
|
111
|
+
<span class="method-click-advice">click to toggle source</span>
|
112
|
+
<%- end -%>
|
113
|
+
</div>
|
114
|
+
<%- end -%>
|
115
|
+
<%- else -%>
|
116
|
+
<div class="method-heading">
|
117
|
+
<span class="method-name"><%= h method.name %></span><span
|
118
|
+
class="method-args"><%= h method.param_seq %></span>
|
119
|
+
<%- if method.token_stream then -%>
|
120
|
+
<span class="method-click-advice">click to toggle source</span>
|
121
|
+
<%- end -%>
|
122
|
+
</div>
|
120
123
|
<%- end -%>
|
121
124
|
</div>
|
122
|
-
<%- end -%>
|
123
125
|
|
124
126
|
<div class="method-description">
|
125
127
|
<%- if method.comment then -%>
|
@@ -186,6 +186,10 @@ nav {
|
|
186
186
|
font-family: Helvetica, sans-serif;
|
187
187
|
font-size: 14px;
|
188
188
|
border-right: 1px solid #ccc;
|
189
|
+
position: sticky;
|
190
|
+
top: 0;
|
191
|
+
overflow: auto;
|
192
|
+
height: calc(100vh - 100px); /* reduce the footer height */
|
189
193
|
}
|
190
194
|
|
191
195
|
main {
|
@@ -305,6 +309,25 @@ dl.note-list dt {
|
|
305
309
|
background: url(../images/arrow_up.png) no-repeat right center;
|
306
310
|
}
|
307
311
|
|
312
|
+
.nav-section details summary {
|
313
|
+
display: block;
|
314
|
+
}
|
315
|
+
|
316
|
+
.nav-section details summary::-webkit-details-marker {
|
317
|
+
display: none;
|
318
|
+
}
|
319
|
+
|
320
|
+
.nav-section details summary:before {
|
321
|
+
content: "";
|
322
|
+
}
|
323
|
+
|
324
|
+
.nav-section details summary:after {
|
325
|
+
content: " \25B6"; /* BLACK RIGHT-POINTING TRIANGLE */
|
326
|
+
}
|
327
|
+
.nav-section details[open] > summary:after {
|
328
|
+
content: " \25BD"; /* WHITE DOWN-POINTING TRIANGLE */
|
329
|
+
}
|
330
|
+
|
308
331
|
/* @end */
|
309
332
|
|
310
333
|
/* @group Documentation Section */
|
@@ -482,7 +505,7 @@ main header h3 {
|
|
482
505
|
|
483
506
|
main .method-source-code {
|
484
507
|
max-height: 0;
|
485
|
-
overflow:
|
508
|
+
overflow: auto;
|
486
509
|
transition-duration: 200ms;
|
487
510
|
transition-delay: 0ms;
|
488
511
|
transition-property: all;
|
Binary file
|
Binary file
|
@@ -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>';
|
@@ -101,7 +101,7 @@ Search.prototype = Object.assign({}, Navigation, new function() {
|
|
101
101
|
}
|
102
102
|
|
103
103
|
this.escapeHTML = function(html) {
|
104
|
-
return html.replace(/[&<>]/g, function(c) {
|
104
|
+
return html.replace(/[&<>"`']/g, function(c) {
|
105
105
|
return '&#' + c.charCodeAt(0) + ';';
|
106
106
|
});
|
107
107
|
}
|
@@ -8,14 +8,14 @@
|
|
8
8
|
<ul>
|
9
9
|
<%- simple_files.sort.each do |file| -%>
|
10
10
|
<li class="file">
|
11
|
-
<a href="<%= file.path %>"><%= h file.page_name %></a>
|
11
|
+
<a href="<%= h file.path %>"><%= h file.page_name %></a>
|
12
12
|
<%
|
13
13
|
# HACK table_of_contents should not exist on Document
|
14
14
|
table = file.parse(file.comment).table_of_contents
|
15
15
|
unless table.empty? then %>
|
16
16
|
<ul>
|
17
17
|
<%- table.each do |heading| -%>
|
18
|
-
<li><a href="<%= file.path %>#<%= heading.aref %>"><%= heading.plain_html %></a>
|
18
|
+
<li><a href="<%= h file.path %>#<%= heading.aref %>"><%= heading.plain_html %></a>
|
19
19
|
<%- end -%>
|
20
20
|
</ul>
|
21
21
|
<%- end -%>
|
data/lib/rdoc/generator.rb
CHANGED
@@ -41,11 +41,11 @@
|
|
41
41
|
|
42
42
|
module RDoc::Generator
|
43
43
|
|
44
|
-
autoload :Markup,
|
44
|
+
autoload :Markup, "#{__dir__}/generator/markup"
|
45
45
|
|
46
|
-
autoload :Darkfish,
|
47
|
-
autoload :JsonIndex,
|
48
|
-
autoload :RI,
|
49
|
-
autoload :POT,
|
46
|
+
autoload :Darkfish, "#{__dir__}/generator/darkfish"
|
47
|
+
autoload :JsonIndex, "#{__dir__}/generator/json_index"
|
48
|
+
autoload :RI, "#{__dir__}/generator/ri"
|
49
|
+
autoload :POT, "#{__dir__}/generator/pot"
|
50
50
|
|
51
51
|
end
|
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",
|