Skip to content

rustdoc: use simpler CSS for setting the font on scraped examples #105143

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/librustdoc/html/static/css/rustdoc.css
Original file line number Diff line number Diff line change
@@ -197,9 +197,7 @@ a.srclink,
#help-button > a,
details.rustdoc-toggle.top-doc > summary,
details.rustdoc-toggle.non-exhaustive > summary,
.scraped-example-title,
.more-examples-toggle summary, .more-examples-toggle .hide-more,
.example-links a,
.scraped-example-list,
/* This selector is for the items listed in the "all items" page. */
ul.all-items {
font-family: "Fira Sans", Arial, NanumBarunGothic, sans-serif;
8 changes: 8 additions & 0 deletions src/test/rustdoc-gui/scrape-examples-fonts.goml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
goto: "file://" + |DOC_PATH| + "/scrape_examples/fn.test_many.html"

store-value: (font, '"Fira Sans", Arial, NanumBarunGothic, sans-serif')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice usage of variables! 👍


wait-for-css: (".scraped-example-title", {"font-family": |font|})
wait-for-css: (".more-examples-toggle summary", {"font-family": |font|})
wait-for-css: (".more-examples-toggle .hide-more", {"font-family": |font|})
wait-for-css: (".example-links a", {"font-family": |font|})
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
scrape_examples::test_many();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
scrape_examples::test_many();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
scrape_examples::test_many();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
scrape_examples::test_many();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
scrape_examples::test_many();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
scrape_examples::test_many();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
scrape_examples::test_many();
}
2 changes: 2 additions & 0 deletions src/test/rustdoc-gui/src/scrape_examples/src/lib.rs
Original file line number Diff line number Diff line change
@@ -5,3 +5,5 @@
/// test();
/// ```
pub fn test() {}

pub fn test_many() {}