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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 7 additions & 7 deletions
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

Lines changed: 5 additions & 5 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 3 additions & 3 deletions
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

Lines changed: 2 additions & 2 deletions
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

0 commit comments

Comments
 (0)