<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/src/librustdoc/html/layout.rs, branch 1.78.0</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=1.78.0</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=1.78.0'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2023-10-09T03:17:53+00:00</updated>
<entry>
<title>rustdoc: remove rust logo from non-Rust crates</title>
<updated>2023-10-09T03:17:53+00:00</updated>
<author>
<name>Michael Howell</name>
<email>michael@notriddle.com</email>
</author>
<published>2023-09-19T23:28:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c6e6ecb1afea9695a42d0f148ce153536b279eb5'/>
<id>urn:sha1:c6e6ecb1afea9695a42d0f148ce153536b279eb5</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rustdoc: clean up the layout for annotated version numbers</title>
<updated>2023-10-09T03:17:53+00:00</updated>
<author>
<name>Michael Howell</name>
<email>michael@notriddle.com</email>
</author>
<published>2023-09-19T00:48:18+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6d6fa792fffa6e22eec1b30cedee6e8306d0df64'/>
<id>urn:sha1:6d6fa792fffa6e22eec1b30cedee6e8306d0df64</id>
<content type='text'>
This should result in a layout for the actual standard library,
when built on CI, that looks like this:

    _____
   /     \ std
   |  R  | 1.74.0-nightly
   \_____/

   (203c57dbe 2023-09-17)

Having the whole version as one string caused it to flex wrap,
because the sidebar isn't wide enough to fit the whole thing.
</content>
</entry>
<entry>
<title>rustdoc: show crate name beside small logo</title>
<updated>2023-10-09T03:17:40+00:00</updated>
<author>
<name>Michael Howell</name>
<email>michael@notriddle.com</email>
</author>
<published>2023-09-18T18:59:49+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=28ee5da4b7595465633e5852e0d5d1632fec02ae'/>
<id>urn:sha1:28ee5da4b7595465633e5852e0d5d1632fec02ae</id>
<content type='text'>
This commit changes the layout to something a bit less "look at my logo!!!111"
gigantic, and makes it clearer where clicking the logo will actually take you.
It also means the crate name is persistently at the top of the sidebar, even
when in a sub-item page, and clicking that name takes you back to the root.

|         | Short crate name | Long crate name |
|---------|------------------|-----------------|
| Root    | ![short-root]    | ![long-root]
| Subpage | ![short-subpage] | ![long-subpage]

[short-root]: https://github.com/rust-lang/rust/assets/1593513/fe2ce102-d4b8-44e6-9f7b-68636a907f56
[short-subpage]: https://github.com/rust-lang/rust/assets/1593513/29501663-56c0-4151-b7de-d2637e167125
[long-root]: https://github.com/rust-lang/rust/assets/1593513/f6a385c0-b4c5-4a9c-954b-21b38de4192f
[long-subpage]: https://github.com/rust-lang/rust/assets/1593513/97ec47b4-61bf-4ebe-b461-0d2187b8c6ca

https://notriddle.com/rustdoc-html-demo-4/logo-lockup/image/index.html

https://notriddle.com/rustdoc-html-demo-4/logo-lockup/crossbeam_channel/index.html

https://notriddle.com/rustdoc-html-demo-4/logo-lockup/adler/struct.Adler32.html

https://notriddle.com/rustdoc-html-demo-4/logo-lockup/crossbeam_channel/struct.Sender.html

This improves visual information density (the construct with the logo and
crate name is *shorter* than the logo on its own, because it's not
square) and navigation clarity (we can now see what clicking the Rust logo
does, specifically).

Compare this with the layout at [Phoenix's Hexdocs] (which is what this
proposal is closely based on), the old proposal on [Internals Discourse]
(which always says "Rust standard library" in the sidebar, but doesn't do the
side-by-side layout).

[Phoenix's Hexdocs]: https://hexdocs.pm/phoenix/1.7.7/overview.html
[Internals Discourse]: https://internals.rust-lang.org/t/poc-of-a-new-design-for-the-generated-rustdoc/11018

In newer versions of rustdoc, the crate name and version are always shown in
the sidebar, even in subpages. Clicking the crate name does the same thing
clicking the logo always did: return you to the crate root.

While this actually takes up less screen real estate than the old layout on
desktop, it takes up more HTML. It's also a bit more visually complex.

I could do what the Internals POC did and keep the vertically stacked layout
all the time, instead of doing a horizontal stack where possible. It would
take up more screen real estate, though.

This design is lifted almost verbatim from Hexdocs. It seems to work for them.
[`opentelemetry_process_propagator`], for example, has a long application name.

[`opentelemetry_process_propagator`]: https://hexdocs.pm/opentelemetry_process_propagator/OpentelemetryProcessPropagator.html

Has anyone written the rationale on why the Rust logo shows up on projects that
aren't the standard library? If we turned it off on non-standard crates by
default, it would line wrap crate names a lot less often.

Or maybe we should encourage crate authors to include their own logo more
often? It certainly helps give people a better sense of "place."

I'm not sure of anything that directly follows up this one. Plenty of other
changes could be made to improve the layout, like

* coming up with a less cluttered way to do disclosure (there's a lot of `[-]`
  on the page)
* doing a better job of separating lateral navigation (vec::Vec links to
  vec::IntoIter) and the table of contents (vec::Vec links to vec::Vec::new)
* giving readers more control of how much rustdoc hows them, and giving doc
  authors more control of how much it generates
* better search that reduces the need to browse

But those are mostly orthogonal, not future possibilities unlocked by this change.
</content>
</entry>
<entry>
<title>Link to the corresponding channel in the help popover</title>
<updated>2023-06-23T14:32:55+00:00</updated>
<author>
<name>Guillaume Gomez</name>
<email>guillaume.gomez@huawei.com</email>
</author>
<published>2023-06-23T14:20:57+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=2f1939ab8b147b28809604d14876cb958e935cdd'/>
<id>urn:sha1:2f1939ab8b147b28809604d14876cb958e935cdd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rustdoc: remove meta keywords from HTML</title>
<updated>2023-01-30T19:20:06+00:00</updated>
<author>
<name>Michael Howell</name>
<email>michael@notriddle.com</email>
</author>
<published>2023-01-30T19:20:06+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f5bac0c4c8b00eceaba627b4bf074a38f1971330'/>
<id>urn:sha1:f5bac0c4c8b00eceaba627b4bf074a38f1971330</id>
<content type='text'>
Discussed in
&lt;https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.60.3Cmeta.20name.3D.22keywords.22.3E.60&gt;
</content>
</entry>
<entry>
<title>Fix `rustdoc --version` when used with download-rustc</title>
<updated>2022-11-09T08:54:51+00:00</updated>
<author>
<name>Joshua Nelson</name>
<email>jnelson@cloudflare.com</email>
</author>
<published>2022-11-09T08:52:59+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=a68ec2205335e2c3de8ba56fb6a31b99f10c95a6'/>
<id>urn:sha1:a68ec2205335e2c3de8ba56fb6a31b99f10c95a6</id>
<content type='text'>
Previously, rustdoc would unconditionally report the version that *rustc* was compiled with.
That showed things like `nightly-2022-10-30`, which wasn't right, since this was a `dev` build compiled from source.

Fix it by changing `rustc_driver::version` to a macro expanded at invocation time.
</content>
</entry>
<entry>
<title>Move string literal into format string</title>
<updated>2022-10-29T21:49:00+00:00</updated>
<author>
<name>Jacob Hoffman-Andrews</name>
<email>github@hoffman-andrews.com</email>
</author>
<published>2022-10-29T21:49:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=c9dbfe31e2e7001571e4d21e46f93d96489df791'/>
<id>urn:sha1:c9dbfe31e2e7001571e4d21e46f93d96489df791</id>
<content type='text'>
Co-authored-by: Michael Howell &lt;michael@notriddle.com&gt;</content>
</entry>
<entry>
<title>Make --static-root-path point to static.files</title>
<updated>2022-10-29T19:47:51+00:00</updated>
<author>
<name>Jacob Hoffman-Andrews</name>
<email>github@hoffman-andrews.com</email>
</author>
<published>2022-09-29T06:52:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=bf2533406670078a9110122f8c90e53285f994b6'/>
<id>urn:sha1:bf2533406670078a9110122f8c90e53285f994b6</id>
<content type='text'>
</content>
</entry>
<entry>
<title>rustdoc: add hash to filename of toolchain files</title>
<updated>2022-10-29T19:47:48+00:00</updated>
<author>
<name>Jacob Hoffman-Andrews</name>
<email>github@hoffman-andrews.com</email>
</author>
<published>2022-10-24T08:28:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f9e1f6ffdf03ec33cb29e20c88fc7bcc938c7f42'/>
<id>urn:sha1:f9e1f6ffdf03ec33cb29e20c88fc7bcc938c7f42</id>
<content type='text'>
All static files used by rustdoc are now stored in static.files/ and
include a hash of their contents. They no longer include the contents of
the --resource-suffix flag. This clarifies caching semantics. Anything
in static.files can use Cache-Control: immutable because any updates
will show up as a new URL.

Invocation-specific files like crates-NN.js, search-index-NN.js,
and sidebar-items-NN.js still get the resource suffix.

The --disable-minification flag is removed because it would vary the
output of static files based on invocation flags. Instead, for
rustdoc development purposes it's preferable to symlink static files
to a non-minified copy for quick iteration.
</content>
</entry>
<entry>
<title>Improve loading of crates.js and sidebar-items.js</title>
<updated>2022-06-20T18:12:55+00:00</updated>
<author>
<name>Jacob Hoffman-Andrews</name>
<email>github@hoffman-andrews.com</email>
</author>
<published>2022-06-15T06:25:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=27dcebeb3e88b97420a6d8f9279102892e27c775'/>
<id>urn:sha1:27dcebeb3e88b97420a6d8f9279102892e27c775</id>
<content type='text'>
Now that the "All Crates" dropdown is only rendered on the search results page,
there is no need to load crates.js on most pages. Load it only on crate pages.
Also, add the `defer` attribute so it does not block page rendering.

For sidebar-items.js, move the script tag to `&lt;head&gt;`. Since it already has the
defer attribute it won't block loading. The defer attribute does preserve
ordering between scripts, so instead of the callback on load, it can set a
global variable on load, which is slightly simpler. Also, since it is required
to finish rendering the page, beginning its load earlier is better.

Remove generation and handling of sidebar-vars. Everything there can be computed
with information available in JS via other means.

Remove the "other" wrapper in the sidebar. It was unnecessary.

Remove excess script fields
</content>
</entry>
</feed>
