rdoc 6.15.1 → 6.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/History.rdoc +1 -1
  3. data/lib/rdoc/code_object/top_level.rb +18 -17
  4. data/lib/rdoc/comment.rb +190 -8
  5. data/lib/rdoc/generator/aliki.rb +42 -0
  6. data/lib/rdoc/generator/darkfish.rb +5 -1
  7. data/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +8 -0
  8. data/lib/rdoc/generator/template/aliki/_footer.rhtml +23 -0
  9. data/lib/rdoc/generator/template/aliki/_head.rhtml +158 -0
  10. data/lib/rdoc/generator/template/aliki/_header.rhtml +56 -0
  11. data/lib/rdoc/generator/template/aliki/_icons.rhtml +208 -0
  12. data/lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml +16 -0
  13. data/lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml +15 -0
  14. data/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +25 -0
  15. data/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +25 -0
  16. data/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +16 -0
  17. data/lib/rdoc/generator/template/aliki/_sidebar_methods.rhtml +41 -0
  18. data/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +67 -0
  19. data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +15 -0
  20. data/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +21 -0
  21. data/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +3 -0
  22. data/lib/rdoc/generator/template/aliki/class.rhtml +220 -0
  23. data/lib/rdoc/generator/template/aliki/css/rdoc.css +1737 -0
  24. data/lib/rdoc/generator/template/aliki/index.rhtml +22 -0
  25. data/lib/rdoc/generator/template/aliki/js/aliki.js +483 -0
  26. data/lib/rdoc/generator/template/aliki/js/c_highlighter.js +299 -0
  27. data/lib/rdoc/generator/template/aliki/js/search.js +120 -0
  28. data/lib/rdoc/generator/template/aliki/js/theme-toggle.js +112 -0
  29. data/lib/rdoc/generator/template/aliki/page.rhtml +18 -0
  30. data/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +14 -0
  31. data/lib/rdoc/generator/template/aliki/servlet_root.rhtml +65 -0
  32. data/lib/rdoc/generator/template/darkfish/_head.rhtml +2 -7
  33. data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +1 -0
  34. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +1 -1
  35. data/lib/rdoc/generator/template/json_index/js/searcher.js +5 -1
  36. data/lib/rdoc/generator.rb +1 -0
  37. data/lib/rdoc/markup/pre_process.rb +34 -10
  38. data/lib/rdoc/markup/to_ansi.rb +4 -0
  39. data/lib/rdoc/markup/to_bs.rb +4 -0
  40. data/lib/rdoc/markup/to_html.rb +6 -4
  41. data/lib/rdoc/markup/to_rdoc.rb +11 -3
  42. data/lib/rdoc/options.rb +21 -10
  43. data/lib/rdoc/parser/c.rb +15 -46
  44. data/lib/rdoc/parser/prism_ruby.rb +121 -113
  45. data/lib/rdoc/parser/ruby.rb +8 -8
  46. data/lib/rdoc/parser/ruby_tools.rb +5 -7
  47. data/lib/rdoc/parser/simple.rb +4 -21
  48. data/lib/rdoc/rdoc.rb +1 -0
  49. data/lib/rdoc/text.rb +1 -1
  50. data/lib/rdoc/token_stream.rb +13 -1
  51. data/lib/rdoc/tom_doc.rb +1 -1
  52. data/lib/rdoc/version.rb +1 -1
  53. metadata +28 -2
@@ -0,0 +1,220 @@
1
+ <body role="document" class="<%= klass.type %> has-toc">
2
+ <%= render '_icons.rhtml' %>
3
+ <%= render '_header.rhtml' %>
4
+ <%= render '_sidebar_toggle.rhtml' %>
5
+
6
+ <nav id="navigation" role="navigation">
7
+ <%= render '_sidebar_pages.rhtml' %>
8
+ <%= render '_sidebar_sections.rhtml' %>
9
+ <%= render '_sidebar_ancestors.rhtml' %>
10
+ <%= render '_sidebar_includes.rhtml' %>
11
+ <%= render '_sidebar_extends.rhtml' %>
12
+ <%= render '_sidebar_methods.rhtml' %>
13
+ <%= render '_sidebar_classes.rhtml' %>
14
+ </nav>
15
+
16
+ <main role="main" aria-labelledby="<%= h klass.aref %>">
17
+ <%# If nesting level is 1, breadcrumb list is not needed %>
18
+ <% if breadcrumb.size > 1 %>
19
+ <ol role="navigation" aria-label="Breadcrumb navigation" class="breadcrumb">
20
+ <% breadcrumb.each do |namespace| %>
21
+ <li>
22
+ <% if namespace[:self] %>
23
+ <span><%= namespace[:name] %></span>
24
+ <% else %>
25
+ <a href="<%= namespace[:path] %>"><%= namespace[:name] %></a><span>::</span>
26
+ <% end %>
27
+ </li>
28
+ <% end %>
29
+ </ol>
30
+ <% end %>
31
+
32
+ <h1 id="<%= h klass.aref %>" class="anchor-link <%= klass.type %>">
33
+ <%= klass.type %> <%= klass.full_name %>
34
+ </h1>
35
+
36
+ <section class="description">
37
+ <%= klass.description %>
38
+ </section>
39
+
40
+ <%- klass.each_section do |section, constants, attributes| %>
41
+ <section id="<%= section.aref %>" class="documentation-section anchor-link">
42
+ <%- if section.title then %>
43
+ <header class="documentation-section-title">
44
+ <h2>
45
+ <a href="#<%= section.aref %>"><%= section.title %></a>
46
+ </h2>
47
+ </header>
48
+ <%- end %>
49
+
50
+ <%- if section.comment then %>
51
+ <div>
52
+ <%= section.description %>
53
+ </div>
54
+ <%- end %>
55
+
56
+ <%- unless constants.empty? then %>
57
+ <section class="constants-list">
58
+ <header>
59
+ <h3 id="constants"><a href="#constants">Constants</a></h3>
60
+ </header>
61
+ <dl>
62
+ <%- constants.each do |const| %>
63
+ <dt id="<%= const.name %>"><%= const.name %></dt>
64
+ <%- if const.comment then %>
65
+ <dd>
66
+ <%- if const.mixin_from then %>
67
+ <div class="mixin-from">
68
+ Included from <a href="<%= klass.aref_to(const.mixin_from.path) %>"><%= const.mixin_from.full_name %></a>
69
+ </div>
70
+ <%- end %>
71
+ <%= const.description.strip %>
72
+ </dd>
73
+ <%- else %>
74
+ <dd class="missing-docs">(Not documented)</dd>
75
+ <%- end %>
76
+ <%- end %>
77
+ </dl>
78
+ </section>
79
+ <%- end %>
80
+
81
+ <%- unless attributes.empty? then %>
82
+ <section class="attribute-method-details method-section">
83
+ <header>
84
+ <h3 id="attributes"><a href="#attributes">Attributes</a></h3>
85
+ </header>
86
+
87
+ <%- attributes.each do |attrib| %>
88
+ <div id="<%= attrib.aref %>" class="method-detail anchor-link">
89
+ <div class="method-heading attribute-method-heading">
90
+ <a href="#<%= attrib.aref %>" title="Link to this attribute">
91
+ <span class="method-name"><%= h attrib.name %></span>
92
+ <span class="attribute-access-type">[<%= attrib.rw %>]</span>
93
+ </a>
94
+ </div>
95
+
96
+ <div class="method-description">
97
+ <%- if attrib.mixin_from then %>
98
+ <div class="mixin-from">
99
+ <%= attrib.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(attrib.mixin_from.path) %>"><%= attrib.mixin_from.full_name %></a>
100
+ </div>
101
+ <%- end %>
102
+ <%- if attrib.comment then %>
103
+ <%= attrib.description.strip %>
104
+ <%- else %>
105
+ <p class="missing-docs">(Not documented)</p>
106
+ <%- end %>
107
+ </div>
108
+ </div>
109
+ <%- end %>
110
+ </section>
111
+ <%- end %>
112
+
113
+ <%- klass.methods_by_type(section).each do |type, visibilities|
114
+ next if visibilities.empty?
115
+ visibilities.each do |visibility, methods|
116
+ next if methods.empty? %>
117
+ <section id="<%= visibility %>-<%= type %>-<%= section.aref %>-method-details" class="method-section anchor-link">
118
+ <header>
119
+ <h3 id="<%= visibility %>-<%= type %>-methods"><a href="#<%= visibility %>-<%= type %>-methods"><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</a></h3>
120
+ </header>
121
+
122
+ <%- methods.each do |method| %>
123
+ <div id="<%= method.aref %>" class="method-detail anchor-link <%= method.is_alias_for ? "method-alias" : '' %>">
124
+ <div class="method-header">
125
+ <%- if (call_seq = method.call_seq) then %>
126
+ <%- call_seq.strip.split("\n").each_with_index do |call_seq, i| %>
127
+ <div class="method-heading">
128
+ <a href="#<%= method.aref %>" title="Link to this method">
129
+ <span class="method-callseq">
130
+ <%= h(call_seq.strip.
131
+ gsub( /^\w+\./m, '')).
132
+ gsub(/(.*)[-=]&gt;/, '\1&rarr;') %>
133
+ </span>
134
+ </a>
135
+ </div>
136
+ <%- end %>
137
+ <%- elsif method.has_call_seq? then %>
138
+ <div class="method-heading">
139
+ <a href="#<%= method.aref %>" title="Link to this method">
140
+ <span class="method-name"><%= h method.name %></span>
141
+ </a>
142
+ </div>
143
+ <%- else %>
144
+ <div class="method-heading">
145
+ <a href="#<%= method.aref %>" title="Link to this method">
146
+ <span class="method-name"><%= h method.name %></span>
147
+ <span class="method-args"><%= h method.param_seq %></span>
148
+ </a>
149
+ </div>
150
+ <%- end %>
151
+ </div>
152
+
153
+ <%- if method.token_stream %>
154
+ <div class="method-controls">
155
+ <details class="method-source-toggle">
156
+ <summary>Source</summary>
157
+ </details>
158
+ </div>
159
+ <%- end %>
160
+
161
+ <%- unless method.skip_description? then %>
162
+ <div class="method-description">
163
+ <%- if method.token_stream then %>
164
+ <div class="method-source-code" id="<%= method.html_name %>-source">
165
+ <pre class="<%= method.source_language %>" data-language="<%= method.source_language %>"><%= method.markup_code %></pre>
166
+ </div>
167
+ <%- end %>
168
+ <%- if method.mixin_from then %>
169
+ <div class="mixin-from">
170
+ <%= method.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(method.mixin_from.path) %>"><%= method.mixin_from.full_name %></a>
171
+ </div>
172
+ <%- end %>
173
+ <%- if method.comment then %>
174
+ <%= method.description.strip %>
175
+ <%- else %>
176
+ <p class="missing-docs">(Not documented)</p>
177
+ <%- end %>
178
+ <%- if method.calls_super then %>
179
+ <div class="method-calls-super">
180
+ Calls superclass method
181
+ <%=
182
+ method.superclass_method ?
183
+ method.formatter.link(method.superclass_method.full_name, method.superclass_method.full_name) : nil
184
+ %>
185
+ </div>
186
+ <%- end %>
187
+ </div>
188
+ <%- end %>
189
+
190
+ <%- unless method.aliases.empty? then %>
191
+ <div class="aliases">
192
+ Also aliased as: <%= method.aliases.map do |aka|
193
+ if aka.parent then # HACK lib/rexml/encodings
194
+ %{<a href="#{klass.aref_to aka.path}">#{h aka.name}</a>}
195
+ else
196
+ h aka.name
197
+ end
198
+ end.join ", " %>
199
+ </div>
200
+ <%- end %>
201
+
202
+ <%- if method.is_alias_for then %>
203
+ <div class="aliases">
204
+ Alias for: <a href="<%= klass.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
205
+ </div>
206
+ <%- end %>
207
+ </div>
208
+
209
+ <%- end %>
210
+ </section>
211
+ <%- end
212
+ end %>
213
+ </section>
214
+ <%- end %>
215
+ </main>
216
+
217
+ <%= render '_aside_toc.rhtml' %>
218
+
219
+ <%= render '_footer.rhtml' %>
220
+ </body>