Skip to content

Commit 83ba425

Browse files
committed
Fix UI issues with Rustdoc scrape-examples feature.
* Help file was being loaded from the wrong place. * CSS selector in JS has a typo. * Line numbers are overflowing, change to display: grid to fix.
1 parent 579c993 commit 83ba425

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

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

+3-1
Original file line numberDiff line numberDiff line change
@@ -2015,7 +2015,9 @@ in storage.js
20152015
}
20162016

20172017
.scraped-example .code-wrapper .example-wrap {
2018-
flex: 1;
2018+
display: grid;
2019+
grid-template-columns: max-content auto;
2020+
width: 100%;
20192021
overflow-x: auto;
20202022
overflow-y: hidden;
20212023
margin-bottom: 0;

src/librustdoc/html/static/js/scrape-examples.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
});
5858
});
5959

60-
example.querySelector("next")
60+
example.querySelector(".next")
6161
.addEventListener("click", () => {
6262
onChangeLoc(() => {
6363
locIndex = (locIndex + 1) % locs.length;

src/librustdoc/html/static_files.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,4 +130,4 @@ static_files! {
130130
nanum_barun_gothic_license => "static/fonts/NanumBarunGothic-LICENSE.txt",
131131
}
132132

133-
pub(crate) static SCRAPE_EXAMPLES_HELP_MD: &str = include_str!("static/js/scrape-examples.js");
133+
pub(crate) static SCRAPE_EXAMPLES_HELP_MD: &str = include_str!("static/scrape-examples-help.md");

0 commit comments

Comments
 (0)