about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
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-08add opt in attribute for stable-in-unstable itemsJane Lusby-1/+1
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-07Rollup merge of #99017 - GuillaumeGomez:rustdoc-ending-enum, r=notriddleMatthias Krüger-17/+23
Replace boolean argument for print_where_clause with an enum to make code more clear As you suggested ``@notriddle.`` Just not sure if the naming seems good to you? r? ``@notriddle``
2022-07-07Replace boolean argument for print_where_clause with an enum to make code ↵Guillaume Gomez-17/+23
more clear
2022-07-07Rollup merge of #98973 - GuillaumeGomez:inherent-impl-anchors, r=notriddleDylan DPC-4/+16
Remove (unused) inherent impl anchors This is something `@notriddle` realized a few days ago: we have unused anchors in the DOM. This PR removes them. You can test it [here](https://rustdoc.crud.net/imperio/inherent-impl-anchors/foo/index.html). r? `@notriddle`
2022-07-06Rollup merge of #98939 - GuillaumeGomez:rustdoc-disamb-impls, r=notriddleGuillaume Gomez-42/+20
rustdoc: Add more semantic information to impl IDs Take over of #92745. I fixed the last remaining issue for the links in the sidebar (mentioned by `@jsha)` and fixed the few links broken in the std/core docs. cc `@camelid` r? `@notriddle`
2022-07-06Don't generate anchors on inherent impl methodsGuillaume Gomez-4/+16
2022-07-05Rollup merge of #98256 - GuillaumeGomez:whitespace-where-clause, r=notriddleGuillaume Gomez-14/+45
Fix whitespace handling after where clause Fixes #97733. You can see the result [here](https://rustdoc.crud.net/imperio/whitespace-where-clause/doc/foo/index.html). r? `@jsha`
2022-07-05Fix invalid add of whitespace when there is where clauseGuillaume Gomez-14/+45
2022-07-05Fix link generation in the sidebar for implsGuillaume Gomez-15/+12
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-05rustdoc: Add more semantic information to impl idspierwill-27/+8
Instead of generating `#impl`, `#impl-1`, etc., generate IDs like `#impl-Foo<M>`. Co-authored-by: Noah Lev <camelidcamel@gmail.com>
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-04Rollup merge of #98814 - fmease:minimal-fix-for-issue-97933, r=GuillaumeGomezMatthias Krüger-1/+12
rustdoc: Censor certain complex unevaluated const exprs Fixes #97933. This is more of a hotfix for the aforementioned issue. By that, I mean that my proposed patch is not the best solution but one that does not change as much existing code. It treats symptoms rather than the root cause. This PR “censors” certain complex unevaluated constant expressions like `match`es, blocks, function calls, struct literals etc. by pretty-printing them as `_` / `{ _ }` (number and string literals, paths and `()` are still printed as one would expect). Resorting to this placeholder is preferable to printing the full expression verbatim since they can be quite large and verbose resulting in an unreadable mess in the generated documentation. Further, mindlessly printing the const would leak private and `doc(hidden)` struct fields (#97933), at least in the current stable & nightly implementations which rely on `span_to_snippet` (!) and `rustc_hir_pretty::id_to_string`. The censoring of _verbose_ expressions is probably going to stay longer term. However, in regards to private and `doc(hidden)` struct fields, I have a more proper fix in mind which I have already partially implemented locally and for which I am going to open a separate PR sometime soon. For that, I was already in contact with `@GuillaumeGomez.` The proper fix involves rustdoc not falling back on pretty-printing unevaluated consts so easily (what this PR is concerned about) and instead preferring to print evaluated consts which contain more information allowing it to selectively hide private and `doc(hidden)` fields, create hyperlinks etc. generally making the output more granular and precise (compared to the brutal `_` placeholder). Unfortunately, I was a bit too late and the issue just hit stable (1.62). Should this be backported to beta or even a potential 1.62.1? r? `@GuillaumeGomez`
2022-07-04rustdoc: censor certain complex unevaluated const exprsLeón Orell Valerian Liehr-1/+12
2022-07-04Add "no-div-regex" eslint ruleGuillaume Gomez-0/+1
2022-07-04Rollup merge of #98806 - GuillaumeGomez:decl-trailing-whitespace, r=notriddleMatthias Krüger-8/+4
Fix long declaration trailing whitespace Fixes https://github.com/rust-lang/rust/issues/98803. Interestingly enough, it even simplifies the code a bit. r? `@notriddle`
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
2022-07-03Remove redundant pseudo-classMichael Howell-1/+1
2022-07-02rustdoc: add test case for background color of the sidebar toggle buttonMichael Howell-1/+1
2022-07-02rustdoc: add explanatory comment to `width: 100%` lineMichael Howell-0/+1
2022-07-02rustdoc: make source sidebar toggle a real buttonMichael Howell-6/+21
This fixes tab focus, so that you can open and close the sidebar from keyboard.
2022-07-02Remove unwanted trailing whitespaces for long declarationsGuillaume Gomez-8/+4
2022-07-01rustdoc: add spacing to the source view sidebarMichael Howell-1/+5
https://user-images.githubusercontent.com/1593513/176974336-20cecdc3-1885-402a-a6d5-81a8dd03a45d.png
2022-07-01Rollup merge of #98460 - GuillaumeGomez:css-simplification, r=jshaGuillaume Gomez-216/+73
Use CSS variables to handle theming This is the start for our simplification of theming. Considering how big the diff quickly becomes, I think it's better to do it in multiple parts. (The 3 first commits come from https://github.com/rust-lang/rust/pull/98297 so once it's merged, they'll disappear). Normally they shouldn't be any UI changes. You can check it [here](https://rustdoc.crud.net/imperio/css-simplification/doc/foo/index.html). cc `@notriddle` r? `@jsha`
2022-07-01Rollup merge of #97249 - GuillaumeGomez:details-summary-fixes, r=notriddleGuillaume Gomez-2/+7
`<details>`/`<summary>` UI fixes With images it's easier to understand: ![Screenshot from 2022-05-21 14-10-42](https://user-images.githubusercontent.com/3050060/169653038-9c58de67-589a-4986-a8ff-dbdddaf136a4.png) ![Screenshot from 2022-05-21 14-08-49](https://user-images.githubusercontent.com/3050060/169653042-56e87258-13fe-4f80-9858-4e15c318c3fb.png) The headings in `<summary>` should not have bottom border so I removed it as well alongside the other fixes. r? `@jsha`
2022-07-01Improve click behavior of the source code mobile full-screen "sidebar"Michael Howell-2/+24
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.
2022-07-01rustdoc cleanup: remove unused functionMichael Howell-5/+4
2022-07-01rustdoc: use <details> tag for the source code sidebarMichael Howell-48/+25
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.
2022-06-30Rollup merge of #98709 - GuillaumeGomez:rm-decl-for-old-browsers, r=Dylan-DPCMatthias Krüger-34/+0
Remove unneeded methods declaration for old web browsers All these methods were not defined for IE mostly. But since we don't support it anymore, no need to keep them around. cc ```@jsha``` r? ```@notriddle```
2022-06-30Rollup merge of #98671 - GuillaumeGomez:source-sidebar-fixes, r=notriddleMatthias Krüger-1/+21
Fix source sidebar bugs This PR fixes the following two bugs: ![Screenshot from 2022-06-29 14-39-58](https://user-images.githubusercontent.com/3050060/176449070-3e3762da-2bfe-4acf-8eb0-34f6eb4c94ed.png) ![Screenshot from 2022-06-29 15-05-09](https://user-images.githubusercontent.com/3050060/176449073-b164820b-bd71-4b1a-990c-bba4e5fce196.png) I added regression tests to prevent them to happen again. I think we should backport it to beta as well. You can test it [here](https://rustdoc.crud.net/imperio/source-sidebar-fixes/src/std/lib.rs.html). cc ```@jsha``` r? ```@notriddle```
2022-06-30Fix scroll when source sidebar is open on mobileGuillaume Gomez-0/+15
2022-06-30Remove unneeded methods declaration for old web browsersGuillaume Gomez-34/+0
2022-06-30Rollup merge of #98685 - camelid:sorting-flag, r=GuillaumeGomezMatthias Krüger-9/+16
Replace `sort_modules_alphabetically` boolean with enum This fixes the long-standing FIXME there and makes the code easier to understand. The reference to modules in both the old and new names seems potentially wrong since I believe it applies to all items. r? ``@GuillaumeGomez``
2022-06-29Replace `sort_modules_alphabetically` boolean with enumNoah Lev-9/+16
This fixes the long-standing FIXME there and makes the code easier to understand. The reference to modules in both the old and new names seems potentially wrong since I believe it applies to all items.
2022-06-29Rollup merge of #98646 - notriddle:notriddle/main.js, r=GuillaumeGomezMatthias Krüger-2/+6
rustdoc: fix bugs in main.js popover help and settings
2022-06-29Fix display of toggle on expanded source sidebarGuillaume Gomez-0/+3
2022-06-29Fix height for the source sidebar in mobile modeGuillaume Gomez-1/+3
2022-06-28rustdoc: make keyboard commands work when checkboxes are selectedMichael Howell-1/+2
2022-06-28rustdoc: fix keyboard shortcuts bug in settings menuMichael Howell-1/+1
This commit fixes the keyboard shorts code to call localStorage every time a key is pressed. This matters because you're supposed to be able to change a setting and have it immediately take effect.
2022-06-28rustdoc: fix help menu popover togglingMichael Howell-0/+3
2022-06-28Auto merge of #98475 - notriddle:notriddle/index-fn-signatures, r=GuillaumeGomezbors-139/+380
rustdoc: reference function signature types from the `p` array This reduces the size of the function signature index, because it's common to have many functions that operate on the same types. $ wc -c search-index-old.js search-index-new.js 5224374 search-index-old.js 3932314 search-index-new.js By my math, this reduces the uncompressed size of the search index by 32%. On compressed signatures, the wins are less drastic, a mere 8%: $ wc -c search-index-old.js.gz search-index-new.js.gz 404532 search-index-old.js.gz 371635 search-index-new.js.gz
2022-06-28Simplify CSS theming by setting CSS variablesGuillaume Gomez-199/+73