about summary refs log tree commit diff
path: root/src/librustdoc/html/render.rs
AgeCommit message (Collapse)AuthorLines
2020-07-27Extract `Cache` and other types from `html` moduleJoseph Ryan-4599/+0
2020-07-27Refactor html backend to use generic interfaceJoseph Ryan-312/+298
2020-07-27Move `Error` and `RenderInfo` out of `html` moduleJoseph Ryan-67/+4
2020-07-20Migrate rustc_depr uses to use deprecation attributeMark Rousskov-20/+9
This should not be a change in behavior.
2020-07-16Rollup merge of #74351 - lzutao:remove-rustc-internal-compiler-warns, ↵Manish Goregaokar-28/+17
r=Mark-Simulacrum Do not render unstable items for rustc doc See the zulip conversion: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/rustc.20doc.3A.20.22internal.20compiler.20API.22.20warns.20are.20everywhere!/near/203850782 Before: ![image](https://user-images.githubusercontent.com/15225902/87501971-9cff8780-c68a-11ea-93b4-ea53ce18a77b.png) After: ![image](https://user-images.githubusercontent.com/15225902/87501985-a7218600-c68a-11ea-81c0-a6b5b120832c.png) Nothing changes in unstable items of std: Before: ![image](https://user-images.githubusercontent.com/15225902/87502004-b7d1fc00-c68a-11ea-9224-a27a1d2a81d6.png) After: ![image](https://user-images.githubusercontent.com/15225902/87502018-c0c2cd80-c68a-11ea-9773-4c63158025cb.png) Closes #54682
2020-07-16Rollup merge of #74370 - Manishearth:re-spotlight, r=GuillaumeGomezManish Goregaokar-5/+64
Reintroduce spotlight / "important traits" feature (Reopened version of https://github.com/rust-lang/rust/pull/74111 because Github is broken, see discussion there) Fixes https://github.com/rust-lang/rust/issues/73785 This PR reintroduces the "spotlight" ("important traits") feature. A couple changes have been made: As there were concerns about its visibility, it has been moved to be next to the return type, as opposed to being on the side. It also no longer produces a modal, it shows the traits on hover, and it can be clicked on to pin the hover bubble. ![image](https://user-images.githubusercontent.com/1617736/86674555-a82d2600-bfad-11ea-9a4a-a1a9ffd66ae5.png) ![image](https://user-images.githubusercontent.com/1617736/86674533-a1061800-bfad-11ea-9e8a-c62ad86ed0d7.png) It also works fine on mobile: ![image](https://user-images.githubusercontent.com/1617736/86674638-bda25000-bfad-11ea-8d8d-1798b608923e.png)
2020-07-16Rollup merge of #74359 - lzutao:rustdoc-tostring, r=GuillaumeGomezManish Goregaokar-5/+5
rustdoc: Rename internal API fns to `into_string` to avoid surprising listed in API guidelines.
2020-07-16Rollup merge of #73807 - euclio:rustdoc-highlighting, r=ollie27,GuillaumeGomezManish Goregaokar-1/+6
rustdoc: glue tokens before highlighting Fixes #72684. This commit also modifies the signature of `Classifier::new` to avoid copying the source being highlighted.
2020-07-16Make spotlight show on hoverManish Goregaokar-12/+4
This makes the spotlight show on hover instead of click. Clicks can be used to persist it, which is also what's used on mobile.
2020-07-16Move spotlight next to the return typeManish Goregaokar-22/+12
2020-07-16Revert "Remove "important traits" feature"Manish Goregaokar-5/+82
This reverts commit 1244ced9580b942926afc06815e0691cf3f4a846.
2020-07-15Rollup merge of #74196 - GuillaumeGomez:auto-collapse-implementors, ↵Manish Goregaokar-1/+2
r=Manishearth Add option to collapse automatically implementors Fixes #73403 It adds an option (enabled by default) which collapses all implementors impl blocks. r? @kinnison cc @rust-lang/rustdoc
2020-07-15Improve settings wordingGuillaume Gomez-2/+2
2020-07-15rustdoc: Rename internal API fns to `into_string`Lzu Tao-5/+5
to avoid surprising listed in API guidelines.
2020-07-15Don't render unstable for rustc docsLzu Tao-28/+17
As rustc is permanently unstable. So marking every items with unstable is essential useless.
2020-07-14rustdoc: glue tokens before highlightingAndy Russell-1/+6
Fixes #72684. This commit also modifies the signature of `Classifier::new` to avoid copying the source being highlighted.
2020-07-14Rollup merge of #71237 - Cldfire:rustdoc-ayu-theme, r=GuilliaumeGomezManish Goregaokar-29/+65
Add Ayu theme to rustdoc This is a port of a theme I maintain (https://github.com/Cldfire/ayu-rs) to the native rustdoc theme system. [Ayu](https://github.com/dempfi/ayu) (dark) is a richly-colored dark theme that many people enjoy using across a wide variety of environments. Corresponds to the Ayu theme in [mdBook](https://github.com/rust-lang/mdBook). Some screenshots: ![image](https://user-images.githubusercontent.com/13814214/79547087-6c935780-8061-11ea-8a33-38e9472e9fec.png) ![image](https://user-images.githubusercontent.com/13814214/79547150-8339ae80-8061-11ea-97be-9e13a8b275d7.png) ![image](https://user-images.githubusercontent.com/13814214/79547221-98164200-8061-11ea-9649-9b11ccbb33e3.png) ![image](https://user-images.githubusercontent.com/13814214/79547310-b419e380-8061-11ea-9965-d4f90b2280ab.png) ![image](https://user-images.githubusercontent.com/13814214/79547443-e7f50900-8061-11ea-8872-06d74010691e.png) Note that this pull request also makes some small code changes to allow for disabling theme stylesheets, preventing the rules from all the different themes from conflicting with one another. The only stylesheet that is not disabled is `light.css`; the theming system (quite hackily) switches themes by changing the href on this stylesheet and so permanently disabling all the others works perfectly fine.
2020-07-12Add Ayu theme to rustdocJarek Samic-0/+7
2020-07-12Clean up handling of style files in rustdocJarek Samic-29/+58
Disable all themes other than `light.css` to prevent rule conflicts
2020-07-11rustdoc: insert newlines between attributesAndy Russell-8/+13
2020-07-10Avoid "whitelist"Tamir Duberstein-2/+2
Other terms are more inclusive and precise.
2020-07-09Add option to collapse automatically implementorsGuillaume Gomez-0/+1
2020-07-09Rollup merge of #74107 - nbdd0121:rustdoc, r=GuillaumeGomezManish Goregaokar-1/+7
Hide `&mut self` methods from Deref in sidebar if there are no `DerefMut` impl for the type. This partially addresses #74083.
2020-07-06Hide `&mut self` methods from Deref in sidebarGary Guo-1/+7
If there are no `DerefMut` impl for the type.
2020-07-02Remove render-redirect-pages option in rustdocGuillaume Gomez-12/+0
2020-07-02Simplify DOM by removing IDs for code tagsGuillaume Gomez-38/+9
2020-06-26Generate docs for links to private items when passed --document-privateJoshua Nelson-1/+2
- Pass around document_private a lot more - Add tests + Add tests for intra-doc links to private items + Add ignored tests for warnings in reference links
2020-06-15Re-order correctly the sections in the sidebarGuillaume Gomez-2/+2
2020-05-31Auto merge of #72767 - pnkfelix:track-devirtualized-filenames-issue-70924, ↵bors-2/+3
r=eddyb Track devirtualized filenames Split payload of FileName::Real to track both real and virtualized paths. (Such splits arise from metadata refs into libstd; the virtualized paths look like `/rustc/1.45.0/src/libstd/io/cursor.rs` rather than `/Users/felixklock/Dev/Mozilla/rust.git/src/libstd/io/cursor.rs`) This way, we can emit the virtual name into things like the like the StableSourceFileId (as was done back before PR #70642) that ends up in incremental build artifacts, while still using the devirtualized file path when we want to access the file. Fix #70924
2020-05-30Rollup merge of #72650 - GuillaumeGomez:sort-sidebar-elements, r=kinnisonRalf Jung-32/+31
Sort sidebar elements r? @kinnison
2020-05-29Split payload of FileName::Real to track both real and virutalized paths.Felix S. Klock II-2/+3
Such splits arise from metadata refs into libstd. This way, we can (in a follow on commit) continue to emit the virtual name into things like the like the StableSourceFileId that ends up in incremetnal build artifacts, while still using the devirtualized file path when we want to access the file. Note that this commit is intended to be a refactoring; the actual fix to the bug in question is in a follow-on commit.
2020-05-27Sort fields, variants and other unsorted elements in the sidebarGuillaume Gomez-32/+31
2020-05-26Auto merge of #71900 - GuillaumeGomez:clean-up-rustdoc, r=ollie27,kinnisonbors-7/+10
Clean up rustdoc source code Fixes #70498. r? @kinnison cc @rust-lang/rustdoc
2020-05-16Rollup merge of #71724 - GuillaumeGomez:doc-alias-improvements, r=ollie27Dylan DPC-37/+6
Doc alias improvements After [this message](https://github.com/rust-lang/rust/issues/50146#issuecomment-496601755), I realized that the **doc alias**. So this PR does the followings: * Align the alias discovery on items added into the search-index. It brings a few nice advantages: * Instead of cloning the data between the two (in rustdoc source code), we now have the search-index one and aliases which reference to the first one. So we go from one big map containing a lot of duplicated data to just integers... * In the front-end (main.js), I improved the code around aliases to allow them to go through the same transformation as other items when we show the search results. * Improve the search tester in order to perform multiple requests into one file (I think it's better in this case than having a file for each case considering how many there are...) * I also had to add the new function inside the tester (`handleAliases`) Once this PR is merged, I intend to finally stabilize this feature. r? @ollie27 cc @rust-lang/rustdoc
2020-05-14Move doc alias discovery into the Attributes struct and some code improvementsGuillaume Gomez-1/+1
2020-05-11Rollup merge of #72109 - matthiaskrgr:cl8ppy, r=Dylan-DPCDylan DPC-3/+2
Fix clippy warnings Fixes clippy::{cone_on_copy, filter_next, redundant_closure, single_char_pattern, len_zero,redundant_field_names, useless_format, identity_conversion, map_clone, into_iter_on_ref, needless_return, option_as_ref_deref, unused_unit, unnecessary_mut_passed} r? @Dylan-DPC
2020-05-11Rollup merge of #72014 - GuillaumeGomez:deprecated-emoji, r=kinnison,ollie27Dylan DPC-1/+4
Deprecated emoji Fixes #67872. r? @kinnison cc @rust-lang/rustdoc
2020-05-11Fix clippy warningsMatthias Krüger-3/+2
Fixes clippy::{cone_on_copy, filter_next, redundant_closure, single_char_pattern, len_zero,redundant_field_names, useless_format, identity_conversion, map_clone, into_iter_on_ref, needless_return, option_as_ref_deref, unused_unit, unnecessary_mut_passed}
2020-05-09Sort "implementations on foreign types" section in the sidebarGuillaume Gomez-8/+7
2020-05-08Add emoji for deprecated messagesGuillaume Gomez-1/+4
2020-05-08Clean up rustdoc source codeGuillaume Gomez-7/+10
2020-05-07Merge aliases and search-indexGuillaume Gomez-36/+0
2020-05-07Improve doc alias discoveryGuillaume Gomez-3/+8
2020-05-05Replace title "Methods" with "Implementations"Guillaume Gomez-11/+11
2020-04-24Replace filter_map().next() calls with find_map()Josh Stone-8/+3
These are semantically the same, but `find_map()` is more concise.
2020-04-17Replace big JS dict with JSON parsingGuillaume Gomez-4/+35
2020-04-08rustdoc: Don't try to load source files from external cratesOliver Middleton-3/+3
Local items defined in external macros shouldn't generate rendered source files and should link to the external crate's docs instead.
2020-03-31more clippy fixesMatthias Krüger-8/+5
use is_empty() instead of len comparison (clippy::len_zero) use if let instead of while let loop that never loops (clippy::never_loop) remove redundant returns (clippy::needless_return) remove redundant closures (clippy::redundant_closure) use if let instead of match and wildcard pattern (clippy::single_match) don't repeat field names redundantly (clippy::redundant_field_names)
2020-03-30rustc -> rustc_middle part 3 (rustfmt)Mazdak Farrokhzad-2/+2
2020-03-30rustc -> rustc_middle part 2Mazdak Farrokhzad-2/+2