Aaron Hill
8250a2510d
Rollup merge of #82484 - bugadani:docfix, r=jyn514
...
rustdoc: Remove duplicate "List of all items"
Closes #82477
r? `@jyn514`
2021-02-25 16:06:23 -05:00
Dylan DPC
05ed0814b9
Rollup merge of #82313 - jsha:update-normalize-css, r=GuillaumeGomez
...
Update normalize.css to 8.0.1
From From https://github.com/necolas/normalize.css/releases/tag/8.0.1 .
The old version was 3.0.0, from 2014. The new version is from 2018.
I noticed when looking at frontend performance for rustdoc that this file was out of date. The URL in the 3.0.0 license header now resolves to an incorrect destination. And generally it seems good to be up-to-date.
Before-and-after images, plus diff, under details. TL;DR: Nothing changes except a slight adjustment to line height.
<details>



</details>
2021-02-25 14:34:02 +01:00
Dániel Buga
d3f75ebf60
Add test
2021-02-24 18:14:31 +01:00
Dániel Buga
3be69b100f
Remove duplicate string
2021-02-24 17:44:37 +01:00
Guillaume Gomez
b5c8eea55d
Put clean::Trait extra information into a new struct to make it more coherent
2021-02-23 21:58:16 +01:00
Guillaume Gomez
58a34a4dde
Remove is_spotlight field from Trait
2021-02-23 21:57:40 +01:00
Dylan DPC
8541435e8d
Rollup merge of #82234 - GuillaumeGomez:remove-query-param-on-esc, r=Nemo157
...
Remove query parameters when skipping search results
Fixes #81330 .
This PR changes the following: when pressing ESC and that no other "action" was performed (understand: no closing the search result, or hiding a menu or something along the line), then we discard the URL query parameters (the `?whatever=dsjfs`). What do you think about this change ```@rust-lang/rustdoc``` ?
EDIT: finally we're simply removing the query parameter when we're skipping the search results.
r? ```@Nemo157```
2021-02-23 02:51:54 +01:00
Dylan DPC
1c2a949736
Rollup merge of #79423 - camelid:smart-punct, r=jyn514
...
Enable smart punctuation
Closes #76690 .
2021-02-23 02:51:42 +01:00
Yuki Okushi
1dba8ce8a5
Rollup merge of #82351 - notriddle:docs-meta-description, r=jyn514
...
Use the first paragraph, instead of cookie-cutter text, for rustdoc descriptions
Partially addresses #82283 .
2021-02-22 18:26:08 +09:00
Michael Howell
bcef5e7077
Revert changes to all.html
...
This code wasn't actually working, and trying to SEO optimize that page is pointless anyway.
2021-02-20 17:26:05 -07:00
Michael Howell
1bedd4d678
Cut off plain text descriptions after headers
...
Before:
The Rust Standard LibraryThe Rust Standard Library is the foundation of portable Rust software, a set of minimal and battle-tested shared abstractions for the broader Rust ecosystem. It offers core types, like `Vec<T>` and `Option<T>`, library-defined operations on language primitives, standard macros, I/O and multithreading, among many other things.
After:
The Rust Standard Library
2021-02-20 16:48:37 -07:00
Michael Howell
553852806d
Use the first paragraph, instead of cookie-cutter text, for rustdoc descriptions
...
Fixes #82283
2021-02-20 16:48:37 -07:00
Guillaume Gomez
3071685505
Don't render [src] link on dummy spans
2021-02-20 19:51:38 +01:00
Jacob Hoffman-Andrews
7acb10514b
Re-minify normalize.css.
...
This bypasses tidy's complaints about tab indent. Also, this lets us
remove comments while keeping the MIT license comment.
2021-02-19 18:49:00 -08:00
Jacob Hoffman-Andrews
9bbd48256d
Update normalize.css to 8.0.1
...
From https://github.com/necolas/normalize.css/releases/tag/8.0.1 .
2021-02-19 18:28:53 -08:00
Jacob Hoffman-Andrews
7ad4b7a62f
Replace normalize.css 3.0.0 with unminified version.
...
This is in preparation to upgrade to 8.0.1, so the next commit
can contain more meaningful diffs.
2021-02-19 18:26:19 -08:00
Guillaume Gomez
eeb5552667
Remove query parameters when leaving search results
2021-02-17 22:04:30 +01:00
Joshua Nelson
2bc5a0a600
Make Clean take &mut DocContext
...
- Take `FnMut` in `rustc_trait_selection::find_auto_trait_generics`
- Take `&mut DocContext` in most of `clean`
- Collect the iterator in auto_trait_impls instead of iterating lazily; the lifetimes were really bad.
- Changes `fn sess` to properly return a borrow with the lifetime of `'tcx`, not the mutable borrow.
2021-02-16 21:25:14 -05:00
Guillaume Gomez
719c8d40cc
Fix ES5 errors (IE11)
2021-02-15 10:11:37 +01:00
Ophir LOJKINE
16f0ccda86
Fix getCurrentValue
2021-02-10 14:55:53 +01:00
Ophir LOJKINE
f13bbea124
Catch errors on localStorage setting failure
...
Fixes https://github.com/rust-lang/rust/issues/81928
“Ask forgiveness not permission” : this makes the code both simpler and more robust
2021-02-10 14:53:22 +01:00
Camelid
1b29b29200
Update Markdown unit tests
2021-02-09 12:25:22 -08:00
bors
921ec4b3fc
Auto merge of #81313 - LeSeulArtichaut:revert-32558, r=jyn514
...
Restore linking to itself in implementors section of trait page
Reverts #32558 as proposed in [this Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-rustdoc/topic/Trait.20implementation.20self-links/near/223773273 )
r? `@jyn514` cc `@camelid`
2021-02-08 10:46:10 +00:00
Camelid
a0f9d4beec
Enable smart punctuation
2021-02-07 19:57:53 -08:00
bors
a73c2e555c
Auto merge of #80883 - GuillaumeGomez:remove-some-function-fields, r=ollie27
...
Remove some function fields
Same kind as #80845 .
This PR removes the `all_types` and `ret_types` from the `clean::Function` type.
Another change that I had to do was implementing the `From` trait to be able to convert `hir::def::DefKind` into `clean::TypeKind` without requiring `DocContext` (and so I updated the `clean` method so that it's taken into account).
The last two commits improve a bit the `get_real_types` function and the `Type::generics` method.
r? `@jyn514`
2021-02-06 20:55:36 +00:00
LeSeulArtichaut
1daddb47d2
Restore linking to itself in implementors section of trait page
2021-02-06 21:05:41 +01:00
Jonas Schievink
e143159e75
Rollup merge of #81766 - jyn514:task-lists, r=GuillaumeGomez
...
Enable 'task list' markdown extension
Closes https://github.com/rust-lang/rust/issues/71183 .
2021-02-06 17:01:50 +01:00
Joshua Nelson
9653b601b2
Enable 'task list' markdown extension
...
- Add documentation about task lists
2021-02-06 00:08:21 -05:00
Guillaume Gomez
3c8e13aff1
Remove unused cache argument
2021-02-05 17:23:54 +01:00
Guillaume Gomez
076fa63424
Improve code
2021-02-05 17:23:54 +01:00
Guillaume Gomez
8e0d1cefd3
Improve html::render::cache::get_real_types code
2021-02-05 17:23:54 +01:00
Guillaume Gomez
4810910b0b
Remove Function all_types and ret_types fields
2021-02-05 17:23:52 +01:00
Mara Bos
2451bf90db
Rollup merge of #81497 - camelid:rustdoc-display_fn-remove-cell, r=jyn514
...
rustdoc: Move `display_fn` struct inside `display_fn`
This makes it clear that it's an implementation detail of `display_fn`
and shouldn't be used elsewhere, and it enforces in the compiler that no
one else can use it.
r? ````@GuillaumeGomez````
2021-02-05 12:25:58 +01:00
Guillaume Gomez
e57f1cfb4b
Rollup merge of #81681 - Smittyvb:rustdoc-shortcuts-styling, r=GuillaumeGomez
...
Better styling of "Switch result tab" shortcut
Before:


After:


2021-02-03 08:41:28 +01:00
Guillaume Gomez
de41c58c9f
Rollup merge of #81679 - GuillaumeGomez:clean-fixme-match-bind, r=poliorcetics,CraftSpider
...
Bind all clean::Type variants and remove FIXME
This is simply a little cleanup.
cc `@CraftSpider`
r? `@poliorcetics`
2021-02-03 08:41:26 +01:00
Smitty
87df27d71e
Better styling of "Switch result tab" shortcut
2021-02-02 16:15:57 -05:00
Guillaume Gomez
3336dd3565
Bind all clean::Type variants and remove FIXME
2021-02-02 22:07:23 +01:00
Jonas Schievink
d2f96a9b64
Rollup merge of #81630 - GuillaumeGomez:overflow-sidebar-title-text, r=pickfire
...
Fix overflowing text on mobile when sidebar is displayed
Fixes #81597 .
Before:

After:

cc `@pickfire`
r? `@Nemo157`
2021-02-02 12:15:06 +01:00
Jonas Schievink
30f12a0379
Rollup merge of #81492 - camelid:rustdoc-internal-mod-vis, r=GuillaumeGomez
...
rustdoc: Note why `rustdoc::html::markdown` is public
Almost all of the modules are crate-private, except for
`rustdoc::json::types`, which I believe is intended to be for public
use; and `rustdoc::html::markdown`, which is used externally by the
error-index generator and so has to be public.
r? ``@GuillaumeGomez``
2021-02-02 12:14:57 +01:00
bors
461cbe42d0
Auto merge of #81557 - GuillaumeGomez:primitive-search, r=ollie27
...
Fix primitive search in parameters and returned values
Part of #60485 .
Fixes #74780 .
Replacing #74879 .
cc `@camelid` `@jyn514` `@CraftSpider`
r? `@ollie27`
2021-02-02 00:15:06 +00:00
Guillaume Gomez
899b0dd1d1
Fix overflowing text on mobile when sidebar is displayed
2021-02-01 17:21:49 +01:00
Guillaume Gomez
198e3aba8f
Put back primitives in search
2021-02-01 15:56:51 +01:00
Jonas Schievink
ccc5a85307
Rollup merge of #81592 - GuillaumeGomez:rustdoc-ui-fixes, r=Nemo157
...
Rustdoc UI fixes
The first commit fixes this bug (I couldn't figure out why we were setting the width manually and it works as expected without so...):

The second commit fixes a small bug. On tablets or computer with very little width, the search section goes "over" the search input, making it impossible to click on the search input:

The third and last commit fixes two bugs that you can see in this screenshot:

The wheel is going over the search input and the search tab is going under the search results text. The bug was fixed by simply switching to "mobile mode" at a bigger width:

cc ```@pickfire```
r? ```@Nemo157```
2021-02-01 14:29:42 +01:00
Camelid
82010e86d3
rustdoc: Note why rustdoc::html::markdown is public
...
Almost all of the modules are crate-private, except for
`rustdoc::json::types`, which I believe is intended to be for public
use; and `rustdoc::html::markdown`, which is used externally by the
error-index generator and so has to be public.
2021-01-31 19:22:37 -08:00
Guillaume Gomez
be9b112a5a
Improve resize handling
2021-01-31 13:42:35 +01:00
Guillaume Gomez
07f5ca7e53
Prevent search section to go over search input
2021-01-31 13:42:35 +01:00
Guillaume Gomez
0a93cb36be
Remove unneeded explicit width from search results
2021-01-31 13:42:35 +01:00
Jonas Schievink
8b281d9cd7
Rollup merge of #81563 - pickfire:patch-6, r=GuillaumeGomez
...
Improve docblock readability on small screen
Before

After

Too much space is wasted on the left side. I wanted to make that 0 but it breaks some part with error symbols.
0

After

2021-01-31 01:47:48 +01:00
Jonas Schievink
45d24c729c
Rollup merge of #81558 - pickfire:patch-5, r=GuillaumeGomez
...
Fix ascii art text wrapping in mobile
Fix #81377
Before



After



Note the second image is scrolled to the back (right), I added some padding for the text block (not the code block) to make it more comfortable to read since the last character is stuck to the last character.
2021-01-31 01:47:44 +01:00
Ivan Tham
131ee07844
Remove extra trailing spaces
2021-01-31 01:36:15 +08:00