bors
6b269e4432
Auto merge of #73767 - P1n3appl3:rustdoc-formats, r=tmandry
...
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-29 22:24:46 +00:00
Joseph Ryan
29df0508f3
Pass by value
2020-07-29 16:48:22 -05:00
Joseph Ryan
7621a5b635
Refactor DocFS to fix error handling bugs
2020-07-29 16:15:31 -05:00
Lzu Tao
5faef5e00c
ayu theme: Change doccomment color to #a1ac88
...
Co-authored-by: Cldfire <cldfire@3grid.net>
2020-07-28 05:12:12 +00:00
Joseph Ryan
cee8023c69
More requested changes
2020-07-27 17:34:17 -05:00
Joseph Ryan
3d707a008e
Make requested changes
2020-07-27 16:00:39 -05:00
Joseph Ryan
a790952254
Pull out more types from html
2020-07-27 16:00:38 -05:00
Joseph Ryan
6a4396b98c
Extract Cache and other types from html module
2020-07-27 16:00:38 -05:00
Joseph Ryan
5bc97946ca
Refactor html backend to use generic interface
2020-07-27 16:00:38 -05:00
Joseph Ryan
c692ed468c
Move Error and RenderInfo out of html module
2020-07-27 16:00:38 -05:00
Jarek Samic
51b99d48fa
Don't italicize comments in ayu theme
2020-07-26 14:11:10 -04:00
Yuki Okushi
0651dd4aab
Rollup merge of #74572 - Mark-Simulacrum:unify-rustc-depr, r=petrochenkov
...
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-24 18:56:27 +09:00
Yuki Okushi
52476f53dd
Rollup merge of #74504 - lzutao:ayu-border-selected-fn, r=GuillaumeGomez
...
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-24 18:56:25 +09:00
Yuki Okushi
38b295699f
Rollup merge of #74361 - GuillaumeGomez:theme-logo, r=Manishearth
...
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:



r? @lzutao
cc @Cldfire
2020-07-24 18:56:22 +09:00
Lzu Tao
7005ddb50d
Add right border bar to Dark and Light theme
...
Ayu has it. Adding similar rule to other themes makes users less
surprised and makes GUI more consistent.
2020-07-24 02:09:14 +00:00
Lzu Tao
ccbb024d83
ayu: Change to less luminous color
...
Co-authored-by: Cldfire <cldfire@3grid.net>
2020-07-24 02:09:07 +00:00
Manish Goregaokar
05a24661a3
Rollup merge of #74635 - GuillaumeGomez:fix-tooltip-pos, r=Manishearth
...
Fix tooltip position if the documentation starts with a code block
Fixes #74321 .
Before:

After:

And in case there is text, it is not being applied:

And on mobile it isn't needed so it's not "activated":

r? @rust-lang/rustdoc
2020-07-22 09:29:17 -07:00
Guillaume Gomez
96225b15e5
Fix tooltip position if the documentation starts with a code block
2020-07-22 17:19:05 +02:00
Mark Rousskov
8454ee89b2
Migrate rustc_depr uses to use deprecation attribute
...
This should not be a change in behavior.
2020-07-20 21:22:14 -04:00
Manish Goregaokar
963b837a83
Rollup merge of #74555 - GuillaumeGomez:important-traits-popup, r=Manishearth
...
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-20 12:30:31 -07:00
Manish Goregaokar
6467f6f494
Rollup merge of #74505 - Cldfire:fix-search-focus, r=GuillaumeGomez
...
Fix search input focus in ayu theme
Closes #74496 .
Before:

After:

2020-07-20 12:30:24 -07:00
Guillaume Gomez
995d63ac73
Improve "important traits" popup display on mobile
2020-07-20 14:37:47 +02:00
Lzu Tao
0eff3d5d88
Ayu: use different background color to make Run button easy-to-spot
...
Co-authored-by: Cldfire <cldfire@3grid.net>
2020-07-19 09:09:06 +00:00
Jarek Samic
dec70767e5
Fix search input focus in ayu theme
2020-07-19 02:00:10 -04:00
Lzu Tao
174abeb6cb
Add an border around the Run button
2020-07-19 04:31:01 +00:00
Guillaume Gomez
83ffd5c18d
Fix tidy issues
2020-07-17 10:22:09 +02:00
Guillaume Gomez
6969b30996
Convert whitespaces to tabs
2020-07-17 10:14:58 +02:00
Guillaume Gomez
839216a57c
Improve logo image display in different themes
2020-07-17 10:12:03 +02:00
Manish Goregaokar
874097c8c7
Rollup merge of #74371 - Aloso:patch-1, r=GuilliameGomez
...
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:

After (note that this PR no longer includes the white shadow of the logo):

2020-07-16 17:09:02 -07:00
Manish Goregaokar
0e70884083
Rollup merge of #74351 - lzutao:remove-rustc-internal-compiler-warns, 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:

After:

Nothing changes in unstable items of std:
Before:

After:

Closes #54682
2020-07-16 17:08:59 -07:00
Manish Goregaokar
fc098170ce
Rollup merge of #74370 - Manishearth:re-spotlight, r=GuillaumeGomez
...
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.


It also works fine on mobile:

2020-07-16 11:18:55 -07:00
Manish Goregaokar
61fccf05f9
Rollup merge of #74359 - lzutao:rustdoc-tostring, r=GuillaumeGomez
...
rustdoc: Rename internal API fns to `into_string`
to avoid surprising listed in API guidelines.
2020-07-16 11:18:53 -07:00
Manish Goregaokar
196243ed9b
Rollup merge of #74325 - GuillaumeGomez:focus-source-file-sidebar, r=kinnison
...
Focus on the current file in the source file sidebar
Fixes #73360 .
r? @kinnison
cc @rust-lang/rustdoc
2020-07-16 11:18:52 -07:00
Manish Goregaokar
b700835118
Rollup merge of #73807 - euclio:rustdoc-highlighting, r=ollie27,GuillaumeGomez
...
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-16 11:18:31 -07:00
Manish Goregaokar
c621a54eeb
Don't position:relative on all pres
...
We need it for run buttons (https://github.com/rust-lang/rust/pull/44671 ), but not function defs
2020-07-16 09:58:37 -07:00
Manish Goregaokar
a474b272f5
Remove !important on border-color and background-color
2020-07-16 09:58:37 -07:00
Manish Goregaokar
0625b29813
Add Ayu theme for spotlight
2020-07-16 09:58:37 -07:00
Manish Goregaokar
ae6c7e6f40
Review comments for JS
2020-07-16 09:58:37 -07:00
Manish Goregaokar
734afb4830
Make spotlight show on hover
...
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-16 09:58:37 -07:00
Manish Goregaokar
c90fb7185a
Move spotlight next to the return type
2020-07-16 09:58:37 -07:00
Manish Goregaokar
98450757e5
Revert "Remove "important traits" feature"
...
This reverts commit 1244ced958 .
2020-07-16 09:58:17 -07:00
Guillaume Gomez
52c65e05f5
Remove elements iterator clone and only keep first element instead
2020-07-16 18:34:49 +02:00
Ludwig Stecher
d08bb4037e
Remove drop-shadow
2020-07-15 20:28:42 +02:00
Manish Goregaokar
0d07db98ab
Rollup merge of #74218 - GuillaumeGomez:search-results-bottom-margin, 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:

r? @kinnison
cc @rust-lang/rustdoc @Manishearth @jyn514
2020-07-15 11:01:18 -07:00
Manish Goregaokar
efad203144
Rollup merge of #74196 - GuillaumeGomez:auto-collapse-implementors, 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-15 11:01:16 -07:00
Ludwig Stecher
ef6c0263b0
Improve ayu rustdoc theme
...
* 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-15 18:18:59 +02:00
Guillaume Gomez
39d99ea6e6
Improve settings wording
2020-07-15 17:40:20 +02:00
Lzu Tao
0f4e4a022c
rustdoc: Rename internal API fns to into_string
...
to avoid surprising listed in API guidelines.
2020-07-15 10:55:40 +00:00
Lzu Tao
47fea961ba
Remove unused CSS rules for internal rustc items
2020-07-15 10:53:10 +00:00
Lzu Tao
f97063259e
Don't render unstable for rustc docs
...
As rustc is permanently unstable. So marking every items
with unstable is essential useless.
2020-07-15 10:53:10 +00:00