| Age | Commit message (Collapse) | Author | Lines |
|
Unify sidebar buttons to use the same image
Part of https://github.com/rust-lang/rust/issues/139832.
The source sidebar looks like this with the new image:

You can test it [here](https://rustdoc.crud.net/imperio/sidebar-images/src/foo/foo.rs.html).
r? `@notriddle`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This continues two ongoing projects:
- Replacing ascii art with real icons that don't look like
syntax, are understandable to people who're familiar with
desktop computers and smart devices, and aren't ugly.
- Using labels and tooltips to clarify these icons, when the
limits of popular iconography hit us. In this case, I've added
tooltips, because, unfortunately, there's not room for
always-visible labels.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
documentation
|
|
|
|
fixes https://github.com/rust-lang/rust/issues/133484
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Fix code HTML items making big blocks if too long
Encountered this bug randomly where `code` item in docblocks would look like this:

With this fix it looks like this:

r? ``@notriddle``
|
|
|
|
rustdoc: adjust spacing and typography in header
Fixes #131589
Preview: https://notriddle.com/rustdoc-html-demo-12/spacing/std/index.html
| Before | After |
|--|--|
|  | 
|  | 
|  | 
|  | 
First of all, we put 4px additional margin below the search box, and 4px margin below the header to balance it out.
The bigger problem we have to solve is making the lines look logically spaced. This is troublesome, because Fira Sans (the typeface we use here) wants to look good on average, and to avoid breaking, with text that uses [ascenders and descenders](https://www.w3.org/TR/css-inline-3/images/text-edge.png). If the text we're putting in happens to not have any, things look weird (strictly speaking, there’s hand-tuning here, because the Copy Path button messes with stuff, but the overall point is that there is no true, one perfect layout).
In order to play nicely with the font, I've tweaked the text to use that space. The word "Source" for the link is now capitalized, and the Since version number now uses oldstyle nums with descenders.
|
|
|
|
|
|
ismailarilik:fix/rustdoc/add-space-between-struct-fields-and-their-descriptions, r=GuillaumeGomez
fix(rustdoc): add space between struct fields and their descriptions
Stolen from #128541.
Fixes #128260.
<table>
<thead>
<tr>
<th scope="col">Before</th>
<th scope="col">After</th>
</tr>
</thead>
<tbody>
<tr>
<td scope="row">
<img
src="https://github.com/user-attachments/assets/b1d3cb47-77c9-4897-a5d2-2192b11cb8a3"
/>
</td>
<td>
<img
src="https://github.com/user-attachments/assets/0b104672-d2be-49f4-ac9b-3506526fe2f1"
/>
</td>
</tr>
</tbody>
</table>
<table>
<thead>
<tr>
<th scope="col">Before</th>
<th scope="col">After</th>
</tr>
</thead>
<tbody>
<tr>
<td scope="row">
<img
src="https://github.com/user-attachments/assets/650c3e74-a067-492a-9ba3-557f9214f875"
/>
</td>
<td>
<img
src="https://github.com/user-attachments/assets/413ef9b0-8fca-4e16-978a-7b88d05299dc"
/>
</td>
</tr>
</tbody>
</table>
Unlike original PR, I didn't add space between field headers; I put it between headers and descriptions. So if there are only headers, the space is not changed. Otherwise, I put a space like the space between paragraphs (.75em) which makes sense for me but feel free to adjust it or ask me to do so.
r? `@GuillaumeGomez`
|
|
|
|
|
|
|
|
rustdoc: lists items that contain multiple paragraphs are more clear
fixes https://github.com/rust-lang/rust/issues/130622
before: 
after:

|
|
|
|
fixes https://github.com/rust-lang/rust/issues/130622
|
|
|
|
This accessibility improvement gates the target flashing and tooltip fade-out
behind an inverted prefers-reduced-motion media query.
|
|
rustdoc: redesign toolbar and disclosure widgets
Fixes #77899
Fixes #90310
## Preview
| before | after
| ------ | -----
|  | 
|  | 
|  | 
|  | 
|  | 
| N/A | 
|  | 
|  | 
https://notriddle.com/rustdoc-html-demo-12/toolbar-v2/std/index.html
## Description
This adds labels to the icons and moves them away from the search box.
These changes are made together, because they work together, but are based on several complaints:
* The [+/-] thing are a Reddit-ism. They don't look like buttons, but look like syntax <https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/More.20visual.20difference.20for.20the.20.2B.2F-.20.20Icons>, <https://github.com/rust-lang/rust/issues/59851> (some of these are laundry lists with more suggestions, but they all mention [+/-] looking wrong)
* The settings, help, and summary buttons are also too hard to recognize <https://lwn.net/Articles/987070/>, <https://github.com/rust-lang/rust/issues/90310>, <https://github.com/rust-lang/rust/issues/14475#issuecomment-274241997>, <https://internals.rust-lang.org/t/improve-rustdoc-design/12758> ("Not all functionality is self-explanatory, for example the [+] button in the top right corner, the theme picker or the settings button.")
The toggle-all and toggle-individual buttons both need done at once, since we want them to look like they go together. This changes them from both being [+/-] to both being arrows.
CC <https://github.com/rust-lang/rust/pull/113074#issuecomment-1677469680> and ``@jsha`` regarding the use of triangles for disclosure, which is what everyone wanted, but was pending a good toggle-all button. This PR adds a toggle-all button that should work.
Settings and Help are also migrated, so that the whole group can benefit from being described using actual words.
The breadcrumbs also get redesigned, so that they use less space, by shrinking the parent module path parts. This is done at the same time as the toolbar redesign because it's, effectively, moving space from the toolbar to the breadcrumbs.
This is aimed at avoiding any line wrapping at desktop sizes.
## Prior art
This style of toolbar, with explicit labels on the buttons, used to be more popular. It's not very common in web browsers nowadays, and for truly universal icons like :arrow_left: I can understand why, but words are great when icons fail.

|
|
|
|
|
|
|
|
|
|
This tweaks it to use less space for the breadcrumbs.
|
|
This adds labels to the icons and moves them away from the search box.
These changes are made together, because they work together, but are based on
several complaints:
* The [+/-] thing are a Reddit-ism. They don't look like buttons, but look
like syntax
<https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/More.20visual.20difference.20for.20the.20.2B.2F-.20.20Icons>,
<https://github.com/rust-lang/rust/issues/59851>
(some of these are laundry lists with more suggestions, but they all
mention [+/-] looking wrong)
* The settings, help, and summary buttons are also too hard to recognize
<https://lwn.net/Articles/987070/>,
<https://github.com/rust-lang/rust/issues/90310>,
<https://github.com/rust-lang/rust/issues/14475#issuecomment-274241997>,
<https://internals.rust-lang.org/t/improve-rustdoc-design/12758>
("Not all functionality is self-explanatory, for example the [+] button in
the top right corner, the theme picker or the settings button.")
The toggle-all and toggle-individual buttons both need done at once, since we
want them to look like they go together. This changes them from both being
[+/-] to both being arrows.
Settings and Help are also migrated, so that the whole group can benefit from
being described using actual words.
Additionally, the Help button is only shown on SERPs, not all the time.
This is done for two major reasons:
* Most of what's in there is search-related. The things that aren't are
keyboard commands, and the search box tells you about that anyway.
Pressing <kbd>?</kbd> will temporarily show the button and its popover.
* I'm trading it off by showing the help button, even on mobile.
It's useful since you can use the search engine suggestions there.
* The three buttons were causing line wrapping on too many desktop layouts.
|
|
Unify scraped examples with other code examples
Fixes #129763.
This first PR both fixes #129763 but also unifies buttons display for code examples:

You can test it [here](https://rustdoc.crud.net/imperio/unify-code-examples/doc/scrape_examples/fn.test.html) and [here](https://rustdoc.crud.net/imperio/unify-code-examples/doc/scrape_examples/fn.test_many.html).
I'm planning to send a follow-up to make the buttons generated in JS directly (or I can do it in this PR directly if you prefer).
cc ```@willcrichton```
r? ```@notriddle```
|