diff options
| author | bors <bors@rust-lang.org> | 2021-07-25 21:41:57 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2021-07-25 21:41:57 +0000 |
| commit | 5782f01a5136b1f7539b23f67e832f0b994c215d (patch) | |
| tree | ea9b8eef80a07473aeb89a0ccf5ee9d5e706dcd6 /src/librustdoc/html/render | |
| parent | 9c25eb7aa3a71fb951564b0ddf131be59c2c951d (diff) | |
| parent | 76a3b609d0b93c5d8da5e4e3db37bd03e5cb1c30 (diff) | |
| download | rust-5782f01a5136b1f7539b23f67e832f0b994c215d.tar.gz rust-5782f01a5136b1f7539b23f67e832f0b994c215d.zip | |
Auto merge of #87390 - notriddle:notriddle/rustdoc-headers-patch, r=GuillaumeGomez
Rustdoc accessibility: use real headers for doc items Part of #87059 Partially reverts #84703 Preview at: https://notriddle.com/notriddle-rustdoc-test/real-headers/std/index.html
Diffstat (limited to 'src/librustdoc/html/render')
| -rw-r--r-- | src/librustdoc/html/render/mod.rs | 22 | ||||
| -rw-r--r-- | src/librustdoc/html/render/print_item.rs | 4 |
2 files changed, 13 insertions, 13 deletions
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 68c59612ccc..2b7f7aa3691 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1194,7 +1194,7 @@ fn notable_traits_decl(decl: &clean::FnDecl, cx: &Context<'_>) -> String { if out.is_empty() { write!( &mut out, - "<h3 class=\"notable\">Notable traits for {}</h3>\ + "<div class=\"notable\">Notable traits for {}</div>\ <code class=\"content\">", impl_.for_.print(cx) ); @@ -1350,7 +1350,7 @@ fn render_impl( ); render_rightside(w, cx, item, containing_item); write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id); - w.write_str("<code>"); + w.write_str("<h4 class=\"code-header\">"); render_assoc_item( w, item, @@ -1358,7 +1358,7 @@ fn render_impl( ItemType::Impl, cx, ); - w.write_str("</code>"); + w.write_str("</h4>"); w.write_str("</div>"); } } @@ -1371,7 +1371,7 @@ fn render_impl( id, item_type, in_trait_class ); write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id); - w.write_str("<code>"); + w.write_str("<h4 class=\"code-header\">"); assoc_type( w, item, @@ -1381,7 +1381,7 @@ fn render_impl( "", cx, ); - w.write_str("</code>"); + w.write_str("</h4>"); w.write_str("</div>"); } clean::AssocConstItem(ref ty, ref default) => { @@ -1394,7 +1394,7 @@ fn render_impl( ); render_rightside(w, cx, item, containing_item); write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id); - w.write_str("<code>"); + w.write_str("<h4 class=\"code-header\">"); assoc_const( w, item, @@ -1404,7 +1404,7 @@ fn render_impl( "", cx, ); - w.write_str("</code>"); + w.write_str("</h4>"); w.write_str("</div>"); } clean::AssocTypeItem(ref bounds, ref default) => { @@ -1412,7 +1412,7 @@ fn render_impl( let id = cx.derive_id(source_id.clone()); write!(w, "<div id=\"{}\" class=\"{}{}\">", id, item_type, in_trait_class,); write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id); - w.write_str("<code>"); + w.write_str("<h4 class=\"code-header\">"); assoc_type( w, item, @@ -1422,7 +1422,7 @@ fn render_impl( "", cx, ); - w.write_str("</code>"); + w.write_str("</h4>"); w.write_str("</div>"); } clean::StrippedItem(..) => return, @@ -1613,7 +1613,7 @@ pub(crate) fn render_impl_summary( write!(w, "<div id=\"{}\" class=\"impl has-srclink\"{}>", id, aliases); render_rightside(w, cx, &i.impl_item, containing_item); write!(w, "<a href=\"#{}\" class=\"anchor\"></a>", id); - write!(w, "<code class=\"in-band\">"); + write!(w, "<h3 class=\"code-header in-band\">"); if let Some(use_absolute) = use_absolute { write!(w, "{}", i.inner_impl().print(use_absolute, cx)); @@ -1629,7 +1629,7 @@ pub(crate) fn render_impl_summary( } else { write!(w, "{}", i.inner_impl().print(false, cx)); } - write!(w, "</code>"); + write!(w, "</h3>"); let is_trait = i.inner_impl().trait_.is_some(); if is_trait { diff --git a/src/librustdoc/html/render/print_item.rs b/src/librustdoc/html/render/print_item.rs index 2dfbaff1cc9..2290f51aa80 100644 --- a/src/librustdoc/html/render/print_item.rs +++ b/src/librustdoc/html/render/print_item.rs @@ -621,9 +621,9 @@ fn item_trait(w: &mut Buffer, cx: &Context<'_>, it: &clean::Item, t: &clean::Tra render_stability_since(w, m, t, cx.tcx()); write_srclink(cx, m, w); write!(w, "</div>"); - write!(w, "<code>"); + write!(w, "<h4 class=\"code-header\">"); render_assoc_item(w, m, AssocItemLink::Anchor(Some(&id)), ItemType::Impl, cx); - w.write_str("</code>"); + w.write_str("</h4>"); w.write_str("</div>"); if toggled { write!(w, "</summary>"); |
