|
11 | 11 |
|
12 | 12 | <% unless context.requires.empty? %> |
13 | 13 | <!-- File only: requires --> |
14 | | - <div class="sectiontitle">Required Files</div> |
| 14 | + <div class="content__divider">Required Files</div> |
15 | 15 | <ul> |
16 | 16 | <% context.requires.each do |req| %> |
17 | 17 | <li><%= full_name req.name %></li> |
|
23 | 23 | <% sections = context.sections.select { |s| s.title }.sort_by{ |s| s.title.to_s } %> |
24 | 24 | <% unless sections.empty? then %> |
25 | 25 | <!-- Sections --> |
26 | | - <div class="sectiontitle">Sections</div> |
| 26 | + <div class="content__divider">Sections</div> |
27 | 27 | <ul> |
28 | 28 | <% sections.each do |section| %> |
29 | | - <li><%= link_to section.title, "##{section.aref}" %></li> |
| 29 | + <li><%= link_to h(section.title), "##{section.aref}" %></li> |
30 | 30 | <% end %> |
31 | 31 | </ul> |
32 | 32 | <% end %> |
33 | 33 |
|
34 | 34 | <% unless context.method_list.empty? %> |
35 | 35 | <!-- Method ref --> |
36 | | - <div class="sectiontitle">Methods</div> |
| 36 | + <div class="content__divider">Methods</div> |
37 | 37 | <dl class="methods"> |
38 | 38 | <% group_by_first_letter(context.method_list).each do |letter, methods| %> |
39 | 39 | <dt><%= letter %></dt> |
|
43 | 43 | <% |
44 | 44 | comma = methods.size == i+1 ? '' : ',' |
45 | 45 | %> |
46 | | - <li><%= link_to method.name, method %><%= comma %></li> |
| 46 | + <li><%= link_to short_name(method), method %><%= comma %></li> |
47 | 47 | <% end %> |
48 | 48 | </ul> |
49 | 49 | </dd> |
|
53 | 53 |
|
54 | 54 | <% unless context.includes.empty? %> |
55 | 55 | <!-- Includes --> |
56 | | - <div class="sectiontitle">Included Modules</div> |
| 56 | + <div class="content__divider">Included Modules</div> |
57 | 57 | <ul> |
58 | 58 | <% context.includes.each do |inc| %> |
59 | 59 | <li> |
|
72 | 72 | <% context.each_section do |section, constants, attributes| %> |
73 | 73 |
|
74 | 74 | <% if section.title then %> |
75 | | - <div class="contenttitle" id="<%= h section.aref %>"> |
| 75 | + <div class="content__section-title" id="<%= h section.aref %>"> |
76 | 76 | <%= h section.title %> |
77 | 77 | </div> |
78 | 78 | <% end %> |
|
85 | 85 |
|
86 | 86 | <% unless constants.empty? %> |
87 | 87 | <!-- Section constants --> |
88 | | - <h2 class="sectiontitle">Constants</h2> |
| 88 | + <h2 class="content__divider">Constants</h2> |
89 | 89 | <table border='0' cellpadding='5'> |
90 | 90 | <% constants.each do |const| %> |
91 | 91 | <tr valign='top'> |
92 | | - <td class="attr-name"><%= h const.name %></td> |
| 92 | + <td class="attr-name"><%= short_name const %></td> |
93 | 93 | <td>=</td> |
94 | 94 | <td class="attr-value"><%= h const.value %></td> |
95 | 95 | </tr> |
|
106 | 106 |
|
107 | 107 | <% unless attributes.empty? %> |
108 | 108 | <!-- Section attributes --> |
109 | | - <h2 class="sectiontitle">Attributes</h2> |
| 109 | + <h2 class="content__divider">Attributes</h2> |
110 | 110 | <table border='0' cellpadding='5'> |
111 | 111 | <% attributes.each do |attrib| %> |
112 | 112 | <tr valign='top'> |
113 | 113 | <td class='attr-rw'> |
114 | 114 | [<%= attrib.rw %>] |
115 | 115 | </td> |
116 | | - <td class='attr-name'><%= h attrib.name %></td> |
| 116 | + <td class='attr-name'><%= short_name attrib %></td> |
117 | 117 | <td class='attr-desc'><%= attrib.description.strip %></td> |
118 | 118 | </tr> |
119 | 119 | <% end %> |
|
128 | 128 | visibilities.each do |visibility, methods| |
129 | 129 | next if methods.empty? |
130 | 130 | %> |
131 | | - <h2 class="sectiontitle"><%= type.capitalize %> <%= visibility.to_s.capitalize %> methods</h2> |
| 131 | + <h2 class="content__divider"><%= visibility.to_s.capitalize %> <%= type %> methods</h2> |
132 | 132 | <% methods.each do |method| %> |
133 | | - <div class="method"> |
134 | | - <h3 class="title method-title" id="<%= method.aref %>"> |
135 | | - <% if method.call_seq %> |
136 | | - <b><%= method.call_seq.gsub(/->/, '→').gsub(/\n(.)/, '<br />\1') %></b> |
137 | | - <% else %> |
138 | | - <b><%= h method.name %></b><%= h method.params %> |
139 | | - <% end %> |
140 | | - </h3> |
141 | | - <%= link_to "Link", method, class: "permalink", name: method.aref %> |
| 133 | + <div class="method" id="<%= method.aref %>"> |
| 134 | + <div class="method__signature"> |
| 135 | + <h3><%= method_signature method %></h3> |
| 136 | + <%= link_to %(<img src="/i/link.svg" alt="Permalink">), method, |
| 137 | + class: "method__permalink", title: "Permalink" %> |
| 138 | + </div> |
142 | 139 |
|
143 | 140 | <% unless method.aliases.empty? %> |
144 | | - <p class="aka"> |
| 141 | + <p class="method__aka"> |
145 | 142 | Also aliased as: |
146 | 143 | <%# Sometimes a parent cannot be determined. See ruby/rdoc@85ebfe13dc. %> |
147 | | - <%= method.aliases.map { |aka| link_to_if aka.parent, aka.name, aka }.join(", ") %>. |
| 144 | + <%= method.aliases.map { |aka| link_to_if aka.parent, short_name(aka), aka }.join(", ") %>. |
148 | 145 | </p> |
149 | 146 | <% end %> |
150 | 147 |
|
151 | 148 | <% if alias_for = method.is_alias_for then %> |
152 | | - <p class="aka"> |
| 149 | + <p class="method__aka"> |
153 | 150 | Alias for: |
154 | | - <%= link_to alias_for.name, alias_for %>. |
| 151 | + <%= link_to short_name(alias_for), alias_for %>. |
155 | 152 | </p> |
156 | 153 | <% end %> |
157 | 154 |
|
158 | 155 | <% if method.comment %> |
159 | 156 | <div class="description"> |
160 | | - <%= method.description.strip %> |
| 157 | + <%= method.description %> |
161 | 158 | </div> |
162 | 159 | <% end %> |
163 | 160 |
|
164 | 161 | <% source_code, source_url = method_source_code_and_url(method) %> |
165 | 162 | <% if source_code %> |
166 | | - <details class="sourcecode"> |
| 163 | + <details class="method__source"> |
167 | 164 | <summary> |
168 | 165 | <span class="label">Source code</span> |
169 | 166 | <% if source_url %> |
170 | 167 | <%= link_to_external "GitHub", source_url %> |
171 | 168 | <% end %> |
172 | 169 | </summary> |
173 | 170 |
|
174 | | - <div class="dyn-source"> |
175 | | - <pre><code class="ruby"><%= source_code %></code></pre> |
176 | | - </div> |
| 171 | + <pre><code class="ruby"><%= source_code %></code></pre> |
177 | 172 | </details> |
178 | 173 | <% elsif source_url %> |
179 | | - <p><%= link_to_external "GitHub", source_url %></p> |
| 174 | + <p class="method__source"><%= link_to_external "GitHub", source_url %></p> |
180 | 175 | <% end %> |
181 | 176 | </div> |
182 | 177 | <% end %><%# methods.each %> |
|
186 | 181 |
|
187 | 182 | <% unless context.classes_and_modules.empty? %> |
188 | 183 | <!-- Namespace --> |
189 | | - <div class="sectiontitle">Namespace</div> |
| 184 | + <div class="content__divider">Namespace</div> |
190 | 185 | <ul> |
191 | 186 | <% (context.modules.sort + context.classes.sort).each do |mod| %> |
192 | 187 | <li> |
|
0 commit comments