rdoc 6.1.2 → 6.3.2

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.

Files changed (78) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +9 -0
  3. data/README.rdoc +0 -1
  4. data/Rakefile +28 -18
  5. data/lib/rdoc.rb +21 -0
  6. data/lib/rdoc/any_method.rb +52 -7
  7. data/lib/rdoc/class_module.rb +1 -1
  8. data/lib/rdoc/comment.rb +12 -1
  9. data/lib/rdoc/context.rb +10 -2
  10. data/lib/rdoc/context/section.rb +0 -13
  11. data/lib/rdoc/cross_reference.rb +4 -4
  12. data/lib/rdoc/erb_partial.rb +1 -1
  13. data/lib/rdoc/erbio.rb +2 -2
  14. data/lib/rdoc/generator/darkfish.rb +9 -9
  15. data/lib/rdoc/generator/pot.rb +3 -3
  16. data/lib/rdoc/generator/template/darkfish/_head.rhtml +4 -5
  17. data/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +2 -2
  18. data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +2 -2
  19. data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +7 -7
  20. data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +2 -2
  21. data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +7 -7
  22. data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +6 -6
  23. data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +5 -5
  24. data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +5 -5
  25. data/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +5 -5
  26. data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +4 -4
  27. data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +4 -4
  28. data/lib/rdoc/generator/template/darkfish/class.rhtml +44 -44
  29. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +33 -5
  30. data/lib/rdoc/generator/template/darkfish/index.rhtml +3 -4
  31. data/lib/rdoc/generator/template/darkfish/js/darkfish.js +0 -1
  32. data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +15 -16
  33. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +16 -16
  34. data/lib/rdoc/i18n.rb +1 -1
  35. data/lib/rdoc/markdown.kpeg +20 -2
  36. data/lib/rdoc/markdown.rb +16685 -0
  37. data/lib/rdoc/markdown/literals.rb +417 -0
  38. data/lib/rdoc/markup.rb +1 -2
  39. data/lib/rdoc/markup/attr_span.rb +8 -2
  40. data/lib/rdoc/markup/attribute_manager.rb +93 -28
  41. data/lib/rdoc/markup/formatter.rb +1 -1
  42. data/lib/rdoc/markup/parser.rb +58 -42
  43. data/lib/rdoc/markup/pre_process.rb +1 -1
  44. data/lib/rdoc/markup/table.rb +47 -0
  45. data/lib/rdoc/markup/to_html.rb +46 -6
  46. data/lib/rdoc/markup/to_html_crossref.rb +18 -6
  47. data/lib/rdoc/markup/to_joined_paragraph.rb +1 -0
  48. data/lib/rdoc/markup/to_rdoc.rb +28 -0
  49. data/lib/rdoc/markup/to_table_of_contents.rb +1 -0
  50. data/lib/rdoc/options.rb +56 -6
  51. data/lib/rdoc/parser.rb +7 -7
  52. data/lib/rdoc/parser/c.rb +139 -183
  53. data/lib/rdoc/parser/changelog.rb +145 -14
  54. data/lib/rdoc/parser/ripper_state_lex.rb +2 -1
  55. data/lib/rdoc/parser/ruby.rb +18 -8
  56. data/lib/rdoc/rd/block_parser.rb +1056 -0
  57. data/lib/rdoc/rd/inline_parser.rb +1207 -0
  58. data/lib/rdoc/rdoc.rb +35 -22
  59. data/lib/rdoc/ri/driver.rb +9 -5
  60. data/lib/rdoc/ri/paths.rb +3 -17
  61. data/lib/rdoc/ri/task.rb +1 -1
  62. data/lib/rdoc/rubygems_hook.rb +2 -2
  63. data/lib/rdoc/servlet.rb +16 -8
  64. data/lib/rdoc/store.rb +6 -14
  65. data/lib/rdoc/task.rb +1 -1
  66. data/lib/rdoc/text.rb +8 -2
  67. data/lib/rdoc/token_stream.rb +8 -3
  68. data/lib/rdoc/tom_doc.rb +6 -7
  69. data/lib/rdoc/version.rb +1 -1
  70. data/man/ri.1 +247 -0
  71. data/rdoc.gemspec +196 -9
  72. metadata +10 -70
  73. data/.document +0 -5
  74. data/.gitignore +0 -14
  75. data/.travis.yml +0 -21
  76. data/appveyor.yml +0 -36
  77. data/lib/rdoc/markup/formatter_test_case.rb +0 -764
  78. data/lib/rdoc/markup/text_formatter_test_case.rb +0 -115
@@ -91,8 +91,8 @@ class RDoc::Generator::POT
91
91
  extractor.extract
92
92
  end
93
93
 
94
- require 'rdoc/generator/pot/message_extractor'
95
- require 'rdoc/generator/pot/po'
96
- require 'rdoc/generator/pot/po_entry'
94
+ require_relative 'pot/message_extractor'
95
+ require_relative 'pot/po'
96
+ require_relative 'pot/po_entry'
97
97
 
98
98
  end
@@ -15,9 +15,8 @@
15
15
 
16
16
  <link href="<%= asset_rel_prefix %>/css/fonts.css" rel="stylesheet">
17
17
  <link href="<%= asset_rel_prefix %>/css/rdoc.css" rel="stylesheet">
18
- <% if @options.template_stylesheets.flatten.any? then %>
19
- <% @options.template_stylesheets.flatten.each do |stylesheet| %>
18
+ <%- if @options.template_stylesheets.flatten.any? then -%>
19
+ <%- @options.template_stylesheets.flatten.each do |stylesheet| -%>
20
20
  <link href="<%= asset_rel_prefix %>/<%= File.basename stylesheet %>" rel="stylesheet">
21
- <% end %>
22
- <% end %>
23
-
21
+ <%- end -%>
22
+ <%- end -%>
@@ -1,4 +1,4 @@
1
- <% if !svninfo.empty? then %>
1
+ <%- if !svninfo.empty? then %>
2
2
  <div id="file-svninfo-section" class="nav-section">
3
3
  <h3>VCS Info</h3>
4
4
 
@@ -16,4 +16,4 @@
16
16
  </dl>
17
17
  </div>
18
18
  </div>
19
- <% end %>
19
+ <%- end -%>
@@ -2,8 +2,8 @@
2
2
  <h3>Class and Module Index</h3>
3
3
 
4
4
  <ul class="link-list">
5
- <% @modsort.each do |index_klass| %>
5
+ <%- @modsort.each do |index_klass| -%>
6
6
  <li><a href="<%= rel_prefix %>/<%= index_klass.path %>"><%= index_klass.full_name %></a>
7
- <% end %>
7
+ <%- end -%>
8
8
  </ul>
9
9
  </div>
@@ -1,15 +1,15 @@
1
- <% unless klass.extends.empty? then %>
1
+ <%- unless klass.extends.empty? then %>
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
- <% klass.each_extend do |ext| %>
7
- <% unless String === ext.module then %>
6
+ <%- klass.each_extend do |ext| -%>
7
+ <%- unless String === ext.module then -%>
8
8
  <li><a class="extend" href="<%= klass.aref_to ext.module.path %>"><%= ext.module.full_name %></a>
9
- <% else %>
9
+ <%- else -%>
10
10
  <li><span class="extend"><%= ext.name %></span>
11
- <% end %>
12
- <% end %>
11
+ <%- end -%>
12
+ <%- end -%>
13
13
  </ul>
14
14
  </div>
15
- <% end %>
15
+ <%- end -%>
@@ -2,8 +2,8 @@
2
2
  <h3>Defined In</h3>
3
3
 
4
4
  <ul>
5
- <% klass.in_files.each do |tl| %>
5
+ <%- klass.in_files.each do |tl| -%>
6
6
  <li><%= h tl.relative_name %>
7
- <% end %>
7
+ <%- end -%>
8
8
  </ul>
9
9
  </div>
@@ -1,15 +1,15 @@
1
- <% unless klass.includes.empty? then %>
1
+ <%- unless klass.includes.empty? then %>
2
2
  <div id="includes-section" class="nav-section">
3
3
  <h3>Included Modules</h3>
4
4
 
5
5
  <ul class="link-list">
6
- <% klass.each_include do |inc| %>
7
- <% unless String === inc.module then %>
6
+ <%- klass.each_include do |inc| -%>
7
+ <%- unless String === inc.module then -%>
8
8
  <li><a class="include" href="<%= klass.aref_to inc.module.path %>"><%= inc.module.full_name %></a>
9
- <% else %>
9
+ <%- else -%>
10
10
  <li><span class="include"><%= inc.name %></span>
11
- <% end %>
12
- <% end %>
11
+ <%- end -%>
12
+ <%- end -%>
13
13
  </ul>
14
14
  </div>
15
- <% end %>
15
+ <%- end -%>
@@ -2,14 +2,14 @@
2
2
  <h3>Documentation</h3>
3
3
 
4
4
  <ul>
5
- <% installed.each do |name, href, exists, type, _| %>
6
- <% next if type == :extra %>
5
+ <%- installed.each do |name, href, exists, type, _| -%>
6
+ <%- next if type == :extra -%>
7
7
  <li class="folder">
8
- <% if exists then %>
8
+ <%- if exists then -%>
9
9
  <a href="<%= href %>"><%= h name %></a>
10
- <% else %>
10
+ <%- else -%>
11
11
  <%= h name %>
12
- <% end %>
13
- <% end %>
12
+ <%- end -%>
13
+ <%- end -%>
14
14
  </ul>
15
15
  </div>
@@ -1,12 +1,12 @@
1
- <% unless klass.method_list.empty? then %>
1
+ <%- unless klass.method_list.empty? then %>
2
2
  <!-- Method Quickref -->
3
3
  <div id="method-list-section" class="nav-section">
4
4
  <h3>Methods</h3>
5
5
 
6
6
  <ul class="link-list" role="directory">
7
- <% klass.each_method do |meth| %>
8
- <li <% if meth.calls_super %>class="calls-super" <% end %>><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= h meth.name %></a>
9
- <% end %>
7
+ <%- klass.each_method do |meth| -%>
8
+ <li <%- if meth.calls_super %>class="calls-super" <%- end %>><a href="#<%= meth.aref %>"><%= meth.singleton ? '::' : '#' %><%= h meth.name -%></a>
9
+ <%- end -%>
10
10
  </ul>
11
11
  </div>
12
- <% end %>
12
+ <%- end -%>
@@ -1,12 +1,12 @@
1
- <% simple_files = @files.select { |f| f.text? } %>
2
- <% unless simple_files.empty? then %>
1
+ <%- simple_files = @files.select { |f| f.text? } %>
2
+ <%- unless simple_files.empty? then -%>
3
3
  <div id="fileindex-section" class="nav-section">
4
4
  <h3>Pages</h3>
5
5
 
6
6
  <ul class="link-list">
7
- <% simple_files.each do |f| %>
7
+ <%- simple_files.each do |f| -%>
8
8
  <li><a href="<%= rel_prefix %>/<%= f.path %>"><%= h f.page_name %></a>
9
- <% end %>
9
+ <%- end -%>
10
10
  </ul>
11
11
  </div>
12
- <% end %>
12
+ <%- end -%>
@@ -1,11 +1,11 @@
1
- <% if klass.type == 'class' then %>
1
+ <%- if klass.type == 'class' then %>
2
2
  <div id="parent-class-section" class="nav-section">
3
3
  <h3>Parent</h3>
4
4
 
5
- <% if klass.superclass and not String === klass.superclass then %>
5
+ <%- if klass.superclass and not String === klass.superclass then -%>
6
6
  <p class="link"><a href="<%= klass.aref_to klass.superclass.path %>"><%= klass.superclass.full_name %></a>
7
- <% else %>
7
+ <%- else -%>
8
8
  <p class="link"><%= klass.superclass %>
9
- <% end %>
9
+ <%- end -%>
10
10
  </div>
11
- <% end %>
11
+ <%- end -%>
@@ -1,11 +1,11 @@
1
- <% unless klass.sections.length == 1 then %>
1
+ <%- unless klass.sections.length == 1 then %>
2
2
  <div id="sections-section" class="nav-section">
3
3
  <h3>Sections</h3>
4
4
 
5
5
  <ul class="link-list" role="directory">
6
- <% klass.sort_sections.each do |section| %>
6
+ <%- klass.sort_sections.each do |section| -%>
7
7
  <li><a href="#<%= section.aref %>"><%= h section.title %></a></li>
8
- <% end %>
8
+ <%- end -%>
9
9
  </ul>
10
10
  </div>
11
- <% end %>
11
+ <%- end -%>
@@ -1,4 +1,4 @@
1
- <% comment = if current.respond_to? :comment_location then
1
+ <%- comment = if current.respond_to? :comment_location then
2
2
  current.comment_location
3
3
  else
4
4
  current.comment
@@ -10,9 +10,9 @@
10
10
  <h3>Table of Contents</h3>
11
11
 
12
12
  <ul class="link-list" role="directory">
13
- <% table.each do |heading| %>
13
+ <%- table.each do |heading| -%>
14
14
  <li><a href="#<%= heading.label current %>"><%= heading.plain_html %></a>
15
- <% end %>
15
+ <%- end -%>
16
16
  </ul>
17
17
  </div>
18
- <% end %>
18
+ <%- end -%>
@@ -25,9 +25,9 @@
25
25
  <%= klass.description %>
26
26
  </section>
27
27
 
28
- <% klass.each_section do |section, constants, attributes| %>
28
+ <%- klass.each_section do |section, constants, attributes| -%>
29
29
  <section id="<%= section.aref %>" class="documentation-section">
30
- <% if section.title then %>
30
+ <%- if section.title then -%>
31
31
  <header class="documentation-section-title">
32
32
  <h2>
33
33
  <%= section.title %>
@@ -36,39 +36,39 @@
36
36
  <a href="#top">&uarr; top</a>
37
37
  </span>
38
38
  </header>
39
- <% end %>
39
+ <%- end -%>
40
40
 
41
- <% if section.comment then %>
41
+ <%- if section.comment then -%>
42
42
  <div>
43
43
  <%= section.description %>
44
44
  </div>
45
- <% end %>
45
+ <%- end -%>
46
46
 
47
- <% unless constants.empty? then %>
47
+ <%- unless constants.empty? then -%>
48
48
  <section class="constants-list">
49
49
  <header>
50
50
  <h3>Constants</h3>
51
51
  </header>
52
52
  <dl>
53
- <% constants.each do |const| %>
53
+ <%- constants.each do |const| -%>
54
54
  <dt id="<%= const.name %>"><%= const.name %>
55
- <% if const.comment then %>
55
+ <%- if const.comment then -%>
56
56
  <dd><%= const.description.strip %>
57
- <% else %>
57
+ <%- else -%>
58
58
  <dd class="missing-docs">(Not documented)
59
- <% end %>
60
- <% end %>
59
+ <%- end -%>
60
+ <%- end -%>
61
61
  </dl>
62
62
  </section>
63
- <% end %>
63
+ <%- end -%>
64
64
 
65
- <% unless attributes.empty? then %>
65
+ <%- unless attributes.empty? then -%>
66
66
  <section class="attribute-method-details" class="method-section">
67
67
  <header>
68
68
  <h3>Attributes</h3>
69
69
  </header>
70
70
 
71
- <% attributes.each do |attrib| %>
71
+ <%- attributes.each do |attrib| -%>
72
72
  <div id="<%= attrib.aref %>" class="method-detail">
73
73
  <div class="method-heading attribute-method-heading">
74
74
  <span class="method-name"><%= h attrib.name %></span><span
@@ -76,18 +76,18 @@
76
76
  </div>
77
77
 
78
78
  <div class="method-description">
79
- <% if attrib.comment then %>
79
+ <%- if attrib.comment then -%>
80
80
  <%= attrib.description.strip %>
81
- <% else %>
81
+ <%- else -%>
82
82
  <p class="missing-docs">(Not documented)
83
- <% end %>
83
+ <%- end -%>
84
84
  </div>
85
85
  </div>
86
- <% end %>
86
+ <%- end -%>
87
87
  </section>
88
- <% end %>
88
+ <%- end -%>
89
89
 
90
- <% klass.methods_by_type(section).each do |type, visibilities|
90
+ <%- klass.methods_by_type(section).each do |type, visibilities|
91
91
  next if visibilities.empty?
92
92
  visibilities.each do |visibility, methods|
93
93
  next if methods.empty? %>
@@ -96,38 +96,38 @@
96
96
  <h3><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3>
97
97
  </header>
98
98
 
99
- <% methods.each do |method| %>
99
+ <%- methods.each do |method| -%>
100
100
  <div id="<%= method.aref %>" class="method-detail <%= method.is_alias_for ? "method-alias" : '' %>">
101
- <% if method.call_seq then %>
102
- <% method.call_seq.strip.split("\n").each_with_index do |call_seq, i| %>
101
+ <%- if (call_seq = method.call_seq) then -%>
102
+ <%- call_seq.strip.split("\n").each_with_index do |call_seq, i| -%>
103
103
  <div class="method-heading">
104
104
  <span class="method-callseq">
105
105
  <%= h(call_seq.strip.
106
106
  gsub( /^\w+\./m, '')).
107
107
  gsub(/(.*)[-=]&gt;/, '\1&rarr;') %>
108
108
  </span>
109
- <% if i == 0 and method.token_stream then %>
109
+ <%- if i == 0 and method.token_stream then -%>
110
110
  <span class="method-click-advice">click to toggle source</span>
111
- <% end %>
111
+ <%- end -%>
112
112
  </div>
113
- <% end %>
114
- <% else %>
113
+ <%- end -%>
114
+ <%- else -%>
115
115
  <div class="method-heading">
116
116
  <span class="method-name"><%= h method.name %></span><span
117
117
  class="method-args"><%= h method.param_seq %></span>
118
- <% if method.token_stream then %>
118
+ <%- if method.token_stream then -%>
119
119
  <span class="method-click-advice">click to toggle source</span>
120
- <% end %>
120
+ <%- end -%>
121
121
  </div>
122
- <% end %>
122
+ <%- end -%>
123
123
 
124
124
  <div class="method-description">
125
- <% if method.comment then %>
125
+ <%- if method.comment then -%>
126
126
  <%= method.description.strip %>
127
- <% else %>
127
+ <%- else -%>
128
128
  <p class="missing-docs">(Not documented)
129
- <% end %>
130
- <% if method.calls_super then %>
129
+ <%- end -%>
130
+ <%- if method.calls_super then -%>
131
131
  <div class="method-calls-super">
132
132
  Calls superclass method
133
133
  <%=
@@ -135,16 +135,16 @@
135
135
  method.formatter.link(method.superclass_method.full_name, method.superclass_method.full_name) : nil
136
136
  %>
137
137
  </div>
138
- <% end %>
138
+ <%- end -%>
139
139
 
140
- <% if method.token_stream then %>
140
+ <%- if method.token_stream then -%>
141
141
  <div class="method-source-code" id="<%= method.html_name %>-source">
142
142
  <pre><%= method.markup_code %></pre>
143
143
  </div>
144
- <% end %>
144
+ <%- end -%>
145
145
  </div>
146
146
 
147
- <% unless method.aliases.empty? then %>
147
+ <%- unless method.aliases.empty? then -%>
148
148
  <div class="aliases">
149
149
  Also aliased as: <%= method.aliases.map do |aka|
150
150
  if aka.parent then # HACK lib/rexml/encodings
@@ -154,19 +154,19 @@
154
154
  end
155
155
  end.join ", " %>
156
156
  </div>
157
- <% end %>
157
+ <%- end -%>
158
158
 
159
- <% if method.is_alias_for then %>
159
+ <%- if method.is_alias_for then -%>
160
160
  <div class="aliases">
161
161
  Alias for: <a href="<%= klass.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
162
162
  </div>
163
- <% end %>
163
+ <%- end -%>
164
164
  </div>
165
165
 
166
- <% end %>
166
+ <%- end -%>
167
167
  </section>
168
- <% end
168
+ <%- end
169
169
  end %>
170
170
  </section>
171
- <% end %>
171
+ <%- end -%>
172
172
  </main>
@@ -74,6 +74,28 @@ h6:target {
74
74
  code,
75
75
  pre {
76
76
  font-family: "Source Code Pro", Monaco, monospace;
77
+ background-color: rgba(27,31,35,0.05);
78
+ padding: 0em 0.2em;
79
+ border-radius: 0.2em;
80
+ }
81
+
82
+ table {
83
+ margin: 0;
84
+ border-spacing: 0;
85
+ border-collapse: collapse;
86
+ }
87
+
88
+ table tr th, table tr td {
89
+ padding: 0.2em 0.4em;
90
+ border: 1px solid #ccc;
91
+ }
92
+
93
+ table tr th {
94
+ background-color: #eceaed;
95
+ }
96
+
97
+ table tr:nth-child(even) td {
98
+ background-color: #f5f4f6;
77
99
  }
78
100
 
79
101
  /* @group Generic Classes */
@@ -103,7 +125,7 @@ pre {
103
125
 
104
126
  .missing-docs {
105
127
  font-size: 120%;
106
- background: white url(images/wrench_orange.png) no-repeat 4px center;
128
+ background: white url(../images/wrench_orange.png) no-repeat 4px center;
107
129
  color: #ccc;
108
130
  line-height: 2em;
109
131
  border: 1px solid #d00;
@@ -147,11 +169,11 @@ pre {
147
169
  .table-of-contents li .toc-toggle {
148
170
  width: 16px;
149
171
  height: 16px;
150
- background: url(images/add.png) no-repeat;
172
+ background: url(../images/add.png) no-repeat;
151
173
  }
152
174
 
153
175
  .table-of-contents li .toc-toggle.open {
154
- background: url(images/delete.png) no-repeat;
176
+ background: url(../images/delete.png) no-repeat;
155
177
  }
156
178
 
157
179
  /* @end */
@@ -163,6 +185,7 @@ nav {
163
185
  width: 260px;
164
186
  font-family: Helvetica, sans-serif;
165
187
  font-size: 14px;
188
+ border-right: 1px solid #ccc;
166
189
  }
167
190
 
168
191
  main {
@@ -273,8 +296,13 @@ ul.link-list .type {
273
296
  -webkit-border-radius: 5px;
274
297
  }
275
298
 
299
+ dl.note-list dt {
300
+ float: left;
301
+ margin-right: 1em;
302
+ }
303
+
276
304
  .calls-super {
277
- background: url(images/arrow_up.png) no-repeat right center;
305
+ background: url(../images/arrow_up.png) no-repeat right center;
278
306
  }
279
307
 
280
308
  /* @end */
@@ -500,7 +528,7 @@ main .method-click-advice {
500
528
  visibility: hidden;
501
529
  padding-right: 20px;
502
530
  line-height: 20px;
503
- background: url(images/zoom.png) no-repeat right top;
531
+ background: url(../images/zoom.png) no-repeat right top;
504
532
  }
505
533
  main .method-heading:hover .method-click-advice {
506
534
  visibility: visible;