mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
rustdoc: use real buttons for scrape examples controls
This commit is contained in:
parent
62c627c7a3
commit
a979b4a508
@ -2915,7 +2915,7 @@ fn render_call_locations(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Ite
|
||||
);
|
||||
|
||||
if line_ranges.len() > 1 {
|
||||
write!(w, r#"<span class="prev">≺</span> <span class="next">≻</span>"#);
|
||||
write!(w, r#"<button class="prev">≺</button> <button class="next">≻</button>"#);
|
||||
}
|
||||
|
||||
// Look for the example file in the source map if it exists, otherwise return a dummy span
|
||||
|
@ -287,8 +287,11 @@ pub(crate) fn print_src(
|
||||
}
|
||||
}
|
||||
SourceContext::Embedded { offset, needs_expansion } => {
|
||||
extra =
|
||||
if needs_expansion { Some(r#"<span class="expand">↕</span>"#) } else { None };
|
||||
extra = if needs_expansion {
|
||||
Some(r#"<button class="expand">↕</button>"#)
|
||||
} else {
|
||||
None
|
||||
};
|
||||
for line_number in 1..=lines {
|
||||
let line = line_number + offset;
|
||||
writeln!(line_numbers, "<span>{line}</span>")
|
||||
|
@ -1959,6 +1959,12 @@ in storage.js
|
||||
top: 0.25em;
|
||||
z-index: 1;
|
||||
cursor: pointer;
|
||||
padding: 0;
|
||||
background: none;
|
||||
border: none;
|
||||
/* iOS button gradient: https://stackoverflow.com/q/5438567 */
|
||||
-webkit-appearance: none;
|
||||
opacity: 1;
|
||||
}
|
||||
.scraped-example .code-wrapper .prev {
|
||||
right: 2.25em;
|
||||
|
Loading…
Reference in New Issue
Block a user