Skip to content

Commit c910a49

Browse files
committed
rustdoc: remove small from small-section-header
There's no such thing as a big section header, so I don't know why the name was used.
1 parent b10cfcd commit c910a49

19 files changed

+63
-63
lines changed

src/librustdoc/html/render/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ impl<'a> AssocItemLink<'a> {
11451145
fn write_impl_section_heading(mut w: impl fmt::Write, title: &str, id: &str) {
11461146
write!(
11471147
w,
1148-
"<h2 id=\"{id}\" class=\"small-section-header\">\
1148+
"<h2 id=\"{id}\" class=\"section-header\">\
11491149
{title}\
11501150
<a href=\"#{id}\" class=\"anchor\">§</a>\
11511151
</h2>"

src/librustdoc/html/render/print_item.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
430430
last_section = Some(my_section);
431431
write!(
432432
w,
433-
"<h2 id=\"{id}\" class=\"small-section-header\">\
433+
"<h2 id=\"{id}\" class=\"section-header\">\
434434
<a href=\"#{id}\">{name}</a>\
435435
</h2>{ITEM_TABLE_OPEN}",
436436
id = cx.derive_id(my_section.id()),
@@ -827,7 +827,7 @@ fn item_trait(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &clean:
827827
fn write_small_section_header(w: &mut Buffer, id: &str, title: &str, extra_content: &str) {
828828
write!(
829829
w,
830-
"<h2 id=\"{0}\" class=\"small-section-header\">\
830+
"<h2 id=\"{0}\" class=\"section-header\">\
831831
{1}<a href=\"#{0}\" class=\"anchor\">§</a>\
832832
</h2>{2}",
833833
id, title, extra_content
@@ -1260,7 +1260,7 @@ fn item_type_alias(w: &mut Buffer, cx: &mut Context<'_>, it: &clean::Item, t: &c
12601260
if let Some(inner_type) = &t.inner_type {
12611261
write!(
12621262
w,
1263-
"<h2 id=\"aliased-type\" class=\"small-section-header\">\
1263+
"<h2 id=\"aliased-type\" class=\"section-header\">\
12641264
Aliased Type<a href=\"#aliased-type\" class=\"anchor\">§</a></h2>"
12651265
);
12661266

@@ -1685,7 +1685,7 @@ fn item_variants(
16851685
let tcx = cx.tcx();
16861686
write!(
16871687
w,
1688-
"<h2 id=\"variants\" class=\"variants small-section-header\">\
1688+
"<h2 id=\"variants\" class=\"variants section-header\">\
16891689
Variants{}<a href=\"#variants\" class=\"anchor\">§</a>\
16901690
</h2>\
16911691
{}\
@@ -1772,7 +1772,7 @@ fn item_variants(
17721772
write!(
17731773
w,
17741774
"<div class=\"sub-variant-field\">\
1775-
<span id=\"{id}\" class=\"small-section-header\">\
1775+
<span id=\"{id}\" class=\"section-header\">\
17761776
<a href=\"#{id}\" class=\"anchor field\">§</a>\
17771777
<code>{f}: {t}</code>\
17781778
</span>",
@@ -1929,7 +1929,7 @@ fn item_fields(
19291929
if fields.peek().is_some() {
19301930
write!(
19311931
w,
1932-
"<h2 id=\"fields\" class=\"fields small-section-header\">\
1932+
"<h2 id=\"fields\" class=\"fields section-header\">\
19331933
{}{}<a href=\"#fields\" class=\"anchor\">§</a>\
19341934
</h2>\
19351935
{}",
@@ -1943,7 +1943,7 @@ fn item_fields(
19431943
let id = cx.derive_id(format!("{typ}.{field_name}", typ = ItemType::StructField));
19441944
write!(
19451945
w,
1946-
"<span id=\"{id}\" class=\"{item_type} small-section-header\">\
1946+
"<span id=\"{id}\" class=\"{item_type} section-header\">\
19471947
<a href=\"#{id}\" class=\"anchor field\">§</a>\
19481948
<code>{field_name}: {ty}</code>\
19491949
</span>",

src/librustdoc/html/static/css/rustdoc.css

+5-5
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ ul.all-items {
205205

206206
#toggle-all-docs,
207207
a.anchor,
208-
.small-section-header a,
208+
.section-header a,
209209
#src-sidebar a,
210210
.rust a,
211211
.sidebar h2 a,
@@ -742,13 +742,13 @@ nav.sub {
742742
margin: 0 0 15px 0;
743743
}
744744

745-
.small-section-header {
745+
.section-header {
746746
/* fields use <span> tags, but should get their own lines */
747747
display: block;
748748
position: relative;
749749
}
750750

751-
.small-section-header:hover > .anchor, .impl:hover > .anchor,
751+
.section-header:hover > .anchor, .impl:hover > .anchor,
752752
.trait-impl:hover > .anchor, .variant:hover > .anchor {
753753
display: initial;
754754
}
@@ -761,11 +761,11 @@ nav.sub {
761761
.anchor.field {
762762
left: -5px;
763763
}
764-
.small-section-header > .anchor {
764+
.section-header > .anchor {
765765
left: -15px;
766766
padding-right: 8px;
767767
}
768-
h2.small-section-header > .anchor {
768+
h2.section-header > .anchor {
769769
padding-right: 6px;
770770
}
771771

src/librustdoc/html/templates/item_union.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
</code></pre>
55
{{ self.document() | safe }}
66
{% if self.fields_iter().peek().is_some() %}
7-
<h2 id="fields" class="fields small-section-header"> {# #}
7+
<h2 id="fields" class="fields section-header"> {# #}
88
Fields<a href="#fields" class="anchor">§</a> {# #}
99
</h2>
1010
{% for (field, ty) in self.fields_iter() %}
1111
{% let name = field.name.expect("union field name") %}
1212
<span id="structfield.{{ name }}" {#+ #}
13-
class="{{ ItemType::StructField +}} small-section-header"> {# #}
13+
class="{{ ItemType::StructField +}} section-header"> {# #}
1414
<a href="#structfield.{{ name }}" class="anchor field">§</a> {# #}
1515
<code>{{ name }}: {{+ self.print_ty(ty) | safe }}</code> {# #}
1616
</span>

src/librustdoc/html/templates/type_layout.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<h2 id="layout" class="small-section-header"> {# #}
1+
<h2 id="layout" class="section-header"> {# #}
22
Layout<a href="#layout" class="anchor">§</a> {# #}
33
</h2> {# #}
44
<div class="docblock"> {# #}

tests/rustdoc-gui/font-weight.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
go-to: "file://" + |DOC_PATH| + "/lib2/struct.Foo.html"
33
assert-css: ("//*[@class='rust item-decl']//a[text()='Alias']", {"font-weight": "400"})
44
assert-css: (
5-
"//*[@class='structfield small-section-header']//a[text()='Alias']",
5+
"//*[@class='structfield section-header']//a[text()='Alias']",
66
{"font-weight": "400"},
77
)
88
assert-css: ("#method\.a_method > .code-header", {"font-weight": "600"})

tests/rustdoc-gui/headers-color.goml

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ define-function: (
3131
ALL,
3232
)
3333
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html"
34-
assert-css: (".small-section-header a", {"color": |color|}, ALL)
34+
assert-css: (".section-header a", {"color": |color|}, ALL)
3535
go-to: "file://" + |DOC_PATH| + "/test_docs/struct.HeavilyDocumentedStruct.html"
3636
// We select headings (h2, h3, h...).
3737
assert-css: (".docblock > :not(p) > a", {"color": |headings_color|}, ALL)

tests/rustdoc/async-fn-opaque-item.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
// Checking there is only a "Functions" header and no "Opaque types".
1111
// @has async_fn_opaque_item/index.html
12-
// @count - '//*[@class="small-section-header"]' 1
13-
// @has - '//*[@class="small-section-header"]' 'Functions'
12+
// @count - '//*[@class="section-header"]' 1
13+
// @has - '//*[@class="section-header"]' 'Functions'
1414

1515
pub async fn test() {}

tests/rustdoc/compiler-derive-proc-macro.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
// @has 'foo/index.html'
66
// Each compiler builtin proc-macro has a trait equivalent so we should have
77
// a trait section as well.
8-
// @count - '//*[@id="main-content"]//*[@class="small-section-header"]' 2
9-
// @has - '//*[@id="main-content"]//*[@class="small-section-header"]' 'Traits'
10-
// @has - '//*[@id="main-content"]//*[@class="small-section-header"]' 'Derive Macros'
8+
// @count - '//*[@id="main-content"]//*[@class="section-header"]' 2
9+
// @has - '//*[@id="main-content"]//*[@class="section-header"]' 'Traits'
10+
// @has - '//*[@id="main-content"]//*[@class="section-header"]' 'Derive Macros'
1111

1212
// Now checking the correct file is generated as well.
1313
// @has 'foo/derive.Clone.html'

tests/rustdoc/inline-private-with-intermediate-doc-hidden.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66

77
// @has 'foo/index.html'
88
// There should only be one struct displayed.
9-
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 1
10-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Structs'
9+
// @count - '//*[@id="main-content"]/*[@class="section-header"]' 1
10+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs'
1111
// @has - '//*[@id="main-content"]//a[@href="struct.Reexport.html"]' 'Reexport'
1212
// @has - '//*[@id="main-content"]//*[@class="desc docblock-short"]' 'Visible. Original.'
1313

tests/rustdoc/issue-105735-overlapping-reexport-2.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
// @has - '//*[@class="item-name"]/a[@class="type"]' 'AtomicU8'
88
// @has - '//*[@class="item-name"]/a[@class="constant"]' 'AtomicU8'
99
// We also ensure we don't have another item displayed.
10-
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 2
11-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Type Aliases'
12-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Constants'
10+
// @count - '//*[@id="main-content"]/*[@class="section-header"]' 2
11+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Type Aliases'
12+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Constants'
1313

1414
mod other {
1515
pub type AtomicU8 = ();

tests/rustdoc/issue-105735-overlapping-reexport.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
// @has - '//*[@class="item-name"]/a[@class="struct"]' 'AtomicU8'
88
// @has - '//*[@class="item-name"]/a[@class="constant"]' 'AtomicU8'
99
// We also ensure we don't have another item displayed.
10-
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 2
11-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Structs'
12-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Constants'
10+
// @count - '//*[@id="main-content"]/*[@class="section-header"]' 2
11+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs'
12+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Constants'
1313

1414
mod thing {
1515
pub use core::sync::atomic::AtomicU8;

tests/rustdoc/issue-109258-missing-private-inlining.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
// @has 'foo/index.html'
66
// We should only have a "Re-exports" and a "Modules" headers.
7-
// @count - '//*[@id="main-content"]/h2[@class="small-section-header"]' 2
8-
// @has - '//*[@id="main-content"]/h2[@class="small-section-header"]' 'Re-exports'
9-
// @has - '//*[@id="main-content"]/h2[@class="small-section-header"]' 'Modules'
7+
// @count - '//*[@id="main-content"]/h2[@class="section-header"]' 2
8+
// @has - '//*[@id="main-content"]/h2[@class="section-header"]' 'Re-exports'
9+
// @has - '//*[@id="main-content"]/h2[@class="section-header"]' 'Modules'
1010

1111
// @has - '//*[@id="reexport.Foo"]' 'pub use crate::issue_109258::Foo;'
1212
// @has - '//*[@id="reexport.Foo"]//a[@href="issue_109258/struct.Foo.html"]' 'Foo'
@@ -15,8 +15,8 @@ pub use crate::issue_109258::Foo;
1515

1616
// @has 'foo/issue_109258/index.html'
1717
// We should only have a "Structs" header.
18-
// @count - '//*[@id="main-content"]/h2[@class="small-section-header"]' 1
19-
// @has - '//*[@id="main-content"]/h2[@class="small-section-header"]' 'Structs'
18+
// @count - '//*[@id="main-content"]/h2[@class="section-header"]' 1
19+
// @has - '//*[@id="main-content"]/h2[@class="section-header"]' 'Structs'
2020
// @has - '//*[@id="main-content"]//a[@href="struct.Foo.html"]' 'Foo'
2121
// @has 'foo/issue_109258/struct.Foo.html'
2222
pub mod issue_109258 {

tests/rustdoc/issue-109449-doc-hidden-reexports.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ pub mod single_reexport_inherit_hidden {
6666
pub mod single_reexport_no_inline {
6767
// First we ensure that we only have re-exports and no inlined items.
6868
// @has 'foo/single_reexport_no_inline/index.html'
69-
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 1
70-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Re-exports'
69+
// @count - '//*[@id="main-content"]/*[@class="section-header"]' 1
70+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Re-exports'
7171

7272
// Now we check that we don't have links to the items, just `pub use`.
7373
// @has - '//*[@id="main-content"]//*' 'pub use crate::private_module::Public as XFoo;'
@@ -101,10 +101,10 @@ pub mod glob_reexport {
101101
// With glob re-exports, we don't inline `#[doc(hidden)]` items so only `module` items
102102
// should be inlined.
103103
// @has 'foo/glob_reexport/index.html'
104-
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 3
105-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Re-exports'
106-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Structs'
107-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Type Aliases'
104+
// @count - '//*[@id="main-content"]/*[@class="section-header"]' 3
105+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Re-exports'
106+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs'
107+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Type Aliases'
108108

109109
// Now we check we have 1 re-export and 2 inlined items.
110110
// If not item from a glob re-export is visible, we don't show the re-export.

tests/rustdoc/issue-110422-inner-private.rs

+9-9
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88

99
// @has 'foo/index.html'
1010
// Checking there is no "trait" entry.
11-
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 4
12-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Structs'
13-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Constants'
14-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Functions'
15-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Macros'
11+
// @count - '//*[@id="main-content"]/*[@class="section-header"]' 4
12+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs'
13+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Constants'
14+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Functions'
15+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Macros'
1616

1717
// @has - '//a[@href="fn.foo.html"]' 'foo'
1818
fn foo() {
@@ -50,11 +50,11 @@ const BAR: i32 = {
5050

5151
// @has 'foo/struct.Bar.html'
5252
// @has - '//*[@id="method.foo"]/*[@class="code-header"]' 'pub(crate) fn foo()'
53-
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 3
53+
// @count - '//*[@id="main-content"]/*[@class="section-header"]' 3
5454
// We now check that the `Foo` trait is not documented nor visible on `Bar` page.
55-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Implementations'
56-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Auto Trait Implementations'
57-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Blanket Implementations'
55+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Implementations'
56+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Auto Trait Implementations'
57+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Blanket Implementations'
5858
// @!has - '//*[@href="trait.Foo.html#method.babar"]/*[@class="code-header"]' 'fn babar()'
5959
impl Bar {
6060
fn foo() {}

tests/rustdoc/issue-60522-duplicated-glob-reexport.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
#![crate_name = "foo"]
66

77
// @has 'foo/index.html'
8-
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 1
9-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Modules'
8+
// @count - '//*[@id="main-content"]/*[@class="section-header"]' 1
9+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Modules'
1010
// @count - '//*[@id="main-content"]/*[@class="item-table"]//*[@class="mod"]' 2
1111
// @has - '//*[@id="main-content"]//*[@class="mod"]' 'banana'
1212
// @has - '//*[@id="main-content"]//*[@href="banana/index.html"]' 'banana'

tests/rustdoc/nested-items-issue-111415.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55

66
// @has 'foo/index.html'
77
// Checking there are only three sections.
8-
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 3
9-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Structs'
10-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Functions'
11-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Traits'
8+
// @count - '//*[@id="main-content"]/*[@class="section-header"]' 3
9+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Structs'
10+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Functions'
11+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Traits'
1212
// Checking that there are only three items.
1313
// @count - '//*[@id="main-content"]//*[@class="item-name"]' 3
1414
// @has - '//*[@id="main-content"]//a[@href="struct.Bar.html"]' 'Bar'

tests/rustdoc/pub-reexport-of-pub-reexport-46506.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
#![crate_name = "foo"]
55

66
// @has 'foo/associations/index.html'
7-
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 1
8-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Traits'
7+
// @count - '//*[@id="main-content"]/*[@class="section-header"]' 1
8+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Traits'
99
// @has - '//*[@id="main-content"]//a[@href="trait.GroupedBy.html"]' 'GroupedBy'
1010
// @has 'foo/associations/trait.GroupedBy.html'
1111
pub mod associations {
@@ -16,8 +16,8 @@ pub mod associations {
1616
}
1717

1818
// @has 'foo/prelude/index.html'
19-
// @count - '//*[@id="main-content"]/*[@class="small-section-header"]' 1
20-
// @has - '//*[@id="main-content"]/*[@class="small-section-header"]' 'Re-exports'
19+
// @count - '//*[@id="main-content"]/*[@class="section-header"]' 1
20+
// @has - '//*[@id="main-content"]/*[@class="section-header"]' 'Re-exports'
2121
// @has - '//*[@id="main-content"]//*[@id="reexport.GroupedBy"]' 'pub use associations::GroupedBy;'
2222
pub mod prelude {
2323
pub use associations::GroupedBy;

tests/rustdoc/typedef-inner-variants.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub union OneOr<A: Copy> {
6565
// @count - '//*[@id="aliased-type"]' 1
6666
// @count - '//*[@id="variants"]' 0
6767
// @count - '//*[@id="fields"]' 1
68-
// @count - '//*[@class="structfield small-section-header"]' 2
68+
// @count - '//*[@class="structfield section-header"]' 2
6969
// @matches - '//pre[@class="rust item-decl"]//code' "union OneOrF64"
7070
pub type OneOrF64 = OneOr<f64>;
7171

@@ -81,7 +81,7 @@ pub struct One<T> {
8181
// @count - '//*[@id="aliased-type"]' 1
8282
// @count - '//*[@id="variants"]' 0
8383
// @count - '//*[@id="fields"]' 1
84-
// @count - '//*[@class="structfield small-section-header"]' 1
84+
// @count - '//*[@class="structfield section-header"]' 1
8585
// @matches - '//pre[@class="rust item-decl"]//code' "struct OneU64"
8686
// @matches - '//pre[@class="rust item-decl"]//code' "pub val"
8787
pub type OneU64 = One<u64>;

0 commit comments

Comments
 (0)