Dylan DPC
463fdf3e04
Rollup merge of #75806 - GuillaumeGomez:prevent-automatic-page-change-history, r=pickfire
...
Prevent automatic page change when using history
Fixes #75774 .
2020-08-27 01:14:08 +02:00
Guillaume Gomez
76bd5b3852
Add explanations on the results search element check
2020-08-24 12:59:16 +02:00
Guillaume Gomez
6cb364cda4
Prevent automatic page change when using history
2020-08-23 14:39:43 +02:00
Joshua Nelson
a97d65d6e4
rustdoc: Rename misleading function
...
- `is_associated` -> `is_type_alias`
`is_associated` is not a good name for what this is doing. If you look at
https://github.com/rust-lang/rust/pull/74489/files#diff-6a301d597807ee441a41e7237800563dR296 ,
is_associated() and as_assoc_kind() do completely different things, but
from the name it sounds like they're similar.
2020-08-22 00:22:43 -04:00
Yuki Okushi
98f7d882c8
Rollup merge of #75665 - GuillaumeGomez:doc-examples-coverage, r=jyn514
...
Add doc examples coverage
r? @jyn514
2020-08-19 15:54:37 +09:00
Guillaume Gomez
d9d84dca8e
Add doc examples count for --show-coverage
2020-08-18 13:31:23 +02:00
Bastian Kauschke
cd53760cc7
merge as_local_hir_id with local_def_id_to_hir_id
2020-08-13 16:55:16 +02:00
Tyler Mandry
a4211977d7
Rollup merge of #75393 - GuillaumeGomez:fix-help-shortcut, r=pickfire
...
Fully handle "?" shortcut
Fixes #75386 .
cc @runiq
2020-08-11 12:28:34 -07:00
Tyler Mandry
c18b64c866
Rollup merge of #75378 - petrochenkov:isident, r=Mark-Simulacrum
...
Introduce `rustc_lexer::is_ident` and use it in couple of places
Implements the suggestion from https://github.com/rust-lang/rust/pull/74537#issuecomment-662261979 .
2020-08-11 12:28:32 -07:00
Guillaume Gomez
fdf2fe18a1
Fully handle "?" shortcut
2020-08-11 18:28:01 +02:00
Yuki Okushi
a75bdfa230
Rollup merge of #75347 - fusion-engineering-forks:rustdoc-nat-sort, r=GuillaumeGomez
...
Rustdoc: Fix natural ordering to look at all numbers.
The old implementation only looks at numbers at the end, but not in other places in a name: `u8` and `u16` got sorted properly, but `u8_bla` and `u16_bla` did not.

2020-08-11 16:23:52 +09:00
Dylan DPC
51ed33d8c2
Rollup merge of #75366 - GuillaumeGomez:help-button, r=jyn514
...
Add help button
Part of #75197 .
Here is a screenshot of the result:

r? @jyn514
2020-08-11 01:56:43 +02:00
Dylan DPC
2ad7c1687f
Rollup merge of #75249 - GuillaumeGomez:rust-logo-border, r=Manishearth
...
Only add a border for the rust logo



I didn't add a border for the light theme though, as I felt it as unnecessary.
r? @Manishearth
2020-08-11 01:56:32 +02:00
Mark Rousskov
6bbf4558ac
Feature gate is always present
2020-08-11 00:08:04 +03:00
Guillaume Gomez
a34bc7961a
Add help button
2020-08-10 16:52:19 +02:00
Mara Bos
8c705f83db
Rustdoc: Fix natural ordering to look at all numbers.
...
The old implementation only looks at numbers at the end, but not in
other places in a name: "u8" and "u16" got sorted properly, but "u8_bla"
and "u16_bla" did not.
2020-08-09 23:05:35 +02:00
Camelid
f3cc957f2e
Rename "Important traits" to "Notable traits"
...
* Rename it in the UI
* Rename the CSS classes
2020-08-09 12:09:05 -07:00
Nicholas Nethercote
e539dd65f8
Eliminate the SessionGlobals from librustc_ast.
...
By moving `{known,used}_attrs` from `SessionGlobals` to `Session`. This
means they are accessed via the `Session`, rather than via TLS. A few
`Attr` methods and `librustc_ast` functions are now methods of
`Session`.
All of this required passing a `Session` to lots of functions that didn't
already have one. Some of these functions also had arguments removed, because
those arguments could be accessed directly via the `Session` argument.
`contains_feature_attr()` was dead, and is removed.
Some functions were moved from `librustc_ast` elsewhere because they now need
to access `Session`, which isn't available in that crate.
- `entry_point_type()` --> `librustc_builtin_macros`
- `global_allocator_spans()` --> `librustc_metadata`
- `is_proc_macro_attr()` --> `Session`
2020-08-08 12:03:42 +10:00
Guillaume Gomez
48a6c2125b
Only add a border for the rust logo
2020-08-07 11:19:07 +02:00
Vadim Petrochenkov
0a88346be6
rustc_ast: (Nested)MetaItem::check_name -> has_name
...
For consistency with `Attribute::has_name` which doesn't mark the attribute as used either.
Replace all uses of `check_name` with `has_name` outside of rustc
2020-08-04 00:34:11 +03:00
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