Skip to content

Commit 679d7ea

Browse files
committed
Include additional documentation for scrape-examples changes
1 parent 4574217 commit 679d7ea

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/librustdoc/html/static/css/rustdoc.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1817,9 +1817,12 @@ in storage.js
18171817

18181818
/* Should have min-width: (N + 1)px where N is the mobile breakpoint above. */
18191819
@media (min-width: 701px) {
1820+
/* Places file-link for a scraped example on top of the example to save space.
1821+
We only do this on large screens so the file-link doesn't overlap too much
1822+
with the example's content. */
18201823
.scraped-example-title {
18211824
position: absolute;
1822-
z-index: 1000;
1825+
z-index: 10;
18231826
background: var(--main-background-color);
18241827
bottom: 8px;
18251828
right: 5px;
@@ -1915,6 +1918,7 @@ in storage.js
19151918
}
19161919

19171920
.scraped-example {
1921+
/* So .scraped-example-title can be positioned absolutely */
19181922
position: relative;
19191923
}
19201924

src/librustdoc/html/static/js/scrape-examples.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33
"use strict";
44

55
(function() {
6-
// Number of lines shown when code viewer is not expanded
6+
// Number of lines shown when code viewer is not expanded.
7+
// DEFAULT is the first example shown by default, while HIDDEN is
8+
// the examples hidden beneath the "More examples" toggle.
79
const DEFAULT_MAX_LINES = 5;
810
const HIDDEN_MAX_LINES = 10;
911

0 commit comments

Comments
 (0)