| Age | Commit message (Collapse) | Author | Lines |
|
This makes it easy, when you are scrolled far down in a page, to jump
back to the top.
|
|
Fix rust logo style
The style on the rust logo is currently broken:

With this fix, we're back to normal:

I also used a GUI test to prevent future silent regressions.
r? ```@jsha```
|
|
|
|
Make source links look cleaner
Change from syntaxy-looking [src] to the plain word "source".
Change the syntaxy-looking `[-]` at the top of the page to say "collapse".
Reduce opacity of rightside content.
Part of #59851
r? `@GuillaumeGomez`
Demo: https://rustdoc.crud.net/jsha/source-link-2/std/string/struct.String.html
[Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/display.20of.20source.20link).
|
|
Move crate drop-down to search results page
This reduces clutter on doc pages.
Part of #59840
r? ```@GuillaumeGomez```
Demo: https://rustdoc.crud.net/jsha/crates-in-results/std/index.html?search=str
|
|
Change from syntaxy-looking [src] to the plain word "source".
|
|
Fix font size for [src] links in headers
Fixes #90384.
cc `@jsha`
r? `@camelid`
|
|
Make Run button visible on hover
This slightly reduces the noisiness of doc pages, making them easier to read.
Demo: https://rustdoc.crud.net/jsha/run-on-hover/std/string/struct.String.html
[Discussed on Zulip](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/.22Run.22.20button.20visible.20on.20hover).
Part of #59845
|
|
This reduces clutter on doc pages.
|
|
|
|
This slightly reduces the noisiness of doc pages, making them easier to
read.
|
|
Fix mobile toggles position
Before:

After:

r? `@jsha`
|
|
rustdoc: use smaller number of colors to distinguish items
This reduces visual distractions when reading method signatures.
As discussed in https://github.com/rust-lang/rust/issues/59845#issuecomment-974757191, this categorizes items into one of six colors (down from thirteen):
- method, function (ochre `#AD7C37`)
- trait, trait alias (dark slate blue `#6E4FC9`)
- enum, struct, type alias, union, primitive (maroon `#AD378A`)
- static, module, keyword, associated type, foreign type (steel blue `#3873AD`)
- macro (green `#068000`)
- generic params, self, Self (unmarked black `#000000`)
I slightly tweaked the actual color values so they'd have the same lightness (previously the trait color stood out much more than the others). And I made the color for links in general consistently use steel blue (previously there was a slightly different color for "search-failed").
The ayu and dark themes have been updated according to the same logic. I haven't changed any of the color values in those themes, just their assignment to types.
Demo:
https://rustdoc.crud.net/jsha/fewer-colors/std/string/struct.String.html
https://rustdoc.crud.net/jsha/fewer-colors/std/vec/struct.Vec.html
https://rustdoc.crud.net/jsha/fewer-colors/std/io/trait.Read.html
https://rustdoc.crud.net/jsha/fewer-colors/std/iter/trait.Iterator.html
|
|
|
|
Update browser-ui-test version and improve rustdoc-gui tests readability
Since the `0.5.1`, we can use trailing commas. I also used the opportunity to clean up the existing tests.
r? `@notriddle`
|
|
Fix source code page sidebar on mobile
Current broken behaviour:
https://user-images.githubusercontent.com/3050060/145984316-35c82353-5bab-4dc6-9ac6-63ea7e5c27d8.mp4
Fixed:
https://user-images.githubusercontent.com/3050060/145984329-8be1127b-d707-424d-ac3c-c1fb3c48a093.mp4
r? `@jsha`
|
|
|
|
|
|
|
|
Make rustdoc headings black, and markdown blue
Demo:
https://rustdoc.crud.net/jsha/heading-color/std/string/index.html#structs
https://rustdoc.crud.net/jsha/heading-color/std/string/struct.String.html#examples
Fixes #91304
r? ```@camelid``` /cc ```@GuillaumeGomez```
(Note: we may want to make rustdoc headings and markdown headings the same color -- #90245 -- but we would want to do that intentionally; this is fixing up a change that did so accidentally)
|
|
|
|
This reduces visual distractions when reading method signatures.
|
|
|
|
|
|
|
|
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #89542 (Partially stabilize `duration_consts_2`)
- #90044 (Restrict aarch64 outline atomics to glibc for now.)
- #90420 (Create rustdoc_internals feature gate)
- #91075 (Reduce prominence of item-infos)
- #91151 (Fix test in std::process on android)
- #91179 (Fix more <a> color)
- #91199 (rustdoc: Add test for mixing doc comments and attrs)
Failed merges:
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Fix more <a> color
Fixes #91175.
Another bug I saw is:

I fixed it as well.
r? ``@jsha``
|
|
Reduce prominence of item-infos
Fixes #59853
- Remove border.
- Reduce size of emoji slightly.
- Remove details disclosure for unstable reason. This was inconsistent with our other details disclosures, and the detail revealed was usually better explained by clicking on the issue link.
Demo: https://rustdoc.crud.net/jsha/chill-item-info/std/mem/union.MaybeUninit.html#method.slice_assume_init_ref
Compare vs: https://doc.rust-lang.org/nightly/std/mem/union.MaybeUninit.html#method.slice_assume_init_ref
<img src="https://user-images.githubusercontent.com/220205/142717815-09828c9e-6ff4-445a-8ccc-31e028fd4985.png" width=700>
|
|
Create rustdoc_internals feature gate
As suggested by ``@camelid`` [here](https://github.com/rust-lang/rust/pull/90398#issuecomment-955093851), since `doc_keyword` and `doc_primitive` aren't meant to be stabilized, we could put them behind a same feature flag.
This is pretty much what it would look like (needs to update the tests too).
The tracking issue is https://github.com/rust-lang/rust/issues/90418.
What do you think ``@rust-lang/rustdoc`` ?
|
|
|
|
|
|
|
|
Fix toggle-click-deadspace rustdoc-gui test
In #91103 I introduced a rustdoc-gui test for clicks on toggles. I introduced some documentation on a method in lib2/struct.Foo.html so there would be something to toggle, but accidentally left the test checking test_docs/struct.Foo.html. That caused the test to reliably fail.
I'm not sure how that test got past GitHub Actions and bors, but it's manifesting in test failures at https://github.com/rust-lang/rust/pull/91062#issuecomment-977589705 and https://github.com/rust-lang/rust/pull/91170#issuecomment-977636159.
This fixes by pointing at the right file.
r? `@GuillaumeGomez`
|
|
|
|
r=Manishearth,GuillaumeGomez
Inhibit clicks on summary's children
A byproduct of using `<details>` and `<summary>` to show/hide detailed documentation was that clicking any part of a method heading (or impl heading) would show or hide the documentation. This was not super noticeable because clicking a link inside the method heading would navigate to that link. But clicking any unlinked black text in a method heading would trigger the behavior.
That behavior was somewhat unexpected, and means that if you try to click a type name in a method heading, but miss by a few pixels, you get a confusing surprise.
This change inhibits that behavior by putting an event listener on most summaries that cancels the event unless the event target was the summary itself. In practice, that means it cancels the event unless the target was the "[+]" / "[-]", because the rest of the heading is wrapped inside a `<div>`, which is the target for anything that doesn't have a more specific target.
r? ``@Manishearth``
|
|
Set color for <a> in a more straightforward way.
Previously, we set the default color for <a> tags to black, and then had an override with a bunch of not() clauses to set anchors in
docblocks to blue.
Instead, we should set the default color for <a> to blue (or equivalent in other themes), and override it for places like the sidebar or search results, where we don't want them to be styled as links.
Demo at https://rustdoc.crud.net/jsha/theme-anchor/std/string/struct.String.html. This should result in no visible changes.
r? `@GuillaumeGomez`
|
|
|
|
Previously, we set the default color for <a> tags to black, and then
had an override with a bunch of not() clauses to set anchors in
docblocks to blue.
Instead, we should set the default color for <a> to blue (or equivalent
in other themes), and override it for places like the sidebar or search
results, where we don't want them to be styled as links.
|
|
- Remove border.
- Reduce size of emoji slightly.
- Remove details disclosure for unstable reason. This was inconsistent
with our other details disclosures, and the detail revealed was
usually better explained by clicking on the issue link.
|
|
Improve display of enum variants
Use h3 and h4 for the variant name and the "Fields" subheading.
Remove the "of T" part of the "Fields" subheading.
Remove border-bottom from "Fields" subheading.
Move docblock below "Fields" listing.
Fixes #90061
Demo:
https://jacob.hoffman-andrews.com/rust/xmlparser-updated/xmlparser/enum.Token.html#variants
https://jacob.hoffman-andrews.com/rust/fix-enum-variants/std/io/enum.ErrorKind.html#variants
https://jacob.hoffman-andrews.com/rust/fix-enum-variants/std/result/enum.Result.html#variants
r? ``@camelid``
|
|
|
|
Also, remove the highlighting of the search bar in disabled state. This
reduces flicker when loading a page.
|
|
Use h3 and h4 for the variant name and the "Fields" subheading.
Remove the "of T" part of the "Fields" subheading.
Remove border-bottom from "Fields" subheading.
Move docblock below "Fields" listing.
|
|
We still had a number of places where underlined section headings would
show up, like under Implementations.
|
|
Fix documentation header sizes
And add a rustdoc-gui test confirming various header sizes.
Split off from #90156. This fixes a regression in #89506 where the heading level of titles within Markdown was too high (h2) for docblocks under structs, unions, and enum impls.
r? `@camelid`
Demo: https://jacob.hoffman-andrews.com/rust/fix-header-sizes/std/string/struct.String.html#impl-Add%3C%26%27_%20str%3E
Stable: https://doc.rust-lang.org/stable/std/string/struct.String.html#impl-Add%3C%26%27_%20str%3E
Beta: https://doc.rust-lang.org/beta/std/string/struct.String.html#impl-Add%3C%26%27_%20str%3E
|
|
rustdoc: Use TTF based font instead of OTF for CJK glyphs to improve readability
Due to Windows' implementation of font rendering, OpenType fonts can be distorted. So the existing font, Noto Sans KR, is not very readable on Windows. This PR improves readability of Korean glyphs on Windows.
## Before

## After

The fonts included in this PR are licensed under the SIL Open Font License and generated with these commands:
```sh
pyftsubset NanumBarunGothic.ttf \
--unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \
--output-file=NanumBarunGothic.ttf.woff --flavor=woff
```
```sh
pyftsubset NanumBarunGothic.ttf \
--unicodes=U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF \
--output-file=NanumBarunGothic.ttf.woff2 --flavor=woff2
```
r? ``@GuillaumeGomez``
|
|
|
|
And add a rustdoc-gui test confirming various header sizes.
|