Skip to content

Commit a92b02e

Browse files
committed
Remove <article> from HTML output
This interferes with some screen readers and is redundant according to the HTML 5 specification. Paragraph 4 here: http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-article-element
1 parent dcfcc54 commit a92b02e

File tree

7 files changed

+26
-45
lines changed

7 files changed

+26
-45
lines changed

lib/rdoc/generator/template/darkfish/class.rhtml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
</nav>
1818

1919
<main role="main" aria-labelledby="<%=h klass.aref %>">
20-
<article>
2120
<h1 id="<%=h klass.aref %>" class="<%= klass.type %>">
2221
<%= klass.type %> <%= klass.full_name %>
2322
</h1>
@@ -172,5 +171,4 @@
172171
end %>
173172
</section>
174173
<% end %>
175-
</article>
176174
</main>

lib/rdoc/generator/template/darkfish/index.rhtml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313
</nav>
1414

1515
<main role="main">
16-
<article>
1716
<% if @options.main_page and
1817
main_page = @files.find { |f| f.full_name == @options.main_page } then %>
1918
<%= main_page.description %>
2019
<% else %>
2120
<p>This is the API documentation for <%= @title %>.
2221
<% end %>
23-
</article>
2422
</main>
2523

lib/rdoc/generator/template/darkfish/page.rhtml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@
1313
</nav>
1414

1515
<main role="main" aria-label="Page <%=h file.full_name%>">
16-
<article>
17-
<%= file.description %>
18-
</article>
16+
<%= file.description %>
1917
</main>
2018

lib/rdoc/generator/template/darkfish/rdoc.css

Lines changed: 25 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -252,109 +252,103 @@ ul.link-list .type {
252252
/* @end */
253253

254254
/* @group Documentation Section */
255-
article {
256-
border-top: 2px solid #bbb;
257-
font-size: 100%;
255+
main {
258256
color: #333;
259257
}
260258

261-
main > article:first-child {
262-
border-top: none;
263-
}
264-
265-
main > article:first-child > h1:first-child,
266-
main > article:first-child > h2:first-child,
267-
main > article:first-child > h3:first-child,
268-
main > article:first-child > h4:first-child,
269-
main > article:first-child > h5:first-child,
270-
main > article:first-child > h6:first-child {
259+
main > h1:first-child,
260+
main > h2:first-child,
261+
main > h3:first-child,
262+
main > h4:first-child,
263+
main > h5:first-child,
264+
main > h6:first-child {
271265
margin-top: 0px;
272266
}
273267

274-
article sup {
268+
main sup {
275269
vertical-align: super;
276270
font-size: 0.8em;
277271
}
278272

279273
/* The heading with the class name */
280-
article h1[class] {
274+
main h1[class] {
281275
margin-top: 0;
282276
margin-bottom: 1em;
283277
font-size: 2em;
284278
color: #6C8C22;
285279
}
286280

287-
article h1 {
281+
main h1 {
288282
margin: 2em 0 0.5em;
289283
font-size: 1.7em;
290284
}
291285

292-
article h2 {
286+
main h2 {
293287
margin: 2em 0 0.5em;
294288
font-size: 1.5em;
295289
}
296290

297-
article h3 {
291+
main h3 {
298292
margin: 2em 0 0.5em;
299293
font-size: 1.2em;
300294
}
301295

302-
article h4 {
296+
main h4 {
303297
margin: 2em 0 0.5em;
304298
font-size: 1.1em;
305299
}
306300

307-
article h5 {
301+
main h5 {
308302
margin: 2em 0 0.5em;
309303
font-size: 1em;
310304
}
311305

312-
article h6 {
306+
main h6 {
313307
margin: 2em 0 0.5em;
314308
font-size: 1em;
315309
}
316310

317-
article p {
311+
main p {
318312
margin: 0 0 0.5em;
319313
line-height: 1.4em;
320314
}
321315

322-
article pre {
316+
main pre {
323317
margin: 1.2em 0.5em;
324318
padding: 1em;
325319
font-size: 0.8em;
326320
}
327321

328-
article hr {
322+
main hr {
329323
margin: 1.5em 1em;
330324
border: 2px solid #ddd;
331325
}
332326

333-
article blockquote {
327+
main blockquote {
334328
margin: 0 2em 1.2em 1.2em;
335329
padding-left: 0.5em;
336330
border-left: 2px solid #ddd;
337331
}
338332

339-
article ol,
340-
article ul {
333+
main ol,
334+
main ul {
341335
margin: 1em 2em;
342336
}
343337

344-
article li > p {
338+
main li > p {
345339
margin-bottom: 0.5em;
346340
}
347341

348-
article dl {
342+
main dl {
349343
margin: 1em 0.5em;
350344
}
351345

352-
article dt {
346+
main dt {
353347
margin-bottom: 0.5em;
354348
font-weight: bold;
355349
}
356350

357-
article dd {
351+
main dd {
358352
margin: 0 1em 1em 0.5em;
359353
}
360354

lib/rdoc/generator/template/darkfish/servlet_not_found.rhtml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@
1111
</nav>
1212

1313
<main role="main">
14-
<article role="article">
1514
<h1>Not Found</h1>
1615

1716
<p><%= message %>
18-
</article>
1917
</main>
2018

lib/rdoc/generator/template/darkfish/servlet_root.rhtml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
</nav>
1515

1616
<main role="main">
17-
<article role="article">
1817
<h1>Local RDoc Documentation</h1>
1918

2019
<p>Here you can browse local documentation from the ruby standard library and
@@ -60,7 +59,5 @@
6059
<% end %>
6160
</ul>
6261
<% end %>
63-
64-
</article>
6562
</main>
6663

lib/rdoc/generator/template/darkfish/table_of_contents.rhtml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<body id="top" class="table-of-contents">
22
<main role="main">
3-
<article role="directory">
43
<h1 class="class"><%= h @title %></h1>
54

65
<% simple_files = @files.select { |f| f.text? } %>
@@ -56,5 +55,4 @@
5655
<span class="container"><%= method.parent.full_name %></span>
5756
<% end %>
5857
</ul>
59-
</article>
6058
</main>

0 commit comments

Comments
 (0)