rdoc 6.7.0 → 6.12.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 (78) hide show
  1. checksums.yaml +4 -4
  2. data/ExampleMarkdown.md +2 -0
  3. data/ExampleRDoc.rdoc +2 -0
  4. data/History.rdoc +64 -62
  5. data/LICENSE.rdoc +2 -0
  6. data/README.rdoc +13 -0
  7. data/RI.md +842 -0
  8. data/TODO.rdoc +8 -7
  9. data/lib/rdoc/{alias.rb → code_object/alias.rb} +1 -1
  10. data/lib/rdoc/{any_method.rb → code_object/any_method.rb} +3 -3
  11. data/lib/rdoc/{attr.rb → code_object/attr.rb} +1 -1
  12. data/lib/rdoc/{class_module.rb → code_object/class_module.rb} +82 -12
  13. data/lib/rdoc/{constant.rb → code_object/constant.rb} +1 -1
  14. data/lib/rdoc/{context → code_object/context}/section.rb +10 -68
  15. data/lib/rdoc/{method_attr.rb → code_object/method_attr.rb} +17 -5
  16. data/lib/rdoc/{top_level.rb → code_object/top_level.rb} +5 -5
  17. data/lib/rdoc/code_object.rb +6 -1
  18. data/lib/rdoc/comment.rb +11 -1
  19. data/lib/rdoc/generator/darkfish.rb +41 -3
  20. data/lib/rdoc/generator/pot/message_extractor.rb +1 -1
  21. data/lib/rdoc/generator/pot/po_entry.rb +1 -1
  22. data/lib/rdoc/generator/template/darkfish/_head.rhtml +23 -0
  23. data/lib/rdoc/generator/template/darkfish/_sidebar_classes.rhtml +1 -0
  24. data/lib/rdoc/generator/template/darkfish/_sidebar_methods.rhtml +20 -11
  25. data/lib/rdoc/generator/template/darkfish/_sidebar_parent.rhtml +3 -8
  26. data/lib/rdoc/generator/template/darkfish/_sidebar_toggle.rhtml +3 -0
  27. data/lib/rdoc/generator/template/darkfish/class.rhtml +69 -43
  28. data/lib/rdoc/generator/template/darkfish/css/rdoc.css +380 -399
  29. data/lib/rdoc/generator/template/darkfish/index.rhtml +11 -10
  30. data/lib/rdoc/generator/template/darkfish/js/darkfish.js +24 -1
  31. data/lib/rdoc/generator/template/darkfish/page.rhtml +5 -5
  32. data/lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml +10 -8
  33. data/lib/rdoc/generator/template/darkfish/servlet_root.rhtml +5 -2
  34. data/lib/rdoc/generator/template/darkfish/table_of_contents.rhtml +11 -0
  35. data/lib/rdoc/markdown.kpeg +1 -1
  36. data/lib/rdoc/markdown.rb +21 -11
  37. data/lib/rdoc/markup/attribute_manager.rb +2 -2
  38. data/lib/rdoc/markup/formatter.rb +19 -12
  39. data/lib/rdoc/markup/pre_process.rb +26 -6
  40. data/lib/rdoc/markup/to_bs.rb +1 -1
  41. data/lib/rdoc/markup/to_html.rb +1 -1
  42. data/lib/rdoc/markup/to_html_crossref.rb +63 -12
  43. data/lib/rdoc/markup/to_rdoc.rb +5 -5
  44. data/lib/rdoc/markup.rb +18 -13
  45. data/lib/rdoc/options.rb +78 -12
  46. data/lib/rdoc/parser/c.rb +26 -2
  47. data/lib/rdoc/parser/changelog.rb +5 -4
  48. data/lib/rdoc/parser/prism_ruby.rb +1099 -0
  49. data/lib/rdoc/parser/ripper_state_lex.rb +7 -305
  50. data/lib/rdoc/parser/ruby.rb +16 -7
  51. data/lib/rdoc/parser/simple.rb +1 -1
  52. data/lib/rdoc/parser.rb +5 -4
  53. data/lib/rdoc/rd/block_parser.rb +3 -3
  54. data/lib/rdoc/rd/inline_parser.rb +3 -3
  55. data/lib/rdoc/rdoc.rb +6 -3
  56. data/lib/rdoc/ri/driver.rb +74 -29
  57. data/lib/rdoc/rubygems_hook.rb +90 -8
  58. data/lib/rdoc/store.rb +12 -0
  59. data/lib/rdoc/task.rb +2 -3
  60. data/lib/rdoc/tom_doc.rb +1 -7
  61. data/lib/rdoc/version.rb +1 -1
  62. data/lib/rdoc.rb +22 -24
  63. data/lib/rubygems_plugin.rb +23 -0
  64. metadata +27 -26
  65. data/RI.rdoc +0 -57
  66. data/lib/rdoc/generator/template/darkfish/.document +0 -0
  67. data/lib/rdoc/generator/template/json_index/.document +0 -1
  68. /data/lib/rdoc/{anon_class.rb → code_object/anon_class.rb} +0 -0
  69. /data/lib/rdoc/{context.rb → code_object/context.rb} +0 -0
  70. /data/lib/rdoc/{extend.rb → code_object/extend.rb} +0 -0
  71. /data/lib/rdoc/{ghost_method.rb → code_object/ghost_method.rb} +0 -0
  72. /data/lib/rdoc/{include.rb → code_object/include.rb} +0 -0
  73. /data/lib/rdoc/{meta_method.rb → code_object/meta_method.rb} +0 -0
  74. /data/lib/rdoc/{mixin.rb → code_object/mixin.rb} +0 -0
  75. /data/lib/rdoc/{normal_class.rb → code_object/normal_class.rb} +0 -0
  76. /data/lib/rdoc/{normal_module.rb → code_object/normal_module.rb} +0 -0
  77. /data/lib/rdoc/{require.rb → code_object/require.rb} +0 -0
  78. /data/lib/rdoc/{single_class.rb → code_object/single_class.rb} +0 -0
@@ -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
6
  <%- 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,24 @@
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
20
  <main role="main" aria-labelledby="<%=h klass.aref %>">
20
- <h1 id="<%=h klass.aref %>" class="<%= klass.type %>">
21
+ <h1 id="<%=h klass.aref %>" class="anchor-link <%= klass.type %>">
21
22
  <%= klass.type %> <%= klass.full_name %>
22
23
  </h1>
23
24
 
@@ -26,7 +27,7 @@
26
27
  </section>
27
28
 
28
29
  <%- klass.each_section do |section, constants, attributes| -%>
29
- <section id="<%= section.aref %>" class="documentation-section">
30
+ <section id="<%= section.aref %>" class="documentation-section anchor-link">
30
31
  <%- if section.title then -%>
31
32
  <header class="documentation-section-title">
32
33
  <h2>
@@ -53,7 +54,13 @@
53
54
  <%- constants.each do |const| -%>
54
55
  <dt id="<%= const.name %>"><%= const.name %>
55
56
  <%- if const.comment then -%>
56
- <dd><%= const.description.strip %>
57
+ <dd>
58
+ <%- if const.mixin_from then -%>
59
+ <div class="mixin-from">
60
+ Included from <a href="<%= klass.aref_to(const.mixin_from.path)%>"><%= const.mixin_from.full_name %></a>
61
+ </div>
62
+ <%- end -%>
63
+ <%= const.description.strip %>
57
64
  <%- else -%>
58
65
  <dd class="missing-docs">(Not documented)
59
66
  <%- end -%>
@@ -69,13 +76,20 @@
69
76
  </header>
70
77
 
71
78
  <%- attributes.each do |attrib| -%>
72
- <div id="<%= attrib.aref %>" class="method-detail">
79
+ <div id="<%= attrib.aref %>" class="method-detail anchor-link">
73
80
  <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>
81
+ <a href="#<%= attrib.aref %>" title="Link to this attribute">
82
+ <span class="method-name"><%= h attrib.name %></span>
83
+ <span class="attribute-access-type">[<%= attrib.rw %>]</span>
84
+ </a>
76
85
  </div>
77
86
 
78
87
  <div class="method-description">
88
+ <%- if attrib.mixin_from then -%>
89
+ <div class="mixin-from">
90
+ <%= attrib.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(attrib.mixin_from.path)%>"><%= attrib.mixin_from.full_name %></a>
91
+ </div>
92
+ <%- end -%>
79
93
  <%- if attrib.comment then -%>
80
94
  <%= attrib.description.strip %>
81
95
  <%- else -%>
@@ -91,44 +105,62 @@
91
105
  next if visibilities.empty?
92
106
  visibilities.each do |visibility, methods|
93
107
  next if methods.empty? %>
94
- <section id="<%= visibility %>-<%= type %>-<%= section.aref %>-method-details" class="method-section">
108
+ <section id="<%= visibility %>-<%= type %>-<%= section.aref %>-method-details" class="method-section anchor-link">
95
109
  <header>
96
110
  <h3><%= visibility.to_s.capitalize %> <%= type.capitalize %> Methods</h3>
97
111
  </header>
98
112
 
99
113
  <%- methods.each do |method| -%>
100
- <div id="<%= method.aref %>" class="method-detail <%= method.is_alias_for ? "method-alias" : '' %>">
114
+ <div id="<%= method.aref %>" class="method-detail anchor-link <%= method.is_alias_for ? "method-alias" : '' %>">
101
115
  <div class="method-header">
102
116
  <%- 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(/(.*)[-=]&gt;/, '\1&rarr;') %>
109
- </span>
110
- <%- if i == 0 and method.token_stream then -%>
111
- <span class="method-click-advice">click to toggle source</span>
117
+ <%- call_seq.strip.split("\n").each_with_index do |call_seq, i| -%>
118
+ <div class="method-heading">
119
+ <a href="#<%= method.aref %>" title="Link to this method">
120
+ <span class="method-callseq">
121
+ <%= h(call_seq.strip.
122
+ gsub( /^\w+\./m, '')).
123
+ gsub(/(.*)[-=]&gt;/, '\1&rarr;') %>
124
+ </span>
125
+ </a>
126
+ </div>
112
127
  <%- end -%>
113
- </div>
114
- <%- end -%>
115
128
  <%- elsif method.has_call_seq? then -%>
116
- <div class="method-heading">
117
- <span class="method-name"><%= h method.name %></span>
118
- </div>
129
+ <div class="method-heading">
130
+ <a href="#<%= method.aref %>" title="Link to this method">
131
+ <span class="method-name"><%= h method.name %></span>
132
+ </a>
133
+ </div>
119
134
  <%- else -%>
120
- <div class="method-heading">
121
- <span class="method-name"><%= h method.name %></span><span
122
- class="method-args"><%= h method.param_seq %></span>
123
- <%- if method.token_stream then -%>
124
- <span class="method-click-advice">click to toggle source</span>
125
- <%- end -%>
126
- </div>
135
+ <div class="method-heading">
136
+ <a href="#<%= method.aref %>" title="Link to this method">
137
+ <span class="method-name"><%= h method.name %></span>
138
+ <span class="method-args"><%= h method.param_seq %></span>
139
+ </a>
140
+ </div>
127
141
  <%- end -%>
128
142
  </div>
129
143
 
144
+ <%- if method.token_stream -%>
145
+ <div class="method-controls">
146
+ <details class="method-source-toggle">
147
+ <summary>Source</summary>
148
+ </details>
149
+ </div>
150
+ <%- end -%>
151
+
130
152
  <%- unless method.skip_description? then -%>
131
153
  <div class="method-description">
154
+ <%- if method.token_stream then -%>
155
+ <div class="method-source-code" id="<%= method.html_name %>-source">
156
+ <pre><%= method.markup_code %></pre>
157
+ </div>
158
+ <%- end -%>
159
+ <%- if method.mixin_from then -%>
160
+ <div class="mixin-from">
161
+ <%= method.singleton ? "Extended" : "Included" %> from <a href="<%= klass.aref_to(method.mixin_from.path)%>"><%= method.mixin_from.full_name %></a>
162
+ </div>
163
+ <%- end -%>
132
164
  <%- if method.comment then -%>
133
165
  <%= method.description.strip %>
134
166
  <%- else -%>
@@ -143,12 +175,6 @@
143
175
  %>
144
176
  </div>
145
177
  <%- end -%>
146
-
147
- <%- if method.token_stream then -%>
148
- <div class="method-source-code" id="<%= method.html_name %>-source">
149
- <pre><%= method.markup_code %></pre>
150
- </div>
151
- <%- end -%>
152
178
  </div>
153
179
  <%- end -%>
154
180