| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
|
|
Use Tera templates for rustdoc.
Replaces a format!() call in layout::render with a template
expansion. Introduces a `templates` field in SharedContext so parts
of rustdoc can share pre-rendered templates.
This currently builds in a copy of the single template available, like
with static files. However, future work can make this live-loadable with
a perma-unstable flag, to make rustdoc developers' work easier.
Part of #84419.
Demo at https://hoffman-andrews.com/rust/tera/std/string/struct.String.html.
|
|
|
|
Replaces a format!() call in layout::render with a template
expansion. Introduces a `templates` field in SharedContext so parts
of rustdoc can share pre-rendered templates.
This currently builds in a copy of the single template available, like
with static files. However, future work can make this live-loadable with
a perma-unstable flag, to make rustdoc developers' work easier.
|
|
|
|
objects
|
|
matteo-briani:fix-rustdoc-stabilized-versions-layout, r=GuillaumeGomez
Fix rustdoc stabilized versions layout
Fixes #86342
r? `@GuillaumeGomez`
|
|
|
|
Before:

After:

|
|
|
|
|
|
r=jyn514
fix rustdoc stack overflow on mutually recursive Deref
fix #85095
fix #85037
|
|
|
|
|
|
|
|
These were previously removed along with the details in the
"Implementors" section of trait pages. But for "Implementations on
Foreign Types," we need to include the details because they will not be
documented anywhere else.
|
|
Also factor out outer_version and const_outer_version into
render_rightside.
|
|
|
|
This covers rendering of stability_since and the srclink across methods
and trait implementations, so their DOM representation is consistent.
|
|
That means it will be visible under "Implementors" on trait pages, and
under "Implementations" on struct/enum pages, even when all methods are
collapsed.
Switch to a float layout for rightside elements.
|
|
|
|
These were hidden by default, and duplicated information already on the
page anyhow.
Also remove the "Auto-hide trait implementors of a trait" setting,
which is not needed anymore.
|
|
Add missing backslashes to prevent unwanted newlines in rustdoc HTML
Just adding some forgotten backslashes.
r? `@jsha`
|
|
This makes it possible to use Ctrl-F to find methods defined in traits.
|
|
|
|
fix #85037
|
|
fix #85095
|
|
Remove must_use from ALLOWED_ATTRIBUTES
This is a fairly common attribute on methods, but is not something you need to know when reading the method docs - the purpose of the attribute is for the compiler to tell you about it if you forget to use a value.
Removing reclaims some valuable space in the summary of methods, particularly when the attribute has a long string value.
As discussed in #84309. Partially addresses #81482.
r? ```@Manishearth```
|
|
rustdoc: revert deref recur to resume inclusion of impl ExtTrait<Local> for ExtType
As discussed here: https://github.com/rust-lang/rust/issues/82465#issuecomment-829290384, Revert PR #80653 to resolve issue #82465.
Issue #82465 was we had stopped including certain trait implementations, namely implementations on an imported type of an imported trait *instantiated on a local type*. That bug was injected by PR #80653.
Reverting #80653 means we don't list all the methods that you have accessible via recursively applying `Deref`.
[Discussion in last week's rustc triage meeting](https://zulip-archive.rust-lang.org/238009tcompilermeetings/19557weekly2021042954818.html#236680594) led us to conclude that the bug was worse than the enhancement, and there was not an obvious fix for the bug itself. So for the short term we remove the enhancement, while in the long term we will work on figuring out a way to have our imported trait implementation cake and eat it too.
|
|
This is a fairly common attribute on methods, but is not something you
need to know when reading the method docs - the purpose of the attribute
is for the compiler to tell you about it if you forget to use a value.
Removing reclaims some valuable space in the summary of methods.
|
|
|
|
(update: placated tidy)
(update: rebased post PR #84707 )
merge me
|
|
Refactor: Extract render_summary from render_impl.
This allows for a more readable straight-through logic in render_impl without need for a closure.
I think this will make #85970 a bit more of a straightforward change.
This is a pure refactoring. I've verified that the output of `x.py doc library/std` is byte-for-byte identical.
r? `@GuillaumeGomez`
|
|
Display defaults on const params- rustdoc
previously rustdoc would render this struct declaration:
`pub struct Foo<const N: usize = 10>;`
as:
`pub struct Foo<const N: usize>;`
this PR changes it to render correctly
|
|
This allows for a more readable straight-through logic in render_impl
without need for a closure.
|
|
Search description codeblock
The codeblocks are not displayed correctly:

This PR interprets the HTML correctly (and still prevent invalid HTML because of how it inserts it):

r? ```@jsha```
|
|
Type page font weight
Fixes https://github.com/rust-lang/rust/issues/86069.
r? ```@jsha```
|
|
|
|
Fix display for search results
This fixes unwanted margin and font-weight coming from `.method`. Before:

after:

r? ``@jsha``
|
|
|
|
|
|
|
|
|
|
|
|
rustdoc: add tooltips to some buttons
|
|
rustdoc: Remove `PrimitiveType::{to_url_str, as_str}`
These can easily be rewritten in terms of `as_sym`, and this avoids bugs where the two get out of sync.
I don't expect this to have a perf impact, but I'll start a perf run just in case.
|
|
|
|
Sidebar unification
This PR does a few things:
* Put crates list at all levels (before, it was only on the "top" items)
* Fix bug in module sidebar: the list of items was from the parent module.
The other changes (on bootstrap mostly) were to allow to generate multiple crates in a same folder so that we can ensure that clicking on the crates in the sidebar works as expected.
I added a rustdoc-gui test to ensure everything is where it should be.
r? `@jyn514`
|