| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
|
|
this is one-time initialization data, it can just
be a function parameter.
we also move the json parsing into createSrcSidebar
to save a few bytes.
|
|
rustdoc: on mobile, make the sidebar full width and linewrap
this is because the mobile sidebar cannot be resized, unlike on desktop.
|
|
|
|
stuff like "clicking the settings menu closes the mobile sidebar"
is now impossible for users to observe, since the mobile sidebar
will always cover the settings menu due to being full-width,
which is good because that behavior is also now impossible for
our testing framework to observe.
|
|
r=notriddle
rustdoc: Fix links with inline code in trait impl docs
Fixes #140857
|
|
|
|
|
|
|
|
|
|
This change is based on some discussion on [lolbinarycat's idea],
but with a more "traditional" design. Specifically, this is the
closest thing I could find to a consensus across many systems I
looked at for inspiration:
- In Jira, resizable sidebars have a stack of four dots.
- In The GIMP, resizable sidebars have a stack of three dots.
- In [old Windows], "panes" are defined to have the same border
style as a window, which has a raised appearance.
- In [NeXT], a drag point usually had an innie, whether the line in a
slider or the circle in a scroller; I can also hide and show the
favorites bar in Workspace by dragging on a circular "grip spot"
- In [old Mac], drag handles for things usually had a "grip track"
of parallel lines.
- [OSX] kept that, but the "Source List" part of the Finder still had
the circle grip for a time the same way Workspace did
[lolbinarycat's idea]: https://github.com/rust-lang/rust/pull/139420
[old Windows]: https://archive.org/details/windowsinterface00micr/page/n9/mode/2up
[old Mac]: https://archive.org/details/apple-hig/1996_Human_Interface_Guidelines_for_Mac_OS_8_%28WWDC_Release%29/page/16/mode/2up
[NeXT]: https://archive.org/details/apple-hig/1993%20NeXTSTEP%20User%20Interface%20Guidelines%20-%20Release%203/page/145/mode/2up
[OSX]: https://dn721903.ca.archive.org/0/items/apple-hig/MacOSX_HIG_2005_09_08.pdf#page=267
|
|
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`
|
|
|
|
|
|
|
|
Add rustdoc-gui regression test for #137082
Fixes https://github.com/rust-lang/rust/issues/137082.
Added new commands in `browser-ui-test` allowing us to add a regression test for #137082 and also another to copy code examples content.
r? `@notriddle`
|
|
|
|
[rustdoc] Add new setting to wrap source code lines when too long
Fixes https://github.com/rust-lang/rust/issues/127334.
Wrapped lines look like this:

It works in both source code pages and doc pages.
You can test it [here](https://rustdoc.crud.net/imperio/code-wrapping/bar/index.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.
|
|
|
|
|
|
|
|
|
|
|
|
constants and statics are nullary functions, and struct fields are unary functions.
functions (along with methods and trait methods) are prioritized over other
items, like fields and constants.
|
|
|
|
|
|
`CheckAttrVisitor::check_doc_keyword` checks `#[doc(keyword = "..")]`
attributes to ensure they are on an empty module, and that the value is
a non-empty identifier.
The `rustc::existing_doc_keyword` lint checks these attributes to ensure
that the value is the name of a keyword.
It's silly to have two different checking mechanisms for these
attributes. This commit does the following.
- Changes `check_doc_keyword` to check that the value is the name of a
keyword (avoiding the need for the identifier check, which removes a
dependency on `rustc_lexer`).
- Removes the lint.
- Updates tests accordingly.
There is one hack: the `SelfTy` FIXME case used to used to be handled by
disabling the lint, but now is handled with a special case in
`is_doc_keyword`. That hack will go away if/when the FIXME is fixed.
Co-Authored-By: Guillaume Gomez <guillaume1.gomez@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This commit is a response to feedback on the displayed type
signatures results, by making generics act stricter.
Generics are tightened by making order significant. This means
`Vec<Allocator>` now matches only with a true vector of allocators,
instead of matching the second type param. It also makes unboxing
within generics stricter, so `Result<A, B>` only matches if `B`
is in the error type and `A` is in the success type. The top level
of the function search is unaffected.
Find the discussion on:
* <https://rust-lang.zulipchat.com/#narrow/stream/393423-t-rustdoc.2Fmeetings/topic/meeting.202024-07-08/near/449965149>
* <https://github.com/rust-lang/rust/pull/124544#issuecomment-2204272265>
* <https://rust-lang.zulipchat.com/#narrow/channel/266220-t-rustdoc/topic/deciding.20on.20semantics.20of.20generics.20in.20rustdoc.20search/near/476841363>
|
|
|
|
|
|
|
|
|
|
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``
|
|
|
|
|
|
|