1
Fork 0

Factor scraping and rendering into separate calls to rustdoc

Simplify toggle UI logic, add workspace root for URLs
This commit is contained in:
Will Crichton 2021-06-01 14:02:09 -07:00
parent 7831fee9f8
commit 2855bf039a
8 changed files with 139 additions and 154 deletions

View file

@ -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>");