Commit Graph

237 Commits

Author SHA1 Message Date
Guillaume Gomez
ebee483e24 Add doc keyword support 2018-06-04 09:51:41 +02:00
Guillaume Gomez
26ad95c9d4 Add attributes for trait and methods as well 2018-06-02 23:26:46 +02:00
Guillaume Gomez
c7312fbae4 Fixes some style issues in rustdoc "implementations on Foreign types" 2018-05-30 01:12:23 +02:00
Guillaume Gomez
934e37aeb4
Rollup merge of #50632 - GuillaumeGomez:minification, r=ollie27
Add minification process

r? @QuietMisdreavus
2018-05-15 14:26:59 +02:00
Guillaume Gomez
f0db2cf14e Use fullpath instead of recreating it 2018-05-12 23:44:40 +02:00
Guillaume Gomez
f2bc09e68b Fix invalid deduplication 2018-05-12 19:16:37 +02:00
Guillaume Gomez
8fab482a68 Fix items counts in search results 2018-05-12 19:16:37 +02:00
Guillaume Gomez
6a4bdda87b Reduce js files size 2018-05-12 19:16:37 +02:00
Guillaume Gomez
72b7c8d291 Remove extra span tags 2018-05-12 19:16:37 +02:00
Guillaume Gomez
e81b59bba8 Improve alias rendering 2018-05-12 19:16:37 +02:00
Guillaume Gomez
cf9209f872 Improve results 2018-05-12 19:16:37 +02:00
Guillaume Gomez
4b14573d50 Add minification process 2018-05-12 19:15:06 +02:00
Guillaume Gomez
d0840fd63b Fix paths search 2018-05-05 12:44:10 +02:00
Guillaume Gomez
135ee85aba Rename "show type declaration" to "show declaration" 2018-04-30 22:32:17 +02:00
Guillaume Gomez
acf0adf798 Add setting to go to item if there is only one result 2018-04-26 19:53:21 +02:00
Guillaume Gomez
ac0f99c03f Some JS improvements 2018-04-25 09:01:32 +02:00
Guillaume Gomez
f33af5c4de fix search bar bug 2018-04-23 23:55:36 +02:00
bors
28193e873c Auto merge of #49954 - GuillaumeGomez:doc-settings, r=ollie27,QuietMisdreavus
Add rustdoc settings menu

Fixes #18167.

r? @QuietMisdreavus
2018-04-22 11:04:41 +00:00
Guillaume Gomez
d0e2d26ceb remove unused condition 2018-04-21 22:02:54 +02:00
Guillaume Gomez
ca3213c338 fix invalid items removal 2018-04-21 22:02:54 +02:00
Guillaume Gomez
03b0856849 Add aliases in the search as well 2018-04-21 22:02:53 +02:00
Guillaume Gomez
654cb84852 Add specific never search 2018-04-21 22:01:38 +02:00
Guillaume Gomez
f2ad3c3f6c Add rustdoc settings menu 2018-04-17 23:35:43 +02:00
Guillaume Gomez
47a9ffa573 Add multi-query search 2018-04-14 17:01:28 +02:00
Guillaume Gomez
238583a50f Fix anchors issue when everything is collapsed 2018-04-04 16:16:53 +02:00
bors
15e8c5d846 Auto merge of #49412 - GuillaumeGomez:hide-type-decl, r=QuietMisdreavus
Hide type declarations by default

I'm not very happy for the moment about the rendering but the bases are here:

<img width="610" alt="screen shot 2018-03-27 at 11 56 27" src="https://user-images.githubusercontent.com/3050060/37960492-0e045954-31b6-11e8-9cea-1ef8a3f980c4.png">

r? @QuietMisdreavus
2018-03-30 01:45:54 +00:00
kennytm
1a89250356
Rollup merge of #49439 - GuillaumeGomez:trait-impl-collapse, r=QuietMisdreavus
Fix trait implementation not collapsing docs

r? @QuietMisdreavus
2018-03-28 17:55:16 +02:00
kennytm
611ceef28d
Rollup merge of #49429 - GuillaumeGomez:fix-collapse-toggle-insertion, r=QuietMisdreavus
Fix collapse toggle insertions on impl with docs

Just went through this one randomly... When an impl has docs, the collapse toggle isn't generated. This fixes it.

r? @QuietMisdreavus
2018-03-28 17:55:14 +02:00
Guillaume Gomez
884153a257 Fix trait implementation not collapsing docs 2018-03-28 09:51:18 +02:00
Guillaume Gomez
8be26a2ca0 Fix collapse toggle insertions on impl with docs 2018-03-27 22:49:55 +02:00
Guillaume Gomez
73b97c7e7c Hide type declarations by default 2018-03-27 11:57:00 +02:00
Guillaume Gomez
96ef2f8ab9 Fix search appearance 2018-03-27 10:33:31 +02:00
Guillaume Gomez
90588a9086 Fix IE11 search 2018-03-23 21:27:15 +01:00
Guillaume Gomez
5581aa8eeb Fix events handling in rustdoc 2018-03-18 16:32:41 +01:00
kennytm
15d71d3285
Rollup merge of #48631 - focusaurus:remember-collapse-setting, r=QuietMisdreavus
Remember state of top-level collapse toggle widget

This change allows the big top-right expand/collapse toggle to remember its setting across navigation or page reloads. Prior to this change, there was this annoyance:

- browse to some docs
- Click the minus button to collapse them
- browse to other docs (or reload the page)
- Everything is expanded again

The solution is based on storing a simple boolean flag in localStorage. I think it's a good improvement, but it does introduce the following potentially surprising behavior:

- browse to some docs
- click the minus button to collapse them
- click to expand a particular item (not the main top-right big one)
- reload the page, everything is collapsed

Paired with @debugsteven on this.
2018-03-13 05:01:15 +08:00
Guillaume Gomez
9e0ccc5a47 Fix escape not working when searchbar selected 2018-03-09 17:45:44 +01:00
Guillaume Gomez
6235ef0422 Add missing items in the sidebar for functions 2018-03-09 17:45:44 +01:00
Guillaume Gomez
a628543891 Don't generate '[+]'/'[-]' on 'empty' traits 2018-03-05 23:39:34 +01:00
Peter Lyons
2dd81c86c5 Rename doc collapse sentinal to rustdoc-collapse 2018-03-01 02:50:32 -07:00
Peter Lyons
55cc9a4336 Remember state of top-level collapse toggle widget 2018-03-01 00:03:47 -07:00
kennytm
71ce38eb9e
Rollup merge of #48381 - GuillaumeGomez:rustdoc-theme-securities, r=QuietMisdreavus
Rustdoc theme securities

Fixes #48375.
Fixes #48376.

r? @steveklabnik
cc @QuietMisdreavus
2018-02-28 19:15:31 +08:00
bors
89e5a0796e Auto merge of #47894 - vi:rustdoc_foldable_impls, r=GuillaumeGomez,QuietMisdreavus
rustdoc: Foldable impl blocks

Addresses #40363, #45720, #24483, #23986 and so on

* Expands and refactors collapseDocs and toggleAllDocs
* Adds [-] toggle to all impls (including inherent impl)
* Makes it hiding though main css file, not though element inline style

May need to be addressed:

* "[-]" and anchor link copier are overlaid a bit
* Inherent methods are also hidden by the global [-] toggle.
* Auto-collapsing "Iterator" and so on by default is not implemented yet
* Tested only shallowly and only in Chromiuim
* No tests. Are there tests for css/js part here?
* The new implementation may be a bit slower.

What next steps are need to be done before the integration?
2018-02-28 04:24:18 +00:00
Guillaume Gomez
5b61b615f5 Allow to not switch to a theme if it doesn't exist 2018-02-20 20:11:58 +01:00
Aaron Hill
64a1f6fbfd
Fix inlining 2018-02-18 16:29:25 -05:00
Aaron Hill
1531fbe9be
Cleanup formatting 2018-02-18 16:29:25 -05:00
Aaron Hill
6728f21d85
Generate documentation for auto-trait impls
A new section is added to both both struct and trait doc pages.

On struct/enum pages, a new 'Auto Trait Implementations' section displays any
synthetic implementations for auto traits. Currently, this is only done
for Send and Sync.

On trait pages, a new 'Auto Implementors' section displays all types
which automatically implement the trait. Effectively, this is a list of
all public types in the standard library.

Synthesized impls for a particular auto trait ('synthetic impls') take
into account generic bounds. For example, a type 'struct Foo<T>(T)' will
have 'impl<T> Send for Foo<T> where T: Send' generated for it.

Manual implementations of auto traits are also taken into account. If we have
the following types:

'struct Foo<T>(T)'
'struct Wrapper<T>(Foo<T>)'
'unsafe impl<T> Send for Wrapper<T>' // pretend that Wrapper<T> makes
this sound somehow

Then Wrapper will have the following impl generated:
'impl<T> Send for Wrapper<T>'
reflecting the fact that 'T: Send' need not hold for 'Wrapper<T>: Send'
to hold

Lifetimes, HRTBS, and projections (e.g. '<T as Iterator>::Item') are
taken into account by synthetic impls

However, if a type can *never* implement a particular auto trait
(e.g. 'struct MyStruct<T>(*const T)'), then a negative impl will be
generated (in this case, 'impl<T> !Send for MyStruct<T>')

All of this means that a user should be able to copy-paste a synthetic
impl into their code, without any observable changes in behavior
(assuming the rest of the program remains unchanged).
2018-02-18 16:29:24 -05:00
Guillaume Gomez
e9bcb4eb89 Hide theme button under menu in mobile mode and fix top margin issue (in mobile too) 2018-02-08 23:47:49 +01:00
Guillaume Gomez
dde3611281 Fix rendering issues on mobile 2018-02-03 13:13:29 +01:00
Vitaly _Vi Shukela
28efcfc083
rustdoc: Fix erroneous collapsing of second+ inherent impl. 2018-02-01 17:07:43 +03:00
Vitaly _Vi Shukela
a3acd10297
rustdoc: Auto-collapse all non-inherent impls 2018-02-01 16:53:29 +03:00