about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
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
2021-05-24Remove doubled braces in non_exhaustive structs’ documentation text.Kevin Reid-1/+1
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-24Rollup merge of #85621 - jsha:serif-in-table, r=GuillaumeGomezGuillaume Gomez-0/+1
Restore sans-serif font for module items. This was broke in #84462 by modifying a style that applied both to searches and to module items (and other tables). Fixes #85616. Fixes https://github.com/rust-lang/rust/issues/85545. r? `@camelid`
2021-05-24Rollup merge of #85551 - GuillaumeGomez:fix-search-result-overflow, r=jshaGuillaume Gomez-7/+34
Fix search results display Fixes https://github.com/rust-lang/rust/issues/85544. cc `@dns2utf8` r? `@jsha`
2021-05-23Restore sans-serif font for module items.Jacob Hoffman-Andrews-0/+1
This was broke in #84462 by modifying a style that applied both to searches and to module items (and other tables).
2021-05-23Auto merge of #85602 - GuillaumeGomez:donthide-inherent-impls, r=jshabors-5/+14
Don't hide inherent implementations by default Fixes a regression introduced in #85575. r? `@jsha`
2021-05-23Auto merge of #85479 - Stupremee:render-Self_as-type-casts, r=CraftSpiderbors-3/+6
rustdoc: render `<Self as X>::Y` type casts properly Rustdoc didn't render any `<Self as X>` casts which causes invalid code inside the documentation. This is fixed by this PR by checking if the target type `X` is different from `Self`, and if so, it will render a typecast. Resolves #85454
2021-05-23Don't hide inherent implementations by defaultGuillaume Gomez-5/+14
2021-05-23Rollup merge of #85575 - jsha:fix-toggle-settings, r=GuillaumeGomezDylan DPC-5/+22
Fix auto-hide for implementations and implementors. This sets their toggles to be closed in the HTML (matching the default setting), and opens them if the setting indicates to do so. This distinguishes between implementations and implementors based on being descendants of certain named elements. Demo https://hoffman-andrews.com/rust/fix-toggle-settings/std/io/trait.Read.html#implementors and https://hoffman-andrews.com/rust/fix-toggle-settings/std/string/struct.String.html#trait-implementations Fixes #85411 r? `@GuillaumeGomez`
2021-05-22Fix auto-hide for implementations and implementors.Jacob Hoffman-Andrews-5/+22
This sets their toggles to be closed in the HTML (matching the default setting), and opens them if the setting indicates to do so. This distinguishes between implementations and implementors based on being descendants of certain named elements.
2021-05-22Set desc class on the div instead of the span to simplify CSSGuillaume Gomez-6/+6
2021-05-22Mobile description width: 100%Stefan Schindler-1/+1
2021-05-22Add padding to mobile layout and fix width issue on bothStefan Schindler-0/+2
2021-05-22Prepar to remove deep nestingStefan Schindler-6/+5
2021-05-22Implement staggered mobile layoutStefan Schindler-4/+17
2021-05-22Auto merge of #85568 - GuillaumeGomez:search-result-extra-info, r=jshabors-2/+2
Search result extra info The CSS rule was not updated when we updated the search result, this fixes it: Before: ![Screenshot from 2021-05-21 22-56-17](https://user-images.githubusercontent.com/3050060/119197314-d31a4e80-ba87-11eb-863a-bc0b3de3bfb2.png) After: ![Screenshot from 2021-05-21 22-54-53](https://user-images.githubusercontent.com/3050060/119197227-b54ce980-ba87-11eb-9f43-c10803ca1b90.png) r? `@jsha`
2021-05-21Fix display for primitive and keyword extra infoGuillaume Gomez-2/+2
2021-05-21Rollup merge of #85548 - GuillaumeGomez:remove-dead-js, r=jshaGuillaume Gomez-158/+0
Remove dead toggle JS code Explanations on how I got there: I randomly saw `adjustToggle` while browsing through code, checked where it was called, put a `debugger;` instruction in it and checked on all pages while playing with settings and toggles. The breakpoint was never triggered. I then looked at `collapseNonInherent` (its grand-parent). In there, the breakpoint was triggered so I look at what was being done and in fact... nothing. So I simply removed it all, re-ran the tests and play with the UI. Everything is working as expected. Better double check in case I forgot to check a case though, but if nothing has been left out, then it's a great cleanup once again. :) r? ``@jsha``
2021-05-21Rollup merge of #85506 - GuillaumeGomez:reset-focusedByTab, r=jshaGuillaume Gomez-4/+5
Reset "focusedByTab" field when doing another search Fixes https://github.com/rust-lang/rust/issues/85467. The problem was simply that we forget to reset the `focusedByTab` field, which was still referring to removed DOM elements. r? ``@jsha``
2021-05-21Fix search results displayGuillaume Gomez-3/+16
2021-05-21Remove dead toggle JS codeGuillaume Gomez-158/+0
2021-05-20Rollup merge of #85509 - GuillaumeGomez:search-null-title, r=jshaGuillaume Gomez-1/+1
Prevent tab title to "null" if the URL is a search one When we arrive on page with a search parameter in the URL, until the results are displayed, the page title is "null". It's because of this code: ```js if (params.search !== undefined) { var search = searchState.outputElement(); search.innerHTML = "<h3 style=\"text-align: center;\">" + searchState.loadingText + "</h3>"; searchState.showResults(search); loadSearch(); } ``` In `searchState.showResults`, we have this: ```js document.title = searchState.title; ``` But since it's `null`, we set it as title. This PR fixes it. r? `@jsha`
2021-05-20Prevent tab title to "null" if the URL is a search oneGuillaume Gomez-1/+1