Commit Graph

276 Commits

Author SHA1 Message Date
Guillaume Gomez
93520d2ad1 Add source file sidebar 2018-11-24 09:49:57 +01:00
Guillaume Gomez
0edc9e8395 Small fixes on code blocks in rustdoc 2018-11-10 21:58:47 +01:00
Guillaume Gomez
336b02347f
Rollup merge of #54162 - GuillaumeGomez:hide-default-impls-items, r=QuietMisdreavus
Hide default impls items

Follow up of #51885.
Fixes #54025.

cc @Mark-Simulacrum

r? @QuietMisdreavus

And screenshots of course:

<img width="1440" alt="screen shot 2018-09-12 at 23 30 35" src="https://user-images.githubusercontent.com/3050060/45454424-1ff8d500-b6e4-11e8-9257-030322495d58.png">

<img width="1440" alt="screen shot 2018-09-12 at 23 30 42" src="https://user-images.githubusercontent.com/3050060/45454431-2424f280-b6e4-11e8-8d65-db0d85ac18f0.png">
2018-11-03 13:40:32 +01:00
Guillaume Gomez
f55e986a71 Fix invalid "expand description" display 2018-10-30 10:18:51 +01:00
Pietro Albini
9786d98056
Rollup merge of #55440 - xfix:patch-11, r=GuillaumeGomez
Remove unreachable code in hasClass function in Rustdoc
2018-10-29 09:47:51 +01:00
Konrad Borowski
b7c2b471cf
Remove unreachable code in hasClass function in Rustdoc 2018-10-28 12:12:29 +01:00
Guillaume Gomez
2fd378b82b Fix sub-variant doc display 2018-10-27 14:05:34 +02:00
Guillaume Gomez
b2f80ddf34 Fix multiple errors 2018-10-22 00:43:23 +02:00
Guillaume Gomez
9d8de1e30a Fix script to avoid displaying unnecessary items 2018-10-21 19:22:21 +02:00
Guillaume Gomez
edec5807ac Hide items if they use default docs 2018-10-21 18:28:27 +02:00
Guillaume Gomez
e961d397ca Add line numbers option to rustdoc 2018-10-09 22:55:18 +02:00
kennytm
def5f84fa6
Rollup merge of #54577 - QuietMisdreavus:docs-for-procs, r=GuillaumeGomez
rustdoc: give proc-macros their own pages

related to https://github.com/rust-lang/rust/issues/49553 but i don't think it'll fix it

Currently, rustdoc doesn't expose proc-macros all that well. In the source crate, only their definition function is exposed, but when re-exported, they're treated as a macro! This is an awkward situation in all accounts. This PR checks functions to see whether they have any of `#[proc_macro]`, `#[proc_macro_attribute]`, or `#[proc_macro_derive]`, and exposes them as macros instead. In addition, attributes and derives are exposed differently than other macros, getting their own item-type, CSS class, and module heading.

![image](https://user-images.githubusercontent.com/5217170/46044803-6df8da00-c0e1-11e8-8c3b-25d2c3beb55c.png)

Function-like proc-macros are lumped in with `macro_rules!` macros, but they get a different declaration block (i'm open to tweaking this, it's just what i thought of given how function-proc-macros operate):

![image](https://user-images.githubusercontent.com/5217170/46044828-84069a80-c0e1-11e8-9cc4-127e5477c395.png)

Proc-macro attributes and derives get their own pages, with a representative declaration block. Derive macros also show off their helper attributes:

![image](https://user-images.githubusercontent.com/5217170/46094583-ef9f4500-c17f-11e8-8f71-fa0a7895c9f6.png)

![image](https://user-images.githubusercontent.com/5217170/46101529-cab3cd80-c191-11e8-857a-946897750da1.png)

There's one wrinkle which this PR doesn't address, which is why i didn't mark this as fixing the linked issue. Currently, proc-macros don't expose their attributes or source span across crates, so while rustdoc knows they exist, that's about all the information it gets. This leads to an "inlined" macro that has absolutely no docs on it, and no `[src]` link to show you where it was declared.

The way i got around it was to keep proc-macro re-export disabled, since we do get enough information across crates to properly link to the source page:

![image](https://user-images.githubusercontent.com/5217170/46045074-2cb4fa00-c0e2-11e8-81bc-33a8205fbd03.png)

Until we can get a proc-macro's docs (and ideally also its source span) across crates, i believe this is the best way forward.
2018-09-29 16:46:30 +08:00
QuietMisdreavus
aea1bd0a59 handle proc-macros as macros instead of functions 2018-09-25 14:56:43 -05:00
Guillaume Gomez
827047c18b Fix JS error 2018-09-24 22:05:12 +02:00
bors
e7f1880921 Auto merge of #52962 - GuillaumeGomez:few-things, r=QuietMisdreavus
Fix trait item doc setting, add new setting, start hiding elements by default and then showing them up

r? @QuietMisdreavus
2018-09-14 01:07:21 +00:00
bors
f2302daef3 Auto merge of #53409 - GuillaumeGomez:associated-const-value, r=QuietMisdreavus
Don't show associated const value anymore

Part of #44348.

Before:

<img width="1440" alt="screen shot 2018-08-16 at 00 48 30" src="https://user-images.githubusercontent.com/3050060/44177414-20ef1480-a0ee-11e8-80d4-7caf082cf0de.png">

After:

<img width="1440" alt="screen shot 2018-08-16 at 00 48 23" src="https://user-images.githubusercontent.com/3050060/44177417-251b3200-a0ee-11e8-956a-4229275e3342.png">

cc @nox

r? @QuietMisdreavus
2018-09-12 21:20:05 +00:00
Guillaume Gomez
1b3382f2b9 Fix implementors generation as well 2018-09-06 23:32:30 +02:00
Guillaume Gomez
e1ec05584c Apply method docs collapse to all impl-items sections 2018-09-05 23:25:28 +02:00
Guillaume Gomez
1d79d8be56 Fix source automatic scroll 2018-08-27 21:51:56 +02:00
Guillaume Gomez
9c20f06f73
Rollup merge of #53626 - kzys:hashchange, r=GuillaumeGomez
Automatically expand a section even after page load

Fixes #52774
2018-08-26 12:05:25 +02:00
Guillaume Gomez
a00706a3b9 Add collapser for associated const 2018-08-25 15:30:47 +02:00
Kazuyoshi Kato
2c61f3ce9e Expand a collapsed element on onclick
Doing the expansion on onhashchange seems too late.

Fixes #48726
2018-08-25 03:36:17 -07:00
bors
f87d9135b4 Auto merge of #53577 - GuillaumeGomez:rustdoc-substring-search, r=QuietMisdreavus
Search a substring instead of start of string in rustdoc search

Fixes #49762.

r? @QuietMisdreavus
2018-08-25 02:40:14 +00:00
Kazuyoshi Kato
1f441a0905 Check null-able variables before using them 2018-08-23 08:15:23 -07:00
Kazuyoshi Kato
917cdd295d Automatically expand a section even after page load
Fixes #52774
2018-08-23 00:45:43 -07:00
Guillaume Gomez
e87b4b3100 Search a substring instead of start of string in rustdoc search 2018-08-22 00:21:08 +02:00
Jack O'Connor
207550981f restore the page title after escaping out of a search 2018-08-15 23:05:52 -04:00
Guillaume Gomez
e37391b389 Remove unwanted console log 2018-08-10 18:48:36 +02:00
Guillaume Gomez
c70eb4b6ea Automatically expand section if url id point to one of its component 2018-08-05 19:44:10 +02:00
Guillaume Gomez
2462cdb71d Fix trait item doc setting, add new setting, start hiding elements by default and then showing them up 2018-08-02 00:19:04 +02:00
bors
11864c4e6c Auto merge of #51854 - davidtwco:rfc-2008-rustdoc, r=QuietMisdreavus
RFC 2008 non-exhaustive enums/structs: Rustdoc

Part of #44109. Not sure how those who maintain rustdoc primarily would prefer this addition look or where it should be placed, happy to make any changes required.

r? @QuietMisdreavus (not sure if this is the right person, just guessing)
2018-07-19 19:03:03 +00:00
David Wood
959a13d53e
Updated wording and placement of non-exhaustive notice so it is collapsed by default and easier to understand. 2018-07-18 20:27:25 +01:00
Guillaume Gomez
c0ec5d5e44 Add setting to prevent doc auto-hide of trait implementations 2018-07-08 15:07:06 +02:00
Guillaume Gomez
115df57757 reduce search-index size 2018-06-30 16:28:25 +02:00
Guillaume Gomez
e3b258324b Remove unused variable 2018-06-25 21:47:44 +02:00
Guillaume Gomez
f4ea46a5b3 Extend collision prevention to every type 2018-06-18 21:39:54 +02:00
Guillaume Gomez
afeb790ea1 Fix macro missing from doc search 2018-06-16 14:14:18 +02:00
Guillaume Gomez
e28502edca Fix search fn keyword 2018-06-15 23:23:25 +02:00
kennytm
ca65a5e485
Don't auto-hide inherent impls even if rustdoc-collapse == true. 2018-06-13 18:00:18 +08:00
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