<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/librustdoc/html/static/css/rustdoc.css, branch 1.67.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.67.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.67.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2022-12-09T06:25:46+00:00</updated>
<entry>
<title>Rollup merge of #105442 - notriddle:notriddle/docblock-table-css, r=GuillaumeGomez</title>
<updated>2022-12-09T06:25:46+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2022-12-09T06:25:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=441669c382298661db59cdf4374dbd40ab75b222'/>
<id>urn:sha1:441669c382298661db59cdf4374dbd40ab75b222</id>
<content type='text'>
rustdoc: clean up docblock table CSS

# Preview

http://notriddle.com/notriddle-rustdoc-demos/table-2/test_dingus/fn.test.html

# Before

![image](https://user-images.githubusercontent.com/1593513/206364287-1b80eaaf-2e0e-4138-8b56-4aa8ff39abac.png)

# After

![image](https://user-images.githubusercontent.com/1593513/206364209-d287d165-31be-4de1-9b43-05b35ce2a86b.png)

# Details

* The rule `display: block` had no noticeable effect. Technically, because markdown tables have a tbody and thead, they get wrapped in an [anonymous table box] in the CSS tree, nested within the `&lt;table&gt;` element's block layout box.

  This rule was added in #87230 to make the table side-scrolling, but this same issue was doubly fixed in #88742 by wrapping it in an explicit `&lt;div&gt;` tag. Since accessibility advocates recommend the wrapper div over marking the table as `display: block`, we'll stick with that.

  https://adrianroselli.com/2020/11/under-engineered-responsive-tables.html

* The rule `width: calc(100% - 2px)` had no visible effect, because the anonymous table box was not affected.

* The style is tweaked to basically be the same style GitHub uses. In particular, it adds zebra stripes, and removes dotted borders.

  https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Markdown.20table.20styling

[anonymous table box]: https://www.w3.org/TR/CSS2/tables.html#anonymous-boxes
</content>
</entry>
<entry>
<title>Rollup merge of #105387 - willcrichton:scrape-examples-ui-improvements, r=notriddle</title>
<updated>2022-12-09T06:25:44+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2022-12-09T06:25:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5fd540b8fe1a131b1e00b5b147c52d5ba15a7210'/>
<id>urn:sha1:5fd540b8fe1a131b1e00b5b147c52d5ba15a7210</id>
<content type='text'>
Improve Rustdoc scrape-examples UI

This PR combines a few different improvements to the scrape-examples UI. See a live demo here: https://willcrichton.net/misc/scrape-examples/small-first-example/clap/struct.Arg.html

### 1. The first scraped example now takes up significantly less screen height.
Inserting the first scraped example takes up a lot of vertical screen space. I don't want this addition to overwhelm users, so I decided to reduce the height of the initial example in two ways: (A) the default un-expanded height is reduced from 240px (10 LOC) to 120px (5 LOC), and (B) the link to the example is now positioned *over* the example instead of *atop* the example (only on desktop though, not mobile). The changes to `scrape-examples.js` and `rustdoc.css` implement this fix.

Here is what an example docblock now looks like:

![Screen Shot 2022-12-06 at 10 02 21 AM](https://user-images.githubusercontent.com/663326/205987450-3940063c-5973-4a34-8579-baff6a43aa9b.png)

### 2. Expanding all docblocks will not expand "More examples".
The "More examples blocks" are huge, so fully expanding everything on the page would take up too much vertical space. The changes to `main.js` implement this fix. This is tested in `scrape-examples-toggle.goml`.

### 3. Examples from binary crates are sorted higher than examples from library crates.
Code that is written as an example of an API is probably better for learning than code that happens to use an API, but isn't intended for pedagogic purposes. Unfortunately Rustc doesn't know whether a particular crate comes from an example target (only Cargo knows this). But we can at least create a proxy that prefers examples from binary crates over library crates, which we know from `--crate-type`.

This change is implemented by adding a new field `bin_crate` in `Options` (see `config.rs`). An `is_bin` field has been added to the scraped examples metadata (see `scrape_examples.rs`). Then the example sorting metric uses `is_bin` as the first entry of a lexicographic sort on `(is_bin, example_size, display_name)` (see `render/mod.rs`).

Note that in the future we can consider adding another flag like `--scrape-examples-cargo-target` that would pass target information from Cargo into the example metadata. But I'm proposing a less intrusive change for now.

### 4. The scrape-examples help page has been updated to reflect the latest Cargo interface.

See `scrape-examples-help.md`.

r? `@notriddle`

P.S. once this PR and rust-lang/cargo#11450 are merged, then I think the scrape-examples feature is officially ready for deployment on docs.rs!
</content>
</entry>
<entry>
<title>rustdoc: add GUI test case for docblock table colors</title>
<updated>2022-12-08T17:37:03+00:00</updated>
<author>
<name>Michael Howell</name>
<email>michael@notriddle.com</email>
</author>
<published>2022-12-08T16:38:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=34700f6594436b49005151ee12dd2ae06c7cad03'/>
<id>urn:sha1:34700f6594436b49005151ee12dd2ae06c7cad03</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rustdoc: clean up docblock table CSS</title>
<updated>2022-12-08T05:49:10+00:00</updated>
<author>
<name>Michael Howell</name>
<email>michael@notriddle.com</email>
</author>
<published>2022-12-08T04:59:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a09e8c55c663d2b070f99ab0fdadbcc2c45656b2'/>
<id>urn:sha1:a09e8c55c663d2b070f99ab0fdadbcc2c45656b2</id>
<content type='text'>
* The rule `display: block` had no noticeable effect. Technically, because
  markdown tables have a tbody and thead, they get wrapped in an [anonymous
  table box] in the CSS tree, nested within the `&lt;table&gt;` element's block
  layout box.

  This rule was added in #87230 to make the table side-scrolling, but
  this same issue was doubly fixed in #88742 by wrapping it in an explicit
  `&lt;div&gt;` tag. Since accessibility advocates recommend the wrapper div over
  marking the table as `display: block`, we'll stick with that.

  https://adrianroselli.com/2020/11/under-engineered-responsive-tables.html

* The rule `width: calc(100% - 2px)` had no visible effect, because the
  anonymous table box was not affected.

* The style is tweaked to basically be the same style GitHub uses.
  In particular, it adds zebra stripes, and removes dotted borders.

[anonymous table box]: https://www.w3.org/TR/CSS2/tables.html#anonymous-boxes
</content>
</entry>
<entry>
<title>Improve calculation of scraped example minimized height</title>
<updated>2022-12-07T18:42:09+00:00</updated>
<author>
<name>Will Crichton</name>
<email>wcrichto@cs.stanford.edu</email>
</author>
<published>2022-12-07T18:24:16+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=9499d2cce3bebef96d8ae64442602f87726a875a'/>
<id>urn:sha1:9499d2cce3bebef96d8ae64442602f87726a875a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix rustdoc error with no providec crate-type, fix scrape examples button colors w/ themes</title>
<updated>2022-12-07T17:08:43+00:00</updated>
<author>
<name>Will Crichton</name>
<email>wcrichto@cs.stanford.edu</email>
</author>
<published>2022-12-06T19:24:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0709e534df2a85486f981bfbebd153bb25e3703d'/>
<id>urn:sha1:0709e534df2a85486f981bfbebd153bb25e3703d</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Include additional documentation for scrape-examples changes</title>
<updated>2022-12-07T17:08:43+00:00</updated>
<author>
<name>Will Crichton</name>
<email>wcrichto@cs.stanford.edu</email>
</author>
<published>2022-12-06T17:34:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=679d7ea064491dfc8d067fcef07827e7569a093e'/>
<id>urn:sha1:679d7ea064491dfc8d067fcef07827e7569a093e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Only put title over example on large screens</title>
<updated>2022-12-07T17:08:43+00:00</updated>
<author>
<name>Will Crichton</name>
<email>wcrichto@cs.stanford.edu</email>
</author>
<published>2022-12-06T07:48:07+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=45742170741d6c6b9abda5fc51012a01ce1c704a'/>
<id>urn:sha1:45742170741d6c6b9abda5fc51012a01ce1c704a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Improve several aspects of the Rustdoc scrape-examples UI.</title>
<updated>2022-12-07T17:08:43+00:00</updated>
<author>
<name>Will Crichton</name>
<email>wcrichto@cs.stanford.edu</email>
</author>
<published>2022-11-27T19:11:21+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6ccd14a782420d27aef9d9fcd9196949a3276427'/>
<id>urn:sha1:6ccd14a782420d27aef9d9fcd9196949a3276427</id>
<content type='text'>
* Examples take up less screen height.
* Snippets from binary crates are prioritized.
* toggle-all-docs does not expand "More examples" sections.
</content>
</entry>
<entry>
<title>Rollup merge of #105403 - notriddle:notriddle/item-stab-css, r=GuillaumeGomez</title>
<updated>2022-12-07T14:39:09+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>matthias.krueger@famsik.de</email>
</author>
<published>2022-12-07T14:39:09+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c75478b2460677141e8668fc69669e19d4a6584c'/>
<id>urn:sha1:c75478b2460677141e8668fc69669e19d4a6584c</id>
<content type='text'>
rustdoc: simplify CSS selectors for item table `.stab`

The module-item and import-item classes are attached to the item-left. Just target that, instead.
</content>
</entry>
</feed>
