summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2021-07-26Rustdoc accessibility: use real headers for doc itemsbors-39/+78
Part of #87059 Partially reverts #84703 Heavily modified for beta backport needs.
2021-07-26Remove redundant CSSMichael Howell-1/+0
2021-07-26Rustdoc accessibility: make the sidebar headers actual headersMichael Howell-29/+34
Part of #87059 Preview it at: https://notriddle.com/notriddle-rustdoc-test/rustdoc-sidebar-header/std/index.html
2021-07-26Do not hide the sidebar on mobile, move it outside of the viewport insteadGuillaume Gomez-4/+6
2021-07-02Revert "List trait impls before methods from deref in the sidebar of ↵Jacob Hoffman-Andrews-8/+8
Rustdoc's output" This reverts commit 8a058926ecd6d0988714f8f7a5a31293c533f8c6. (cherry picked from commit 093e2464455bd7fff614ff4c658f6a1eb5e7a89d)
2021-06-19manually 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`
2021-06-02Replace h3 for notable traits with divGuillaume Gomez-15/+23
2021-06-02Remove data-level selectors from CSS.Jacob Hoffman-Andrews-82/+20
2021-06-01Don't generate impl-items div container if there is noneGuillaume Gomez-4/+6
2021-06-01Remove invalid usage of aria-levelGuillaume Gomez-25/+25
2021-06-01Replace h3 and h4 containing invalid DOMGuillaume Gomez-48/+107
2021-06-01Add missing <title> in redirection page <head>Guillaume Gomez-0/+1
2021-06-01Replace empty href with "#"Guillaume Gomez-1/+1
2021-06-01Rollup merge of #85860 - pickfire:patch-5, r=GuillaumeGomezGuillaume Gomez-2/+1
Fix details rustdoc toggle for blanket impl In the meantime, allow all of the details to have the same top. Before ![image](https://user-images.githubusercontent.com/4687791/120214139-a673ed00-c266-11eb-9154-3a8148199c8f.png) ![image](https://user-images.githubusercontent.com/4687791/120214232-c5727f00-c266-11eb-8bda-871e6e04819e.png) After ![image](https://user-images.githubusercontent.com/4687791/120214121-9d831b80-c266-11eb-8c33-db1317c42375.png) ![image](https://user-images.githubusercontent.com/4687791/120214273-d4f1c800-c266-11eb-89ee-0f2b7c2e5bdb.png) I stumbled across this while wanting to do a details button for the layout.
2021-06-01Rollup merge of #85622 - jsha:untoggle-undocumented, r=GuillaumeGomezGuillaume Gomez-10/+4
Remove toggle for "undocumented items." Per discussion in #84326. For trait implementations, this was misleading: the items actually do have documentation (but it comes from the trait definition). For both trait implementations and trait implementors, this was redundant: in both of those cases, the items are default-hidden by different toggle at the level above. Update tests: Remove XPath selectors that over-specified on details tag, in cases that weren't testing toggles. Add an explicit test for toggles on methods. Rename item-hide-threshold to toggle-item-contents for consistency. Demo: https://hoffman-andrews.com/rust/untoggle-undocumented/std/string/struct.String.html https://hoffman-andrews.com/rust/untoggle-undocumented/std/io/trait.Read.html
2021-05-31Fix details rustdoc toggle for blanket implIvan Tham-2/+1
In the meantime, allow all of the details to have the same top.
2021-05-31Add title for copy to clipboard button in rustdocIvan Tham-1/+2
2021-05-31Improve display of the separation between page items and siblings in the sidebarGuillaume Gomez-2/+5
2021-05-31Only list crates on the crate pageGuillaume Gomez-2/+13
2021-05-31Remove unneeded file to load sidebar items at crate levelGuillaume Gomez-6/+0
2021-05-31* Put crates list at all levelsGuillaume Gomez-89/+81
* Fix bug in module sidebar: the list of items was from the parent module
2021-05-30Remove toggle for "undocumented items."Jacob Hoffman-Andrews-10/+4
Per discussion in #84326. For trait implementations, this was misleading: the items actually do have documentation (but it comes from the trait definition). For both trait implementations and trait implementors, this was redundant: in both of those cases, the items are default-hidden by different toggle at the level above. Update tests: Remove XPath selectors that over-specified on details tag, in cases that weren't testing toggles. Add an explicit test for toggles on methods. Rename item-hide-threshold to toggle-item-contents for consistency.
2021-05-30Rollup merge of #85770 - Bobo1239:set_locale_for_sort, r=jyn514Guillaume Gomez-2/+1
Remove `--print unversioned-files` from rustdoc This flag isn't needed anymore. See #83784.
2021-05-30Rollup merge of #85285 - GuillaumeGomez:eslint-check, r=jsha,Mark-SimulacrumGuillaume Gomez-0/+1
Add eslint checks to CI It also allowed me to fix some potential issues that went unnoticed. Having this process automated will hopefully prevent us to add more errors. :) cc `@Mark-Simulacrum` (for the add in the CI). r? `@jsha`
2021-05-30Fix eslint error in sidebar-items.jsGuillaume Gomez-0/+1
2021-05-29Auto merge of #85540 - GuillaumeGomez:better-result-dom-generation, r=jshabors-22/+55
Better result dom generation First commit is from https://github.com/rust-lang/rust/pull/85506. We realized in https://github.com/rust-lang/rust/pull/85506#issuecomment-844984162 thanks to `@dns2utf8` that in some cases, the generated search result DOM was invalid. This was not strict enough and the DOM was inserted as a big string, which wasn't great. r? `@jsha`
2021-05-28Remove `--print unversioned-files` from rustdocBoris-Chengbiao Zhou-2/+1
This flag isn't needed anymore. See #83784.
2021-05-27Rollup merge of #85722 - GuillaumeGomez:trait-toggle, r=jshaGuillaume Gomez-4/+13
Fix trait methods' toggle A `<details>` tag wasn't closed on trait methods, which created broken DOM. I also used this occasion to only generate the toggle in case there is documentation on the method. r? `@jsha`
2021-05-26* Fix bug where some <details> tags were not closed.Guillaume Gomez-4/+13
* Don't generate a <details> if there is no documentation
2021-05-26Rollup merge of #84048 - konan8205:master, r=jshaYuki Okushi-1/+115
Avoid CJK legacy fonts in Windows As metioned in #84035, the default serif CJK font in Windows is meh-looking. To avoid this, we should use sans-serif font or provide CJK glyph supported font in `rustdoc.css`.
2021-05-25Fix more search results CSS rulesGuillaume Gomez-6/+6
2021-05-25Generate DOM more securelyGuillaume Gomez-16/+49
2021-05-25Rollup merge of #85657 - kpreid:brackets, r=jyn514Guillaume Gomez-1/+1
Remove doubled braces in non_exhaustive structs’ documentation text. In commit 4b806878549990d2ad2aa3c265751d3d89947cdf (part of Rust 1.52.1) many calls to `write!(w,` were replaced with `w.write_str(`, but this one contained braces that were doubled to escape them when taken as a format string, and so changing the call without changing the text caused them to become doubled in the final HTML output. I examined `print_item.rs` and the diff of that prior commit for any other occurrences of this mistake and I did not find any.
2021-05-25Move extra search result information for keywords and primitives from CSS to DOMGuillaume Gomez-16/+12