about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2020-07-29Auto merge of #73767 - P1n3appl3:rustdoc-formats, r=tmandrybors-1166/+452
Refactor librustdoc html backend This PR moves several types out of the librustdoc::html module so that they can be used by a future json backend. These changes are a re-implementation of [some work done 6 months ago](https://github.com/rust-lang/rust/compare/master...GuillaumeGomez:multiple-output-formats) by @GuillaumeGomez. I'm currently working on said json backend and will put up an RFC soon with the proposed implementation. There are a couple of changes that are more substantial than relocating structs to a different module: 1. The `Cache` is no longer part of the `html::render::Context` type and therefor it needs to be explicitly passed to any functions that access it. 2. The driving function `html::render::run` has been rewritten to use the `FormatRenderer` trait which should allow different backends to re-use the driving code. r? @GuillaumeGomez cc @tmandry @betamos
2020-07-29Pass by valueJoseph Ryan-1/+1
2020-07-29Refactor DocFS to fix error handling bugsJoseph Ryan-7/+10
2020-07-28ayu theme: Change doccomment color to `#a1ac88`Lzu Tao-3/+2
Co-authored-by: Cldfire <cldfire@3grid.net>
2020-07-27More requested changesJoseph Ryan-3/+3
2020-07-27Make requested changesJoseph Ryan-4/+2
2020-07-27Pull out more types from htmlJoseph Ryan-13/+2
2020-07-27Extract `Cache` and other types from `html` moduleJoseph Ryan-798/+169
2020-07-27Refactor html backend to use generic interfaceJoseph Ryan-312/+298
2020-07-27Move `Error` and `RenderInfo` out of `html` moduleJoseph Ryan-69/+8
2020-07-26Don't italicize comments in ayu themeJarek Samic-1/+0
2020-07-24Rollup merge of #74572 - Mark-Simulacrum:unify-rustc-depr, r=petrochenkovYuki Okushi-20/+9
Internally unify rustc_deprecated and deprecated This PR intentionally tries to be "featureless" in that the behavior is not altered for either attribute, though it more clearly exposes cases where that is the case in the code.
2020-07-24Rollup merge of #74504 - lzutao:ayu-border-selected-fn, r=GuillaumeGomezYuki Okushi-1/+3
Add right border bar to Dark and Light theme Demo: Light theme: https://github.com/rust-lang/rust/pull/74504#issuecomment-662491120 Dark theme: https://github.com/rust-lang/rust/pull/74504#issuecomment-662522446 Ayu theme: https://github.com/rust-lang/rust/pull/74504#issuecomment-662625685
2020-07-24Rollup merge of #74361 - GuillaumeGomez:theme-logo, r=ManishearthYuki Okushi-0/+12
Improve doc theme logo display Fixes #74350. The first commit cleans up the whitespaces and converts them to tabs. We should definitely write a tidy check for this (will do it in another PR). Screenshots: ![Screenshot from 2020-07-15 14-08-25](https://user-images.githubusercontent.com/3050060/87543748-8581c800-c6a5-11ea-8417-cbf98ebbfd10.png) ![Screenshot from 2020-07-15 14-11-59](https://user-images.githubusercontent.com/3050060/87543747-84e93180-c6a5-11ea-8cea-976b1470e809.png) ![Screenshot from 2020-07-15 14-12-12](https://user-images.githubusercontent.com/3050060/87543745-84509b00-c6a5-11ea-8324-c3c46ab2d9ef.png) r? @lzutao cc @Cldfire
2020-07-24Add right border bar to Dark and Light themeLzu Tao-0/+2
Ayu has it. Adding similar rule to other themes makes users less surprised and makes GUI more consistent.
2020-07-24ayu: Change to less luminous colorLzu Tao-1/+1
Co-authored-by: Cldfire <cldfire@3grid.net>
2020-07-22Rollup merge of #74635 - GuillaumeGomez:fix-tooltip-pos, r=ManishearthManish Goregaokar-0/+10
Fix tooltip position if the documentation starts with a code block Fixes #74321. Before: ![before](https://user-images.githubusercontent.com/3050060/88188970-cf842400-cc38-11ea-839b-37e41656837d.png) After: ![after](https://user-images.githubusercontent.com/3050060/88188981-d3b04180-cc38-11ea-8194-713ffe640d3a.png) And in case there is text, it is not being applied: ![after-witness](https://user-images.githubusercontent.com/3050060/88189009-ddd24000-cc38-11ea-9f0a-61dfd0a0cbd0.png) And on mobile it isn't needed so it's not "activated": ![Screenshot from 2020-07-22 17-17-43](https://user-images.githubusercontent.com/3050060/88194698-65bb4880-cc3f-11ea-8513-0043ccca8cfc.png) r? @rust-lang/rustdoc
2020-07-22Fix tooltip position if the documentation starts with a code blockGuillaume Gomez-0/+10
2020-07-20Migrate rustc_depr uses to use deprecation attributeMark Rousskov-20/+9
This should not be a change in behavior.
2020-07-20Rollup merge of #74555 - GuillaumeGomez:important-traits-popup, r=ManishearthManish Goregaokar-0/+5
Improve "important traits" popup display on mobile I implemented what @XAMPPRocky suggested in the [internals thread topic](https://internals.rust-lang.org/t/feedback-on-important-traits-rustdoc-feature/12752/18). I can confirm it works nicely. r? @Manishearth @Manishearth: By the way: I realized that when you click on the "i", you have to click again to make the popup disappear. Do you want me to extend the popup removal to any click outside the popup?
2020-07-20Rollup merge of #74505 - Cldfire:fix-search-focus, r=GuillaumeGomezManish Goregaokar-10/+0
Fix search input focus in ayu theme Closes #74496. Before: ![image](https://user-images.githubusercontent.com/13814214/87868463-d0c8fe80-c963-11ea-9003-aa578d869e98.png) After: ![image](https://user-images.githubusercontent.com/13814214/87868467-dc1c2a00-c963-11ea-89a8-1280f68ff9df.png)
2020-07-20Improve "important traits" popup display on mobileGuillaume Gomez-0/+5
2020-07-19Ayu: use different background color to make Run button easy-to-spotLzu Tao-4/+3
Co-authored-by: Cldfire <cldfire@3grid.net>
2020-07-19Fix search input focus in ayu themeJarek Samic-10/+0
2020-07-19Add an border around the Run buttonLzu Tao-0/+1
2020-07-17Fix tidy issuesGuillaume Gomez-23/+35
2020-07-17Convert whitespaces to tabsGuillaume Gomez-44/+54
2020-07-17Improve logo image display in different themesGuillaume Gomez-0/+12
2020-07-16Rollup merge of #74371 - Aloso:patch-1, r=GuilliameGomezManish Goregaokar-9/+6
Improve ayu rustdoc theme This PR changes the following: * It makes some lines darker * It gives the crate selector and search bar a border * The search bar's border turns blue when focused * ~~Gives the logo a bright shadow.~~ For standard library crates, it would be better to invert the logo, but that would be bad for crates with a colored logo, e.g. [async-std](https://docs.rs/async-std/1.6.2/async_std/). Before: ![old](https://user-images.githubusercontent.com/15658558/87576611-ed4e0800-c6d1-11ea-9667-3924702f79e2.png) After (note that this PR no longer includes the white shadow of the logo): ![new](https://user-images.githubusercontent.com/15658558/87576621-ef17cb80-c6d1-11ea-8e15-5d7f8b180c07.png)
2020-07-16Rollup merge of #74351 - lzutao:remove-rustc-internal-compiler-warns, ↵Manish Goregaokar-44/+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-14/+163
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-13/+14
rustdoc: Rename internal API fns to `into_string` to avoid surprising listed in API guidelines.
2020-07-16Rollup merge of #74325 - GuillaumeGomez:focus-source-file-sidebar, r=kinnisonManish Goregaokar-0/+5
Focus on the current file in the source file sidebar Fixes #73360. r? @kinnison cc @rust-lang/rustdoc
2020-07-16Rollup merge of #73807 - euclio:rustdoc-highlighting, r=ollie27,GuillaumeGomezManish Goregaokar-22/+133
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-16Don't position:relative on all presManish Goregaokar-1/+6
We need it for run buttons (https://github.com/rust-lang/rust/pull/44671), but not function defs
2020-07-16Remove !important on border-color and background-colorManish Goregaokar-10/+7
2020-07-16Add Ayu theme for spotlightManish Goregaokar-0/+5
2020-07-16Review comments for JSManish Goregaokar-8/+2
2020-07-16Make spotlight show on hoverManish Goregaokar-156/+53
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-36/+14
2020-07-16Revert "Remove "important traits" feature"Manish Goregaokar-8/+281
This reverts commit 1244ced9580b942926afc06815e0691cf3f4a846.
2020-07-16Remove elements iterator clone and only keep first element insteadGuillaume Gomez-3/+3
2020-07-15Remove drop-shadowLudwig Stecher-5/+0
2020-07-15Rollup merge of #74218 - GuillaumeGomez:search-results-bottom-margin, ↵Manish Goregaokar-0/+1
r=Dylan-DPC Add margin after doc search results I found it not really on computer that the last result is right at the bottom of the page. I find it better with margin below (especially when you hover the last element!). A screenshot to show the result: ![Screenshot from 2020-07-10 16-32-23](https://user-images.githubusercontent.com/3050060/87166097-6103a580-c2cb-11ea-81a8-12772cf20f64.png) r? @kinnison cc @rust-lang/rustdoc @Manishearth @jyn514
2020-07-15Rollup merge of #74196 - GuillaumeGomez:auto-collapse-implementors, ↵Manish Goregaokar-4/+11
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 ayu rustdoc themeLudwig Stecher-9/+11
* It makes some lines darker * It gives the crate selector and search bar a border * The search bar's border turns blue when focused * Gives the logo a bright shadow. This makes dark logos stand out more
2020-07-15Improve settings wordingGuillaume Gomez-2/+2
2020-07-15rustdoc: Rename internal API fns to `into_string`Lzu Tao-13/+14
to avoid surprising listed in API guidelines.
2020-07-15Remove unused CSS rules for internal rustc itemsLzu Tao-16/+0
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.