about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2021-06-21Update comment regarding staged_apiDeadbeef-1/+1
2021-06-21Removed/Updated some cases and simplified `match`Deadbeef-1/+1
2021-06-21Check for const_unstable before printing `const`Deadbeef-40/+61
2021-06-21Auto merge of #86157 - jsha:tera, r=jyn514,GuillaumeGomezbors-175/+221
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.
2021-06-21Delete spacesAlexander Melentyev-2/+2
2021-06-20Use Tera templates for rustdoc.Jacob Hoffman-Andrews-175/+221
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.
2021-06-20"(const: unstable)" for stable-but-const-unstableDeadbeef-9/+31
2021-06-19rustdoc: Introduce new `DynTrait` type for better representation of trait ↵Justus K-37/+24
objects
2021-06-19Rollup merge of #86370 - ↵Yuki Okushi-2/+9
matteo-briani:fix-rustdoc-stabilized-versions-layout, r=GuillaumeGomez Fix rustdoc stabilized versions layout Fixes #86342 r? `@GuillaumeGomez`
2021-06-18Update test cases for intra-doc links in summariesMichael Howell-1/+3
2021-06-18Resolve intra-doc links in summary descMichael Howell-8/+30
Before: ![rustdoc-intra-doc-link-summary-before](https://user-images.githubusercontent.com/1593513/122623069-9d995e80-d04f-11eb-8d46-ec2ec126bb5e.png) After: ![rustdoc-intra-doc-link-summary](https://user-images.githubusercontent.com/1593513/122623076-a4c06c80-d04f-11eb-967a-f5916871c34b.png)
2021-06-18rustdoc: Render `for<'_>` lifetimes in trait objectsJustus K-5/+24
2021-06-18rustdoc: Render `for<'_>` lifetimes in front of where boundJustus K-3/+19
2021-06-18Auto merge of #86322 - trinity-1686a:rustdoc-fix-overflow-recursive-deref, ↵bors-13/+0
r=jyn514 fix rustdoc stack overflow on mutually recursive Deref fix #85095 fix #85037
2021-06-17include reference to woff2 files in COPYRIGHT.txtTrevor Spiteri-5/+9
2021-06-17rustdoc: add optional woff2 versions of Source Serif and Source CodeTrevor Spiteri-6/+45
2021-06-17Fix rustdoc stabilized versions layoutMatteo Briani-2/+9
2021-06-16Restore details for Impls on Foreign TypesJacob Hoffman-Andrews-4/+10
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.
2021-06-16Fix target highlighting in rustdoc.Jacob Hoffman-Andrews-39/+37
Also factor out outer_version and const_outer_version into render_rightside.
2021-06-16Move anchor earlier in the DOM for easier layoutJacob Hoffman-Andrews-8/+11
2021-06-16Factor out render_rightsideJacob Hoffman-Andrews-51/+30
This covers rendering of stability_since and the srclink across methods and trait implementations, so their DOM representation is consistent.
2021-06-16Make portability part of the summary.Jacob Hoffman-Andrews-18/+24
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.
2021-06-16Use render_impl_summary when rendering traits.Jacob Hoffman-Andrews-43/+29
2021-06-16Remove methods under Implementors on trait pagesJacob Hoffman-Andrews-22/+21
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.
2021-06-17Rollup merge of #86361 - GuillaumeGomez:missing-backslashes, r=jshaYuki Okushi-4/+4
Add missing backslashes to prevent unwanted newlines in rustdoc HTML Just adding some forgotten backslashes. r? `@jsha`
2021-06-16Open trait implementations' toggles by default.Jacob Hoffman-Andrews-14/+9
This makes it possible to use Ctrl-F to find methods defined in traits.
2021-06-16Add missing backslashes to prevent unwanted backlines in rustdoc HTMLGuillaume Gomez-4/+4
2021-06-15remove code for recursive Deref in sidebarTrinity Pointard-29/+2
fix #85037
2021-06-15fix rustdoc stack overflow on mutually recursive DerefTrinity Pointard-3/+17
fix #85095
2021-06-15Rollup merge of #86277 - jsha:remove-must-use, r=ManishearthYuki Okushi-8/+2
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```
2021-06-15Auto merge of #84867 - pnkfelix:rustdoc-revert-deref-recur, r=jyn514bors-27/+8
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.
2021-06-13Remove must_use from ALLOWED_ATTRIBUTESJacob Hoffman-Andrews-8/+2
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.
2021-06-13Fix font-weightGuillaume Gomez-3/+3
2021-06-10manually crafted revert of PR #80653, to address issue #82465.Felix S. Klock II-27/+8
(update: placated tidy) (update: rebased post PR #84707 ) merge me
2021-06-09Rollup merge of #86128 - jsha:render-impl-into-mod, r=GuillaumeGomezYuki Okushi-78/+86
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`
2021-06-09Rollup merge of #85957 - BoxyUwU:rustdoc-const-generic-defaults, r=oli-obkYuki Okushi-3/+13
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
2021-06-07Refactor: Extract render_summary from render_impl.Jacob Hoffman-Andrews-78/+86
This allows for a more readable straight-through logic in render_impl without need for a closure.
2021-06-08Rollup merge of #86095 - GuillaumeGomez:search-description-codeblock, r=jshaYuki Okushi-1/+1
Search description codeblock The codeblocks are not displayed correctly: ![Screenshot from 2021-06-07 11-11-53](https://user-images.githubusercontent.com/3050060/120991915-5fb05680-c782-11eb-9b32-973a64b1f631.png) This PR interprets the HTML correctly (and still prevent invalid HTML because of how it inserts it): ![Screenshot from 2021-06-07 11-12-00](https://user-images.githubusercontent.com/3050060/120991919-6048ed00-c782-11eb-8ac5-c3aa6508bc8b.png) r? ```@jsha```
2021-06-08Rollup merge of #86078 - GuillaumeGomez:type-page-font-weight, r=jshaYuki Okushi-1/+1
Type page font weight Fixes https://github.com/rust-lang/rust/issues/86069. r? ```@jsha```
2021-06-07Fix integration of codeblocks in search result descriptionGuillaume Gomez-1/+1
2021-06-07Rollup merge of #86040 - GuillaumeGomez:search-result-display-height, r=jshaGuillaume Gomez-0/+2
Fix display for search results This fixes unwanted margin and font-weight coming from `.method`. Before: ![Screenshot from 2021-06-05 23-03-34](https://user-images.githubusercontent.com/3050060/120905486-9e46f380-c652-11eb-8008-6db6e0517ba3.png) after: ![Screenshot from 2021-06-05 23-05-02](https://user-images.githubusercontent.com/3050060/120905489-9edf8a00-c652-11eb-817d-f676f6ab7303.png) r? ``@jsha``
2021-06-06Fix invalid weight for type pagesGuillaume Gomez-1/+1
2021-06-05Fix invalid ID value in all.html fileGuillaume Gomez-2/+8
2021-06-05Add missing backslash in HTML layout stringGuillaume Gomez-1/+1
2021-06-05Escape <meta> content attribute valueGuillaume Gomez-1/+1
2021-06-05Fix display for search resultsGuillaume Gomez-0/+2
2021-06-05Rollup merge of #85503 - liigo:tooltips, r=GuillaumeGomezGuillaume Gomez-4/+4
rustdoc: add tooltips to some buttons
2021-06-05Rollup merge of #84466 - jyn514:prim-str, r=GuillaumeGomezYuki Okushi-3/+3
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.
2021-06-03rustdoc- Show defaults on const generics Ellen-3/+13
2021-06-03Auto merge of #84834 - GuillaumeGomez:sidebar-unification, r=jshabors-97/+97
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`