Skip to content

Commit

Permalink
Fix UI issues with Rustdoc scrape-examples feature.
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
willcrichton committed Nov 27, 2022
1 parent 579c993 commit 83ba425
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
Expand Up @@ -2015,7 +2015,9 @@ in storage.js
}

.scraped-example .code-wrapper .example-wrap {
flex: 1;
display: grid;
grid-template-columns: max-content auto;
width: 100%;
overflow-x: auto;
overflow-y: hidden;
margin-bottom: 0;
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/static/js/scrape-examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
});
});

example.querySelector("next")
example.querySelector(".next")
.addEventListener("click", () => {
onChangeLoc(() => {
locIndex = (locIndex + 1) % locs.length;
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/static_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@ static_files! {
nanum_barun_gothic_license => "static/fonts/NanumBarunGothic-LICENSE.txt",
}

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

0 comments on commit 83ba425

Please sign in to comment.