Skip to content

Commit e2116ac

Browse files
committed
Auto merge of rust-lang#91356 - GuillaumeGomez:improve-rustdoc-layout, r=jsha
Improve rustdoc layout This is an overtake of rust-lang#89385 originally written by `@cynecx.` I kept the original commit and simply added the missing fixes into a new one. You can test it online [here](https://rustdoc.crud.net/imperio/improve-rustdoc-layout/std/index.html). r? `@jsha`
2 parents 772d51f + d7528e2 commit e2116ac

29 files changed

+343
-237
lines changed

src/librustdoc/html/markdown.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1447,7 +1447,7 @@ fn init_id_map() -> FxHashMap<String, usize> {
14471447
map.insert("theme-choices".to_owned(), 1);
14481448
map.insert("settings-menu".to_owned(), 1);
14491449
map.insert("help-button".to_owned(), 1);
1450-
map.insert("main".to_owned(), 1);
1450+
map.insert("main-content".to_owned(), 1);
14511451
map.insert("search".to_owned(), 1);
14521452
map.insert("crate-search".to_owned(), 1);
14531453
map.insert("render-detail".to_owned(), 1);

src/librustdoc/html/markdown/tests.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ fn test_unique_id() {
1212
"examples",
1313
"method.into_iter",
1414
"foo",
15-
"main",
15+
"main-content",
1616
"search",
1717
"methods",
1818
"examples",
@@ -28,7 +28,7 @@ fn test_unique_id() {
2828
"examples-2",
2929
"method.into_iter-1",
3030
"foo-1",
31-
"main-1",
31+
"main-content-1",
3232
"search-1",
3333
"methods",
3434
"examples-3",
@@ -219,8 +219,8 @@ fn test_header_ids_multiple_blocks() {
219219
);
220220
t(
221221
&mut map,
222-
"# Main",
223-
"<h2 id=\"main-1\" class=\"section-header\"><a href=\"#main-1\">Main</a></h2>",
222+
"# Search",
223+
"<h2 id=\"search-1\" class=\"section-header\"><a href=\"#search-1\">Search</a></h2>",
224224
);
225225
t(
226226
&mut map,

src/librustdoc/html/static/css/noscript.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ of content is hidden by default (depending on the settings too), we have to over
44
rules.
55
*/
66

7-
#main .attributes {
7+
#main-content .attributes {
88
/* Since there is no toggle (the "[-]") when JS is disabled, no need for this margin either. */
99
margin-left: 0 !important;
1010
}

0 commit comments

Comments
 (0)