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.
Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/CONTRIBUTING.md +195 -0
  3. data/History.rdoc +65 -63
  4. data/LEGAL.rdoc +7 -1
  5. data/LICENSE.rdoc +6 -0
  6. data/README.md +236 -0
  7. data/RI.md +842 -0
  8. data/TODO.rdoc +8 -7
  9. data/doc/markup_reference/markdown.md +659 -0
  10. data/doc/markup_reference/rdoc.rdoc +1169 -0
  11. data/exe/rdoc +0 -1
  12. data/lib/rdoc/{alias.rb → code_object/alias.rb} +4 -18
  13. data/lib/rdoc/{any_method.rb → code_object/any_method.rb} +50 -24
  14. data/lib/rdoc/{attr.rb → code_object/attr.rb} +16 -14
  15. data/lib/rdoc/{class_module.rb → code_object/class_module.rb} +225 -58
  16. data/lib/rdoc/{constant.rb → code_object/constant.rb} +44 -10
  17. data/lib/rdoc/code_object/context/section.rb +182 -0
  18. data/lib/rdoc/{context.rb → code_object/context.rb} +78 -106
  19. data/lib/rdoc/{extend.rb → code_object/extend.rb} +0 -1
  20. data/lib/rdoc/{include.rb → code_object/include.rb} +0 -1
  21. data/lib/rdoc/{method_attr.rb → code_object/method_attr.rb} +46 -48
  22. data/lib/rdoc/{mixin.rb → code_object/mixin.rb} +6 -4
  23. data/lib/rdoc/{normal_class.rb → code_object/normal_class.rb} +2 -3
  24. data/lib/rdoc/{normal_module.rb → code_object/normal_module.rb} +2 -3
  25. data/lib/rdoc/{require.rb → code_object/require.rb} +1 -2
  26. data/lib/rdoc/{single_class.rb → code_object/single_class.rb} +5 -1
  27. data/lib/rdoc/{top_level.rb → code_object/top_level.rb} +60 -63
  28. data/lib/rdoc/code_object.rb +11 -39
  29. data/lib/rdoc/code_objects.rb +1 -2
  30. data/lib/rdoc/comment.rb +202 -99
  31. data/lib/rdoc/cross_reference.rb +75 -62
  32. data/lib/rdoc/encoding.rb +8 -24
  33. data/lib/rdoc/erb_partial.rb +1 -2
  34. data/lib/rdoc/erbio.rb +3 -8
  35. data/lib/rdoc/generator/aliki.rb +200 -0
  36. data/lib/rdoc/generator/darkfish.rb +156 -122
  37. data/lib/rdoc/generator/json_index.rb +8 -24
  38. data/lib/rdoc/generator/markup.rb +70 -34
  39. data/lib/rdoc/generator/pot/message_extractor.rb +7 -7
  40. data/lib/rdoc/generator/pot/po.rb +1 -1
  41. data/lib/rdoc/generator/pot/po_entry.rb +8 -8
  42. data/lib/rdoc/generator/pot.rb +1 -5
  43. data/lib/rdoc/generator/ri.rb +1 -2
  44. data/lib/rdoc/generator/template/aliki/DESIGN.md +536 -0
  45. data/lib/rdoc/generator/template/aliki/_aside_toc.rhtml +8 -0
  46. data/lib/rdoc/generator/template/aliki/_footer.rhtml +23 -0
  47. data/lib/rdoc/generator/template/aliki/_head.rhtml +163 -0
  48. data/lib/rdoc/generator/template/aliki/_header.rhtml +56 -0
  49. data/lib/rdoc/generator/template/aliki/_icons.rhtml +208 -0
  50. data/lib/rdoc/generator/template/aliki/_sidebar_ancestors.rhtml +16 -0
  51. data/lib/rdoc/generator/template/aliki/_sidebar_classes.rhtml +15 -0
  52. data/lib/rdoc/generator/template/aliki/_sidebar_extends.rhtml +27 -0
  53. data/lib/rdoc/generator/template/aliki/_sidebar_includes.rhtml +27 -0
  54. data/lib/rdoc/generator/template/aliki/_sidebar_installed.rhtml +16 -0
  55. data/lib/rdoc/generator/template/aliki/_sidebar_methods.rhtml +41 -0
  56. data/lib/rdoc/generator/template/aliki/_sidebar_pages.rhtml +67 -0
  57. data/lib/rdoc/generator/template/aliki/_sidebar_search.rhtml +15 -0
  58. data/lib/rdoc/generator/template/aliki/_sidebar_sections.rhtml +21 -0
  59. data/lib/rdoc/generator/template/aliki/_sidebar_toggle.rhtml +3 -0
  60. data/lib/rdoc/generator/template/aliki/class.rhtml +230 -0
  61. data/lib/rdoc/generator/template/aliki/css/rdoc.css +2181 -0
  62. data/lib/rdoc/generator/template/aliki/index.rhtml +22 -0
  63. data/lib/rdoc/generator/template/aliki/js/aliki.js +513 -0
  64. data/lib/rdoc/generator/template/aliki/js/bash_highlighter.js +167 -0
  65. data/lib/rdoc/generator/template/aliki/js/c_highlighter.js +299 -0
  66. data/lib/rdoc/generator/template/aliki/js/search_controller.js +129 -0
  67. data/lib/rdoc/generator/template/aliki/js/search_navigation.js +105 -0
  68. data/lib/rdoc/generator/template/aliki/js/search_ranker.js +239 -0
  69. data/lib/rdoc/generator/template/aliki/js/theme-toggle.js +112 -0
  70. data/lib/rdoc/generator/template/aliki/page.rhtml +18 -0
  71. data/lib/rdoc/generator/template/aliki/servlet_not_found.rhtml +14 -0
  72. data/lib/rdoc/generator/template/aliki/servlet_root.rhtml +65 -0
  73. data/lib/rdoc/generator/template/darkfish/_footer.rhtml +3 -3
  74. data/lib/rdoc/generator/template/darkfish/_head.rhtml +35 -14
  75. data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +1 -5
  76. data/lib/rdoc/generator/template/darkfish/_sidebar_extends.rhtml +11 -9
  77. data/lib/rdoc/generator/template/darkfish/_sidebar_includes.rhtml +11 -9
  78. data/lib/rdoc/generator/template/darkfish/_sidebar_installed.rhtml +7 -6
  79. data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +20 -11
  80. data/lib/rdoc/generator/template/darkfish/_sidebar_pages.rhtml +25 -5
  81. data/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +4 -9
  82. data/lib/rdoc/generator/template/darkfish/_sidebar_search.rhtml +2 -1
  83. data/lib/rdoc/generator/template/darkfish/_sidebar_sections.rhtml +4 -4
  84. data/lib/rdoc/generator/template/darkfish/_sidebar_table_of_contents.rhtml +28 -7
  85. data/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
  86. data/lib/rdoc/generator/template/darkfish/class.rhtml +138 -90
  87. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +420 -358
  88. data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Bold.ttf +0 -0
  89. data/lib/rdoc/generator/template/darkfish/fonts/SourceCodePro-Regular.ttf +0 -0
  90. data/lib/rdoc/generator/template/darkfish/index.rhtml +14 -12
  91. data/lib/rdoc/generator/template/darkfish/js/darkfish.js +59 -3
  92. data/lib/rdoc/generator/template/darkfish/js/search.js +15 -5
  93. data/lib/rdoc/generator/template/darkfish/page.rhtml +7 -6
  94. data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +12 -9
  95. data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +24 -21
  96. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +35 -21
  97. data/lib/rdoc/generator/template/json_index/js/navigation.js +8 -8
  98. data/lib/rdoc/generator/template/json_index/js/searcher.js +48 -6
  99. data/lib/rdoc/generator.rb +6 -5
  100. data/lib/rdoc/i18n/text.rb +3 -3
  101. data/lib/rdoc/i18n.rb +1 -1
  102. data/lib/rdoc/known_classes.rb +5 -4
  103. data/lib/rdoc/markdown/entities.rb +0 -1
  104. data/lib/rdoc/markdown/literals.kpeg +0 -2
  105. data/lib/rdoc/markdown/literals.rb +0 -1
  106. data/lib/rdoc/markdown.kpeg +140 -62
  107. data/lib/rdoc/markdown.rb +1015 -873
  108. data/lib/rdoc/markup/blank_line.rb +25 -24
  109. data/lib/rdoc/markup/block_quote.rb +1 -2
  110. data/lib/rdoc/markup/document.rb +10 -11
  111. data/lib/rdoc/markup/element.rb +21 -0
  112. data/lib/rdoc/markup/formatter.rb +134 -115
  113. data/lib/rdoc/markup/hard_break.rb +30 -28
  114. data/lib/rdoc/markup/heading.rb +163 -72
  115. data/lib/rdoc/markup/include.rb +3 -4
  116. data/lib/rdoc/markup/indented_paragraph.rb +4 -5
  117. data/lib/rdoc/markup/inline_parser.rb +312 -0
  118. data/lib/rdoc/markup/list.rb +6 -7
  119. data/lib/rdoc/markup/list_item.rb +6 -7
  120. data/lib/rdoc/markup/paragraph.rb +2 -3
  121. data/lib/rdoc/markup/parser.rb +29 -19
  122. data/lib/rdoc/markup/pre_process.rb +39 -18
  123. data/lib/rdoc/markup/raw.rb +52 -56
  124. data/lib/rdoc/markup/rule.rb +2 -3
  125. data/lib/rdoc/markup/table.rb +49 -32
  126. data/lib/rdoc/markup/to_ansi.rb +58 -8
  127. data/lib/rdoc/markup/to_bs.rb +47 -38
  128. data/lib/rdoc/markup/to_html.rb +343 -105
  129. data/lib/rdoc/markup/to_html_crossref.rb +143 -58
  130. data/lib/rdoc/markup/to_html_snippet.rb +78 -76
  131. data/lib/rdoc/markup/to_joined_paragraph.rb +3 -9
  132. data/lib/rdoc/markup/to_label.rb +34 -25
  133. data/lib/rdoc/markup/to_markdown.rb +74 -51
  134. data/lib/rdoc/markup/to_rdoc.rb +141 -82
  135. data/lib/rdoc/markup/to_table_of_contents.rb +4 -5
  136. data/lib/rdoc/markup/to_test.rb +10 -3
  137. data/lib/rdoc/markup/to_tt_only.rb +17 -31
  138. data/lib/rdoc/markup/verbatim.rb +5 -6
  139. data/lib/rdoc/markup.rb +59 -707
  140. data/lib/rdoc/options.rb +228 -101
  141. data/lib/rdoc/parser/c.rb +186 -184
  142. data/lib/rdoc/parser/changelog.rb +57 -13
  143. data/lib/rdoc/parser/markdown.rb +0 -2
  144. data/lib/rdoc/parser/rbs.rb +275 -0
  145. data/lib/rdoc/parser/rd.rb +0 -1
  146. data/lib/rdoc/parser/ruby.rb +963 -2024
  147. data/lib/rdoc/parser/ruby_colorizer.rb +253 -0
  148. data/lib/rdoc/parser/simple.rb +6 -23
  149. data/lib/rdoc/parser/text.rb +0 -1
  150. data/lib/rdoc/parser.rb +35 -14
  151. data/lib/rdoc/rbs_helper.rb +186 -0
  152. data/lib/rdoc/rd/block_parser.rb +659 -11
  153. data/lib/rdoc/rd/block_parser.ry +13 -9
  154. data/lib/rdoc/rd/inline.rb +4 -5
  155. data/lib/rdoc/rd/inline_parser.rb +646 -2
  156. data/lib/rdoc/rd.rb +4 -5
  157. data/lib/rdoc/rdoc.rb +234 -90
  158. data/lib/rdoc/ri/driver.rb +172 -172
  159. data/lib/rdoc/ri/paths.rb +3 -3
  160. data/lib/rdoc/{servlet.rb → ri/servlet.rb} +28 -27
  161. data/lib/rdoc/ri/store.rb +0 -1
  162. data/lib/rdoc/ri/task.rb +3 -3
  163. data/lib/rdoc/ri.rb +5 -5
  164. data/lib/rdoc/rubygems_hook.rb +106 -25
  165. data/lib/rdoc/server.rb +460 -0
  166. data/lib/rdoc/stats/normal.rb +1 -1
  167. data/lib/rdoc/stats/quiet.rb +1 -2
  168. data/lib/rdoc/stats/verbose.rb +3 -5
  169. data/lib/rdoc/stats.rb +158 -136
  170. data/lib/rdoc/store.rb +267 -48
  171. data/lib/rdoc/task.rb +54 -28
  172. data/lib/rdoc/text.rb +60 -120
  173. data/lib/rdoc/token_stream.rb +30 -45
  174. data/lib/rdoc/tom_doc.rb +9 -15
  175. data/lib/rdoc/version.rb +3 -1
  176. data/lib/rdoc.rb +90 -52
  177. data/lib/rubygems_plugin.rb +14 -0
  178. data/man/ri.1 +2 -0
  179. data/rdoc-logo.svg +43 -0
  180. data/rdoc.gemspec +25 -200
  181. metadata +120 -53
  182. data/CONTRIBUTING.rdoc +0 -220
  183. data/ExampleMarkdown.md +0 -37
  184. data/ExampleRDoc.rdoc +0 -208
  185. data/Gemfile +0 -12
  186. data/README.rdoc +0 -129
  187. data/RI.rdoc +0 -57
  188. data/Rakefile +0 -101
  189. data/bin/console +0 -7
  190. data/bin/setup +0 -6
  191. data/lib/rdoc/anon_class.rb +0 -11
  192. data/lib/rdoc/context/section.rb +0 -232
  193. data/lib/rdoc/generator/template/darkfish/.document +0 -0
  194. data/lib/rdoc/generator/template/darkfish/_sidebar_VCS_info.rhtml +0 -19
  195. data/lib/rdoc/generator/template/darkfish/_sidebar_in_files.rhtml +0 -9
  196. data/lib/rdoc/generator/template/json_index/.document +0 -1
  197. data/lib/rdoc/ghost_method.rb +0 -7
  198. data/lib/rdoc/markup/attr_changer.rb +0 -23
  199. data/lib/rdoc/markup/attr_span.rb +0 -36
  200. data/lib/rdoc/markup/attribute_manager.rb +0 -409
  201. data/lib/rdoc/markup/attributes.rb +0 -71
  202. data/lib/rdoc/markup/regexp_handling.rb +0 -41
  203. data/lib/rdoc/meta_method.rb +0 -7
  204. data/lib/rdoc/parser/ripper_state_lex.rb +0 -590
  205. data/lib/rdoc/parser/ruby_tools.rb +0 -167
@@ -1,12 +1,32 @@
1
1
  <%- simple_files = @files.select { |f| f.text? } %>
2
- <%- unless simple_files.empty? then -%>
2
+ <%- if defined?(current) %>
3
+ <%- dir = current.full_name[%r{\A[^/]+(?=/)}] || current.page_name %>
4
+ <%- end %>
5
+ <%- unless simple_files.empty? %>
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.each do |f| -%>
8
- <li><a href="<%= rel_prefix %>/<%= f.path %>"><%= h f.page_name %></a>
9
- <%- end -%>
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></li>
16
+ <%- next -%>
17
+ <%- end %>
18
+ <li><details<%= ' open' if dir == n %>><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></li>
27
+ <%- end %>
28
+ </ul></details></li>
29
+ <%- end %>
10
30
  </ul>
11
31
  </div>
12
- <%- end -%>
32
+ <%- end %>
@@ -1,11 +1,6 @@
1
- <%- if klass.type == 'class' then %>
1
+ <%- if klass.type == 'class' && (ancestors = klass.super_classes).any? %>
2
2
  <div id="parent-class-section" class="nav-section">
3
- <h3>Parent</h3>
4
-
5
- <%- if klass.superclass and not String === klass.superclass then -%>
6
- <p class="link"><a href="<%= klass.aref_to klass.superclass.path %>"><%= klass.superclass.full_name %></a>
7
- <%- else -%>
8
- <p class="link"><%= klass.superclass %>
9
- <%- end -%>
3
+ <h3>Ancestors</h3>
4
+ <%= generate_ancestor_list(ancestors, klass) %>
10
5
  </div>
11
- <%- end -%>
6
+ <%- end %>
@@ -3,7 +3,8 @@
3
3
  <div id="search-field-wrapper">
4
4
  <input id="search-field" role="combobox" aria-label="Search"
5
5
  aria-autocomplete="list" aria-controls="search-results"
6
- type="text" name="search" placeholder="Search" spellcheck="false"
6
+ type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
7
+ autocomplete="off"
7
8
  title="Type to search, Up and Down to navigate, Enter to load">
8
9
  </div>
9
10
 
@@ -1,11 +1,11 @@
1
- <%- unless klass.sections.length == 1 then %>
1
+ <%- unless klass.sections.length == 1 %>
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,18 +1,39 @@
1
- <%- comment = if current.respond_to? :comment_location then
1
+ <%- comment = if current.respond_to? :comment_location
2
2
  current.comment_location
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
- if table.length > 1 then %>
8
+ if table.length > 1 %>
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
+ <li>
21
+ <%- if table.first.nil? || table.first.level <= heading.level %>
22
+ <% display_link.call heading %>
23
+ <%- else %>
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
+ <%- end %>
31
+ </li>
32
+ <%- end %>
33
+ <%- end %>
34
+
12
35
  <ul class="link-list" role="directory">
13
- <%- table.each do |heading| -%>
14
- <li><a href="#<%= heading.label current %>"><%= heading.plain_html %></a>
15
- <%- end -%>
36
+ <% list_siblings.call %>
16
37
  </ul>
17
38
  </div>
18
- <%- end -%>
39
+ <%- end %>
@@ -0,0 +1,3 @@
1
+ <div id="navigation-toggle" role="button" tabindex="0" aria-label="Toggle sidebar" aria-expanded="true" aria-controls="navigation">
2
+ <span aria-hidden="true">&#9776;</span>
3
+ </div>
@@ -1,23 +1,40 @@
1
1
  <body id="top" role="document" class="<%= klass.type %>">
2
- <nav role="navigation">
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_sections.rhtml' %>
12
+ <%= render '_sidebar_parent.rhtml' %>
13
+ <%= render '_sidebar_includes.rhtml' %>
14
+ <%= render '_sidebar_extends.rhtml' %>
15
+ <%= render '_sidebar_methods.rhtml' %>
9
16
 
10
- <div id="class-metadata">
11
- <%= render '_sidebar_sections.rhtml' %>
12
- <%= render '_sidebar_parent.rhtml' %>
13
- <%= render '_sidebar_includes.rhtml' %>
14
- <%= render '_sidebar_extends.rhtml' %>
15
- <%= render '_sidebar_methods.rhtml' %>
16
- </div>
17
+ <%= render '_footer.rhtml' %>
17
18
  </nav>
18
19
 
19
- <main role="main" aria-labelledby="<%=h klass.aref %>">
20
- <h1 id="<%=h klass.aref %>" class="<%= klass.type %>">
20
+ <main role="main" aria-labelledby="<%= h klass.aref %>">
21
+ <%# If nesting level is 1, breadcrumb list is not needed %>
22
+ <% if breadcrumb.size > 1 %>
23
+ <ol role="navigation" aria-label="Breadcrumb navigation" class="breadcrumb">
24
+ <% breadcrumb.each do |namespace| %>
25
+ <li>
26
+ <% if namespace[:self] %>
27
+ <span><%= namespace[:name] %></span>
28
+ <% else %>
29
+ <a href="<%= namespace[:path] %>"><%= namespace[:name] %></a><span class="separator">::</span>
30
+ <% end %>
31
+ </li>
32
+ <% end %>
33
+ </ol>
34
+ <% end %>
35
+
36
+ <span id="<%= h klass.legacy_aref %>" class="legacy-anchor"></span>
37
+ <h1 id="<%= h klass.aref %>" class="anchor-link <%= klass.type %>">
21
38
  <%= klass.type %> <%= klass.full_name %>
22
39
  </h1>
23
40
 
@@ -25,9 +42,10 @@
25
42
  <%= klass.description %>
26
43
  </section>
27
44
 
28
- <%- klass.each_section do |section, constants, attributes| -%>
29
- <section id="<%= section.aref %>" class="documentation-section">
30
- <%- if section.title then -%>
45
+ <%- klass.each_section do |section, constants, attributes| %>
46
+ <span id="<%= section.legacy_aref %>" class="legacy-anchor"></span>
47
+ <section id="<%= section.aref %>" class="documentation-section anchor-link">
48
+ <%- if section.title %>
31
49
  <header class="documentation-section-title">
32
50
  <h2>
33
51
  <%= section.title %>
@@ -36,115 +54,144 @@
36
54
  <a href="#top">&uarr; top</a>
37
55
  </span>
38
56
  </header>
39
- <%- end -%>
57
+ <%- end %>
40
58
 
41
- <%- if section.comment then -%>
59
+ <%- if section.comment %>
42
60
  <div>
43
61
  <%= section.description %>
44
62
  </div>
45
- <%- end -%>
63
+ <%- end %>
46
64
 
47
- <%- unless constants.empty? then -%>
65
+ <%- unless constants.empty? %>
48
66
  <section class="constants-list">
49
67
  <header>
50
68
  <h3>Constants</h3>
51
69
  </header>
52
70
  <dl>
53
- <%- constants.each do |const| -%>
54
- <dt id="<%= const.name %>"><%= const.name %>
55
- <%- if const.comment then -%>
56
- <dd><%= const.description.strip %>
57
- <%- else -%>
58
- <dd class="missing-docs">(Not documented)
59
- <%- end -%>
60
- <%- end -%>
71
+ <%- constants.each do |const| %>
72
+ <dt id="<%= const.name %>"><%= const.name %></dt>
73
+ <%- if const.comment %>
74
+ <dd>
75
+ <%- if const.mixin_from %>
76
+ <div class="mixin-from">
77
+ Included from <a href="<%= klass.aref_to(const.mixin_from.path) %>"><%= const.mixin_from.full_name %></a>
78
+ </div>
79
+ <%- end %>
80
+ <%= const.description.strip %>
81
+ </dd>
82
+ <%- else %>
83
+ <dd class="missing-docs">(Not documented)</dd>
84
+ <%- end %>
85
+ <%- end %>
61
86
  </dl>
62
87
  </section>
63
- <%- end -%>
88
+ <%- end %>
64
89
 
65
- <%- unless attributes.empty? then -%>
66
- <section class="attribute-method-details" class="method-section">
90
+ <%- unless attributes.empty? %>
91
+ <section class="attribute-method-details method-section">
67
92
  <header>
68
93
  <h3>Attributes</h3>
69
94
  </header>
70
95
 
71
- <%- attributes.each do |attrib| -%>
72
- <div id="<%= attrib.aref %>" class="method-detail">
96
+ <%- attributes.each do |attrib| %>
97
+ <div id="<%= attrib.aref %>" class="method-detail anchor-link">
73
98
  <div class="method-heading attribute-method-heading">
74
- <span class="method-name"><%= h attrib.name %></span><span
75
- class="attribute-access-type">[<%= attrib.rw %>]</span>
99
+ <a href="#<%= attrib.aref %>" title="Link to this attribute">
100
+ <span class="method-name"><%= h attrib.name %></span>
101
+ <span class="attribute-access-type">[<%= attrib.rw %>]</span>
102
+ </a>
76
103
  </div>
77
104
 
78
105
  <div class="method-description">
79
- <%- if attrib.comment then -%>
106
+ <%- if attrib.mixin_from %>
107
+ <div class="mixin-from">
108
+ <%= attrib.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(attrib.mixin_from.path) %>"><%= attrib.mixin_from.full_name %></a>
109
+ </div>
110
+ <%- end %>
111
+ <%- if attrib.comment %>
80
112
  <%= attrib.description.strip %>
81
- <%- else -%>
82
- <p class="missing-docs">(Not documented)
83
- <%- end -%>
113
+ <%- else %>
114
+ <p class="missing-docs">(Not documented)</p>
115
+ <%- end %>
84
116
  </div>
85
117
  </div>
86
- <%- end -%>
118
+ <%- end %>
87
119
  </section>
88
- <%- end -%>
120
+ <%- end %>
89
121
 
90
- <%- klass.methods_by_type(section).each do |type, visibilities|
91
- next if visibilities.empty?
92
- visibilities.each do |visibility, methods|
93
- next if methods.empty? %>
94
- <section id="<%= visibility %>-<%= type %>-<%= section.aref %>-method-details" class="method-section">
122
+ <%- klass.methods_by_type(section).each do |type, visibilities| %>
123
+ <%- next if visibilities.empty? %>
124
+ <%- visibilities.each do |visibility, methods| %>
125
+ <%- next if methods.empty? %>
126
+ <section id="<%= visibility %>-<%= type %>-<%= section.aref %>-method-details" class="method-section anchor-link">
95
127
  <header>
96
128
  <h3><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3>
97
129
  </header>
98
130
 
99
- <%- methods.each do |method| -%>
100
- <div id="<%= method.aref %>" class="method-detail <%= method.is_alias_for ? "method-alias" : '' %>">
101
- <%- if (call_seq = method.call_seq) then -%>
102
- <%- call_seq.strip.split("\n").each_with_index do |call_seq, i| -%>
103
- <div class="method-heading">
104
- <span class="method-callseq">
105
- <%= h(call_seq.strip.
106
- gsub( /^\w+\./m, '')).
107
- gsub(/(.*)[-=]&gt;/, '\1&rarr;') %>
108
- </span>
109
- <%- if i == 0 and method.token_stream then -%>
110
- <span class="method-click-advice">click to toggle source</span>
111
- <%- end -%>
112
- </div>
113
- <%- end -%>
114
- <%- else -%>
115
- <div class="method-heading">
116
- <span class="method-name"><%= h method.name %></span><span
117
- class="method-args"><%= h method.param_seq %></span>
118
- <%- if method.token_stream then -%>
119
- <span class="method-click-advice">click to toggle source</span>
120
- <%- end -%>
131
+ <%- methods.each do |method| %>
132
+ <div id="<%= method.aref %>" class="method-detail anchor-link <%= method.is_alias_for ? "method-alias" : '' %>">
133
+ <div class="method-header">
134
+ <%- if (call_seq = method.call_seq) %>
135
+ <%- call_seq.strip.split("\n").each_with_index do |call_seq, i| %>
136
+ <div class="method-heading">
137
+ <a href="#<%= method.aref %>" title="Link to this method">
138
+ <span class="method-callseq">
139
+ <%= h(call_seq.strip.
140
+ gsub( /^\w+\./m, '')).
141
+ gsub(/(.*)[-=]&gt;/, '\1&rarr;') %>
142
+ </span>
143
+ </a>
144
+ </div>
145
+ <%- end %>
146
+ <%- elsif method.has_call_seq? %>
147
+ <div class="method-heading">
148
+ <a href="#<%= method.aref %>" title="Link to this method">
149
+ <span class="method-name"><%= h method.name %></span>
150
+ </a>
151
+ </div>
152
+ <%- else %>
153
+ <div class="method-heading">
154
+ <a href="#<%= method.aref %>" title="Link to this method">
155
+ <span class="method-name"><%= h method.name %></span>
156
+ <span class="method-args"><%= h method.param_seq %></span>
157
+ </a>
158
+ </div>
159
+ <%- end %>
121
160
  </div>
122
- <%- end -%>
123
161
 
162
+ <%- if method.token_stream %>
163
+ <div class="method-controls">
164
+ <details class="method-source-toggle">
165
+ <summary>Source</summary>
166
+ </details>
167
+ </div>
168
+ <div class="method-source-code" id="<%= method.html_name %>-source">
169
+ <pre><%= method.markup_code %></pre>
170
+ </div>
171
+ <%- end %>
172
+
173
+ <%- unless method.skip_description? %>
124
174
  <div class="method-description">
125
- <%- if method.comment then -%>
175
+ <%- if method.mixin_from %>
176
+ <div class="mixin-from">
177
+ <%= method.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(method.mixin_from.path) %>"><%= method.mixin_from.full_name %></a>
178
+ </div>
179
+ <%- end %>
180
+ <%- if method.comment %>
126
181
  <%= method.description.strip %>
127
- <%- else -%>
128
- <p class="missing-docs">(Not documented)
129
- <%- end -%>
130
- <%- if method.calls_super then -%>
182
+ <%- else %>
183
+ <p class="missing-docs">(Not documented)</p>
184
+ <%- end %>
185
+ <%- if method.calls_super %>
131
186
  <div class="method-calls-super">
132
187
  Calls superclass method
133
- <%=
134
- method.superclass_method ?
135
- method.formatter.link(method.superclass_method.full_name, method.superclass_method.full_name) : nil
136
- %>
188
+ <%= method.superclass_method_link %>
137
189
  </div>
138
- <%- end -%>
139
-
140
- <%- if method.token_stream then -%>
141
- <div class="method-source-code" id="<%= method.html_name %>-source">
142
- <pre><%= method.markup_code %></pre>
143
- </div>
144
- <%- end -%>
190
+ <%- end %>
145
191
  </div>
192
+ <%- end %>
146
193
 
147
- <%- unless method.aliases.empty? then -%>
194
+ <%- unless method.aliases.empty? %>
148
195
  <div class="aliases">
149
196
  Also aliased as: <%= method.aliases.map do |aka|
150
197
  if aka.parent then # HACK lib/rexml/encodings
@@ -154,19 +201,20 @@
154
201
  end
155
202
  end.join ", " %>
156
203
  </div>
157
- <%- end -%>
204
+ <%- end %>
158
205
 
159
- <%- if method.is_alias_for then -%>
206
+ <%- if method.is_alias_for %>
160
207
  <div class="aliases">
161
208
  Alias for: <a href="<%= klass.aref_to method.is_alias_for.path %>"><%= h method.is_alias_for.name %></a>
162
209
  </div>
163
- <%- end -%>
210
+ <%- end %>
164
211
  </div>
165
212
 
166
- <%- end -%>
213
+ <%- end %>
167
214
  </section>
168
- <%- end
169
- end %>
215
+ <%- end %>
216
+ <%- end %>
170
217
  </section>
171
- <%- end -%>
218
+ <%- end %>
172
219
  </main>
220
+ </body>