1
Fork 0
Commit graph

374 commits

Author SHA1 Message Date
Guillaume Gomez
e17f36b82e Replace title "Methods" with "Implementations" 2020-05-05 22:56:23 +02:00
Guillaume Gomez
496256c561 Update src/librustdoc/html/static/main.js
Fix variable name

Co-Authored-By: Mazdak Farrokhzad <twingoow@gmail.com>
2020-03-16 18:30:26 +01:00
Guillaume Gomez
5654cde729 formatting 2020-03-16 18:30:26 +01:00
Guillaume Gomez
b9167e6c7d Support type search for arguments and returned types 2020-03-16 18:29:19 +01:00
Guillaume Gomez
1244ced958 Remove "important traits" feature 2020-02-27 14:51:22 +01:00
bors
8ba3ca0e6b Auto merge of #68668 - GuillaumeGomez:struct-variant-field-search, r=ollie27
Struct variant field search

Fixes #16017.

Reopening of #64724.

cc @tomjakubowski
cc @ollie27

r? @kinnison
2020-02-15 22:32:51 +00:00
Tom Jakubowski
05c6f329e7 rustdoc: emit JS paths for struct-like variants
On the backend, rustdoc now emits `paths` entries to a crate's search
index for struct-like enum variants, and index items of type structfield
which belong to such variants point to their variant parents in the
`paths` table, rather than their enum grandparents.  The path entry for
a variant is the fully qualified module path plus the enum name.

On the frontend, the search code recognizes structfields belonging to
structlike variants in the `paths` table and re-constructs the URL to
the field's anchor on the enum documentation page.

closes #16017
2020-01-30 13:39:01 +01:00
Guillaume Gomez
0754461e02 Fix null synthetic_implementors error 2020-01-28 23:32:29 +01:00
Guillaume Gomez
12882a8392 Remove usage of global variable "inlined_types" 2020-01-20 13:34:44 +01:00
Oliver Middleton
79f59fa820 rustdoc: HTML escape arrows on help popup 2020-01-12 23:37:47 +00:00
Guillaume Gomez
71ff18fb89 Fix invalid results showing back 2019-12-22 15:42:29 +01:00
Guillaume Gomez
b67701347a Improve code readability 2019-12-22 15:42:10 +01:00
Guillaume Gomez
4ce2384501 Improve JS code a bit by avoid erasing all event handlers 2019-12-22 14:14:37 +01:00
Guillaume Gomez
5f68732b04 Fix JS error when loading page with search 2019-12-15 21:27:25 +01:00
Guillaume Gomez
5748b4ce95 Add missing check 2019-12-02 10:25:36 +01:00
Mazdak Farrokhzad
4bd9168d7f
Rollup merge of #66514 - GuillaumeGomez:fix-search-filter-save, r=kinnison
Fix selected crate search filter

Fixes #62929.

r? @kinnison
2019-11-20 18:32:10 +01:00
Mazdak Farrokhzad
00cbc75c74
Rollup merge of #66298 - Ppjet6:disable-search-field, r=GuillaumeGomez
rustdoc: fixes #64305: disable search field instead of hidding it

The result seems to be ok but I wasn't entirely sure how to get there. I tried to stay generic a bit but maybe it's not required at all.

@GuillaumeGomez

Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-11-20 18:32:06 +01:00
Maxime “pep” Buquet
5cbd406a14 rustdoc: fixes #64305: disable search field instead of hidding it
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
2019-11-20 11:32:58 +01:00
Mazdak Farrokhzad
95b9766e0a
Rollup merge of #66430 - dns2utf8:fix_code_selection_click_handler, r=GuillaumeGomez
[doc] Fix the source code highlighting on source comments

The code would always forget the previous selection.

r? @GuillaumeGomez
2019-11-19 13:10:15 +01:00
Guillaume Gomez
00ef5c1b98 Fix selected crate search filter 2019-11-18 14:15:00 +01:00
Stefan Schindler
1bbb8168ec Prevent jumps when selecting one or many lines 2019-11-15 02:30:44 +01:00
Stefan Schindler
71cf364c3c Fix the source code highlighting on source comments 2019-11-15 02:02:09 +01:00
Stefan Schindler
cee0403b5c Code cleanup to remove douplacte var definition
Also move the declaration outside the loop since they accumulate state with each iteration
2019-11-15 00:45:08 +01:00
Stefan Schindler
e3afe6ac23 Remove unused argument 2019-11-15 00:27:53 +01:00
Yuki Okushi
392ebad5c6
Rollup merge of #66123 - GuillaumeGomez:no-more-hidden-elements, r=Dylan-DPC
No more hidden elements

Fixes #66046.

Follow-up of #66082.

r? @kinnison
2019-11-08 13:42:19 +09:00
Mazdak Farrokhzad
59e79ff137
Rollup merge of #64696 - GuillaumeGomez:rustdoc-sub-settings, r=kinnison
[rustdoc] add sub settings

This PR is to give a finer control over what types are automatically expanded or not as well as the possibility to add sub-settings in the settings page.

![Screenshot from 2019-09-23 00-46-14](https://user-images.githubusercontent.com/3050060/65395521-15aff300-dd9c-11e9-9437-429ca347d455.png)

r? @Mark-Simulacrum
2019-11-07 14:27:21 +01:00
Guillaume Gomez
d4527b7e00 Only call onHashChange instead of both functions 2019-11-07 10:39:53 +01:00
Guillaume Gomez
24e093c5c3 Remove old isHidden function 2019-11-07 10:13:44 +01:00
Guillaume Gomez
f66a331335 When a URL hash refers to a hidden element, it makes the element visible 2019-11-06 10:10:56 +01:00
Guillaume Gomez
1c78af7de2 clean highlightSourceLines code 2019-11-04 13:28:50 +01:00
bors
0d5264a03c Auto merge of #65780 - GuillaumeGomez:move-help-popup-generation-code, r=Mark-Simulacrum
Move help popup generation code

The first commit is just a small cleanup.

The idea behind this PR is to reduce a bit more the generated HTML files by moving the duplicated code into one place instead.

r? @kinnison
2019-11-03 21:55:48 +00:00
Tyler Mandry
c4960c2602
Rollup merge of #65741 - GuillaumeGomez:help-popup, r=Dylan-DPC
Prevent help popup to disappear when clicking on it

Fixes #65736.

r? @kinnison
2019-10-29 12:01:37 -07:00
Guillaume Gomez
79956b96e8 add sub settings in rustdoc 2019-10-29 13:54:11 +01:00
Guillaume Gomez
91ef9600db reduce size of generated HTML files by moving the popup helper code to the JS 2019-10-27 11:42:38 +01:00
Guillaume Gomez
1d2808341a Cleanup search element getter 2019-10-27 11:40:47 +01:00
Guillaume Gomez
863796be7d Improve help popup detection 2019-10-25 13:43:25 +02:00
Guillaume Gomez
e836b1b9d0 Prevent help popup to disappear when clicking on it 2019-10-24 22:52:54 +02:00
Guillaume Gomez
01a1bcb7f9 Fix default "disable-shortcuts" feature value 2019-10-24 00:25:04 +02:00
Guillaume Gomez
87744841c8 Add option to disable keyboard shortcuts in docs 2019-10-21 11:36:52 +02:00
Mazdak Farrokhzad
f7ee13040b
Rollup merge of #64312 - GuillaumeGomez:rustdoc-better-esc-handling, r=Mark-Simulacrum
Unify escape usage

Fixes #63443.

I chose to keep the search text when pressing escape so when we focus on the search bar, we got the results again without needing to load them again. I also unified a bit a few things (maybe I should have done it in another commit, sorry...).

r? @Mark-Simulacrum
2019-09-09 17:42:29 +02:00
Guillaume Gomez
0d34fe42f7 Unify escape usage 2019-09-09 17:04:28 +02:00
Mazdak Farrokhzad
ab75a1713a
Rollup merge of #64094 - kawa-yoiko:rustdoc-search, r=GuillaumeGomez
Improve searching in rustdoc and add tests

👋 I have made searching in rustdoc more intuitive, added a couple more tests and made a little shell script to aid testing. Closes #63005.

It took me quite a while to figure out how to run the tests for rustdoc (instead of running tests for other crates with rustdoc); the only pointer I found was [hidden in the rustc book](https://rust-lang.github.io/rustc-guide/rustdoc.html#cheat-sheet). Maybe this could be better documented? I shall be delighted to help if it is desirable.
2019-09-06 09:36:38 +02:00
Mazdak Farrokhzad
6da74a2605
Rollup merge of #63774 - chocol4te:fix_63707, r=GuillaumeGomez
Fix `window.hashchange is not a function`

Closes #63707.
2019-09-05 12:11:05 +02:00
Shiqing
cb84aa4744 Improve searching in rustdoc and add tests 2019-09-04 21:27:13 +08:00
Mazdak Farrokhzad
1ea8fc587c
Rollup merge of #62734 - GuillaumeGomez:hide-default-methods, r=Mark-Simulacrum
Hide trait default methods

Fixes #62499.

However, the question remains: do we want to extend it to this point or not?

r? @QuietMisdreavus
2019-08-29 17:13:57 +02:00
bors
0414dfa0aa Auto merge of #62941 - GuillaumeGomez:save-crate-filter, r=Mark-Simulacrum
Save crate filtering on rustdoc

Fixes #62929.

I added a hashmap and a hash encoding for the current crate list in case you have multiple crates handling on a same website (who talked about docs.rs?!). Like that, for each context, you have the filter crate selected.

r? @QuietMisdreavus
2019-08-28 21:42:52 +00:00
Guillaume Gomez
06228d33ca Save crate filtering on rustdoc 2019-08-28 11:56:21 +02:00
Guillaume Gomez
3375b05cd0 Fix confusion in theme picker functions 2019-08-21 13:10:06 +02:00
Ferdia McKeogh
5a446c1ea9
Fix window.hashchange is not a function 2019-08-21 09:13:51 +01:00
Guillaume Gomez
cb873c5a87 code formatting 2019-07-16 18:32:40 +02:00