about summary refs log tree commit diff
path: root/src/librustdoc/html/static
AgeCommit message (Collapse)AuthorLines
2022-08-12Rollup merge of #100409 - jsha:highlight-lighter, r=GuillaumeGomezDylan DPC-2/+2
rustdoc: don't generate DOM element for operator In our source page highlighting, we were generating `<span class="op">` tags for all "operators", including e.g. `<` `>` around generic parameters, `*`, `&`. This contributed significantly to DOM size, but we don't actually style `.op` except in the ayu theme. Remove the styles for `.op` in ayu, and stop generating the `<span>`s. This reduces DOM size of an example page[1] from 265,938 HTML elements to 242,165 elements, a 9% reduction. r? ``@GuillaumeGomez`` Demo: (warning - slow!) https://rustdoc.crud.net/jsha/highlight-lighter/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html [1]: https://doc.rust-lang.org/nightly/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html
2022-08-11rustdoc: don't generate DOM element for operatorJacob Hoffman-Andrews-2/+2
In our source page highlighting, we were generating `<span class="op">` tags for all "operators", including e.g. `<` `>` around generic parameters, `*`, `&`. This contributed significantly to DOM size, but we don't actually style `.op` except in the ayu theme. Remove the styles for `.op` in ayu, and stop generating the `<span>`s. This reduces DOM size of an example page[1] from 265,938 HTML elements to 242,165 elements, a 9% reduction. [1]: https://doc.rust-lang.org/nightly/src/core/up/up/stdarch/crates/core_arch/src/x86/avx512f.rs.html
2022-08-11Rollup merge of #100374 - ↵Matthias Krüger-41/+96
GuillaumeGomez:improve_rustdoc_search_results_page_crates_selection, r=notriddle Improve crate selection on rustdoc search results page Take over of #98855 (screenshots and explanations are there). You can test it [here](https://rustdoc.crud.net/imperio/improve_rustdoc_search_results_page_crates_selection/std/index.html?search=test). cc ``@steffahn`` ``@jsha`` r? ``@notriddle``
2022-08-10rustdoc: make item-infos dimmer on dark theme #93896Jacob Hoffman-Andrews-23/+8
Previously the item-info background colors were too bright for a dark theme, making a bright rectangle that draws the attention.
2022-08-10Two small improvements:Frank Steffahn-3/+2
Fix oversight duplicate property left in CSS (dark theme). Improve wording in comment that mentions `appearance: none`
2022-08-10Improve crate selection on rustdoc search results pageFrank Steffahn-41/+97
Resolves all of issue #93240 Reproduces a similar change as #99086, but with improvements In particular, this PR inlcludes: * redesigning the crate-search selector so the background color matches its surroundings * decrease the font of the dropdown menu to a reaonable size * add a hover effect * make the color of the arrow theme-dependent, using a surrounding div, with :after pseudo-element that can then be transformed using CSS filters to approximate the desired color * fix the text "in" to match the title font * remove the "for xyz" in the "Results for xyz in [All crates]" title when searching for search term "xyz"; you can already see what you're searching for as it's typed in the search bar! * in line with #99086, handle super-long crate names appropriately without a long <select> element escaping the screen area; the improvement is that we also keep the title within a single line now; uses some flex layout shenanigans... * the margins / paddings are adjusted so the selected label of the <select> fits within the rest of that title nicely; also some inconsistency in the way that Firefox renders a <select> with "appearance: none" (roughly 4px more padding left and right of the text than e.g. Chrome) is worked around, and it now produces a result that looks (essentially) identical to Chrome * the color of the help menu and settings menu border in light theme is made to match with the color of the corresponding buttons, like they do (match) in the ayu theme * the casing of "All crates" changes to "all crates" * the new tests from #99086 are temporarily disabled, until they can be adapted later
2022-08-10Auto merge of #100346 - matthiaskrgr:rollup-6rljn4p, r=matthiaskrgrbors-7/+59
Rollup of 14 pull requests Successful merges: - #98775 (rustdoc: improve scroll locking in the rustdoc mobile sidebars) - #99479 (rustdoc-json: Remove doc FIXME for Import::id and explain) - #100040 (Error on broken pipe but do not backtrace or ICE) - #100072 (linker-plugin-lto.md: Correct the name of example c file) - #100098 (Some "this expression has a field"-related fixes) - #100226 (Do not manually craft a span pointing inside a multibyte character.) - #100240 (Fail gracefully when const pattern is not structural match.) - #100256 (Add some high-level docs to `FnCtxt` and `ItemCtxt`) - #100261 (Set tainted errors bit before emitting coerce suggestions.) - #100275 (also update anyhow in codegen_cranelift) - #100281 (Remove more Clean trait implementations) - #100314 (Mention `unit-test` in MIR opt test README) - #100319 (Remove more Clean trait implementations) - #100323 ([rustdoc] Don't render impl blocks with doc comment if they only contain private items by default) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-08-10Rollup merge of #98775 - notriddle:notriddle/mobile-sidebar-scroll-lock, r=jshaMatthias Krüger-7/+59
rustdoc: improve scroll locking in the rustdoc mobile sidebars This PR prevents the main content area from scrolling while the mobile sidebar is open on documentation pages (porting the scroll locking behavior from the source sidebar to the regular sidebar), and also fixes some bad behavior where opening a "mobile" sidebar, and growing the viewport so that the "desktop" mode without scroll locking is activated, could potentially leave the page stuck. This does not affect the behavior on larger screens. Only small ones, where the sidebar covers up the main content. Split out from #98772
2022-08-04rustdoc: use a more compact encoding for implementors/trait.*.jsMichael Howell-4/+10
The exact amount that this reduces the size of an implementors file depends on whether most of the impls are synthetic or not. For `Send`, it reduces the file from 128K to 116K, while for `Clone` it went from 64K to 52K.
2022-08-03Rollup merge of #100083 - notriddle:notriddle/source-files-js, r=GuillaumeGomezMatthias Krüger-7/+11
rustdoc: use a more compact encoding for source-files.js This reduces the compiler-doc file from 40K to 36K, a 10% reduction in size.
2022-08-03Rollup merge of #100079 - camelid:fix-doc-star-search, r=Dylan-DPCDylan DPC-1/+1
Replace `* -> vec` with `-> vec` in docs Fixes #100078. Rustdoc's current syntax is `-> vec`.
2022-08-02Replace `* -> vec` with `-> vec` in docsNoah Lev-1/+1
Rustdoc's current syntax is `-> vec`.
2022-08-02rustdoc: use a more compact encoding for source-files.jsMichael Howell-7/+11
This reduces the compiler-doc file from 40K to 36K, a 10% reduction in size.
2022-08-02Rollup merge of #99779 - GuillaumeGomez:fix-item-info-pos-and-height, ↵Matthias Krüger-1/+9
r=notriddle Fix item info pos and height Fixes https://github.com/rust-lang/rust/issues/98266. Fixes https://github.com/rust-lang/rust/issues/98343. You can test it [here](https://rustdoc.crud.net/imperio/fix-item-info-pos-and-height/lib2/trait.Trait.html). Here is a screenshot of the result: ![Screenshot from 2022-07-26 21-55-53](https://user-images.githubusercontent.com/3050060/181100624-18b8b045-5c25-4c7c-9c44-97d55d29b675.png) r? `@jsha`
2022-07-28Rollup merge of #99810 - GuillaumeGomez:fix-settings-slider-small-width, ↵Dylan DPC-2/+1
r=notriddle Fix settings slider on small width screens Fixes #99794. Screenshot of the fix: ![Screenshot from 2022-07-27 14-17-08](https://user-images.githubusercontent.com/3050060/181250007-55f982d1-89db-45b7-a4f1-0d1729e6a3e3.png) cc `````@jsha````` r? `````@notriddle`````
2022-07-27Rollup merge of #99812 - GuillaumeGomez:fix-headings-colors, r=jsha,notriddleGuillaume Gomez-6/+2
Fix headings colors Fixes #99797. ![image](https://user-images.githubusercontent.com/3050060/181260966-49faf9d3-f6b8-4de4-bc7d-ed9f0467cf68.png) cc `@jsha` r? `@notriddle`
2022-07-27Fix headings borderGuillaume Gomez-5/+1
2022-07-27Fix invalid css property valueGuillaume Gomez-1/+1
2022-07-27Fix settings display on small screen sizeGuillaume Gomez-2/+1
2022-07-26Fix display of item info and unify their heightGuillaume Gomez-1/+9
2022-07-26Rollup merge of #99235 - ↵Matthias Krüger-1/+5
WaffleLapkin:rustdoc_implement_support_for_must_implement, r=GuillaumeGomez rustdoc: Add support for `#[rustc_must_implement_one_of]` This PR adds support for `#[rustc_must_implement_one_of]` attribute added in #92164. There is a desire to eventually use this attribute of `Read`, so making it show up in docs is a good thing. I "stole" the styling from cfg notes, not sure what would be a proper styling. Currently it looks like this: ![2022-07-14_15-00](https://user-images.githubusercontent.com/38225716/178968170-913c1dd5-8875-4a95-9848-b075a0bb8998.png) <details><summary>Code to reproduce</summary> <p> ```rust #![feature(rustc_attrs)] #[rustc_must_implement_one_of(a, b)] pub trait Trait { fn req(); fn a(){ Self::b() } fn b(){ Self::a() } } ``` </p> </details>
2022-07-25Fix sidebar background-color on mobileGuillaume Gomez-1/+0
2022-07-25fix rustdoc-gui testsMaybe Waffle-1/+1
2022-07-24Satisfy theme checkMaybe Waffle-0/+1
2022-07-24Add support for `#[rustc_must_implement_one_of]` to rustdocMaybe Waffle-2/+5
2022-07-22Rollup merge of #99423 - GuillaumeGomez:group-css-font-rule, r=notriddleDylan DPC-12/+9
Group CSS font rule Another CSS cleanup I came by when working on something else. r? ``@notriddle``
2022-07-20Rollup merge of #99489 - GuillaumeGomez:gui-fixes, r=notriddleMatthias Krüger-7/+22
rustdoc UI fixes The first commit fixes this bug: ![Screenshot from 2022-07-20 02-54-26](https://user-images.githubusercontent.com/3050060/179879053-fc34f27a-6248-4f5c-9fcb-80adbfc1598c.png) ![Screenshot from 2022-07-20 03-00-03](https://user-images.githubusercontent.com/3050060/179879056-1c0973a0-d535-44e7-a48e-bad692034467.png) The second one fixes the missing change of border color when the search input is focused. cc `@jsha` r? `@notriddle`
2022-07-20Remove CSS transition for search input border-colorGuillaume Gomez-1/+0
2022-07-20Fix CSS on search input focusGuillaume Gomez-3/+21
2022-07-20Fix crate filter select displayGuillaume Gomez-3/+1
2022-07-18Group CSS font ruleGuillaume Gomez-12/+9
2022-07-17Fix auto-expand of trees in source code page sidebarGuillaume Gomez-1/+1
2022-07-15Rollup merge of #99209 - GuillaumeGomez:crate-level-sidebar, r=jshaDylan DPC-17/+14
Correctly handle crate level page on docs.rs as well Fixes #99121. On docs.rs, they move the `class` attribute into a child which still has `rustdoc`. So instead of using the `<body>`, we can simply use this one directly. r? `@jsha`
2022-07-14Correctly handle crate level page on docs.rs as wellGuillaume Gomez-17/+14
2022-07-14Remove unused CSSGuillaume Gomez-46/+6
2022-07-11Continue themes CSS migration over CSS variablesGuillaume Gomez-130/+45
2022-07-11Remove unused CSS rulesGuillaume Gomez-33/+0
2022-07-11Rollup merge of #99114 - GuillaumeGomez:css-cleanup, r=Dylan-DPCMatthias Krüger-7/+3
Group .test-arrow CSS rules and fix rgb/rgba property Surprisingly, the web browsers were handling the `rgb`/`rgba` typo correctly. At least it now is as expected. For the rest, it's simply grouping `.test-arrow` rules. r? ``@Dylan-DPC``
2022-07-10Group .test-arrow CSS rules and fix rgb/rgba propertyGuillaume Gomez-7/+3
2022-07-10Rollup merge of #99086 - GuillaumeGomez:search-result-crate-filter-dropdown, ↵Matthias Krüger-1/+2
r=notriddle Fix display of search result crate filter dropdown In case a crate name is too long, the `<select>` completely overflows its parent. Another problem is that there is left margin on the `select` which break the alignment. You can see both issues here: ![Screenshot from 2022-07-09 15-31-12](https://user-images.githubusercontent.com/3050060/178108959-0eb5af19-ec60-4d34-a2fd-c27147683c78.png) And with the fix: ![Screenshot from 2022-07-09 15-33-37](https://user-images.githubusercontent.com/3050060/178108980-71030a92-84ee-4ee5-98e3-f97d03a6fbaf.png) cc `@jsha` r? `@notriddle`
2022-07-09Fix display of search result crate filter dropdownGuillaume Gomez-1/+2
2022-07-08set all padding for main element in printInfra-1/+1
2022-07-08try to fix tidy issuesInfra-10/+10
2022-07-08improve print stylesInfra-1/+11
this change removes some interactive elements in `@media print` form. more specifically, it removes the source links, the expand/collapse toggle buttons, and the `#copy-path` button. it also adjusts some spacing and removes the `.top-doc` description completely if it's currently collapsed.
2022-07-05rustdoc: improve scroll locking in the rustdoc mobile sidebarsMichael Howell-7/+59
This commit ports the scroll locking behavior from the source sidebar to the regular sidebar, and also fixes some bad behavior where opening a "mobile" sidebar, and growing the viewport so that the "desktop" mode without scroll locking is activated, could potentially leave the page stuck. This does not affect the behavior on larger screens. Only small ones, where the sidebar covers up the main content.
2022-07-05Rollup merge of #98776 - notriddle:notriddle/mobile-sidebar-auto-close, ↵Dylan DPC-2/+24
r=GuillaumeGomez rustdoc: improve click behavior of the source code mobile full-screen "sidebar" On desktop, if you open the source code sidebar, it stays open even when you move from page to page. It used to do the same thing on mobile, but I think that's stupid. Since the file list fills the entire screen on mobile, and you can't really do anything with the currently selected file other than dismiss the "sidebar" to look at it, it's safe to assume that anybody who clicks a file in that list probably wants the list to go away so they can see it. Split out separately from #98772
2022-07-04Rollup merge of #98898 - GuillaumeGomez:new-eslint-rul, r=Dylan-DPCMatthias Krüger-0/+1
Add "no-div-regex" eslint rule r? `@Dylan-DPC`
2022-07-04Add "no-div-regex" eslint ruleGuillaume Gomez-0/+1
2022-07-04Rollup merge of #98774 - notriddle:notriddle/source-code-sidebar-button, ↵Matthias Krüger-6/+22
r=GuillaumeGomez rustdoc: make source sidebar toggle a real button This fixes tab focus, so that you can open and close the sidebar from keyboard. This should cause no visible change in appearance at all. The only way you'd know anything different is if you tried to use keyboard controls to open the source code file navigation sidebar. Separated out from #98772
2022-07-03Rollup merge of #98773 - notriddle:notriddle/source-sidebar-details, ↵Ralf Jung-52/+32
r=GuillaumeGomez rustdoc: use <details> tag for the source code sidebar This fixes the extremely poor accessibility of the old system, making it possible to navigate the sidebar by keyboard, and also implicitly gives the sidebar items the correct ARIA roles. Split out separately from #98772