Factor scraping and rendering into separate calls to rustdoc
Simplify toggle UI logic, add workspace root for URLs
This commit is contained in:
parent
7831fee9f8
commit
2855bf039a
8 changed files with 139 additions and 154 deletions
|
@ -2528,9 +2528,16 @@ fn render_call_locations(
|
|||
write_example(w, it.next().unwrap());
|
||||
|
||||
if n_examples > 1 {
|
||||
write!(w, r#"<div class="more-scraped-examples hidden">"#);
|
||||
write!(
|
||||
w,
|
||||
r#"<details class="rustdoc-toggle more-examples-toggle">
|
||||
<summary class="hideme">
|
||||
<span>More examples</span>
|
||||
</summary>
|
||||
<div class="more-scraped-examples">"#
|
||||
);
|
||||
it.for_each(|ex| write_example(w, ex));
|
||||
write!(w, "</div>");
|
||||
write!(w, "</div></details>");
|
||||
}
|
||||
|
||||
write!(w, "</div>");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue