summary refs log tree commit diff
path: root/src/librustdoc/html/static/main.js
AgeCommit message (Collapse)AuthorLines
2019-01-15Rollup merge of #57614 - GuillaumeGomez:fix-crate-filtering, r=QuietMisdreavusMazdak Farrokhzad-1/+1
[rustdoc] Fix crates filtering box not being filled Currently, the filter crate box (at the left of the search input) is always empty. To get the number of keys of dictionary in JS, you need to call `Object.keys()` on it. r? @QuietMisdreavus
2019-01-15Fix crates filtering box not being filledGuillaume Gomez-1/+1
2019-01-13Rollup merge of #56874 - JohnHeitmann:docs-spacing, r=GuillaumeGomezMazdak Farrokhzad-1/+10
Simplify foreign type rendering. Simplified foreign type rendering by switching from tables to flexbox. Also, removed some seemingly extraneous elements like “ghost” spans. Reduces element count on the `std::iter::Iterator` page by 30%. On my laptop it drops Iterator page load time from ~15s to ~10s. Frame times during scrolling are a hair lower too. Known visual changes (happy to tweak based on feedback): * The main `impl ...` headers are now getting the default, larger, h3 font size. This was an accident, but I liked how it turned out so I didn't fix it. * There's a hair less vertical spacing between the end of a where block and the start of the next fn. Now, all spacing is consistent. I think this looks a bit worse. I may tweak vertical spacing more here or in a follow-up that cleans up vertical spacing more broadly. * "[src]" links are all sized at 17px. A few were 19px in the original. I haven't yet done heavy cross-browser or cross-crate testing. I was hoping to get a quick thumbs up or thumbs down here at this first draft, then if this is on the right track I'll spend some time on that testing. TODO: - [x] Test on Chrome - [x] Test on Firefox - [ ] ~~Test on UC Android~~ - [x] Test on Edge - [x] Test on iOS safari - [x] Test on desktop safari - [x] Update automated tests - [x] Increase vertical margin - [x] Fix "Important traits for" hover overlap - [x] Wait for #55798 to land & merge it
2018-12-29Auto merge of #57006 - GuillaumeGomez:no-crate-filter, r=QuietMisdreavusbors-3/+5
Add no-crate filter option on rustdoc @onur asked me about it so here it is! r? @QuietMisdreavus
2018-12-27Simplify foreign type rendering.John Heitmann-1/+10
Simplified foreign type rendering by switching from tables to flexbox. Also, removed some seemingly extraneous elements like “ghost” spans. Reduces element count on std::iter::Iterator by 30%.
2018-12-25Remove licensesMark Rousskov-12/+0
2018-12-24Add no-crate filter option on rustdocGuillaume Gomez-3/+5
2018-12-16Fix js errorsGuillaume Gomez-2/+2
2018-12-06Show 'loading content' when loading contentGuillaume Gomez-4/+9
2018-12-06cleanupGuillaume Gomez-57/+37
2018-12-06Prevent lazy iterations over DOMGuillaume Gomez-105/+99
2018-12-06Greatly improve rustdoc rendering speed issuesGuillaume Gomez-497/+587
2018-12-06Rollup merge of #56332 - GuillaumeGomez:specifi-crate-search, r=QuietMisdreavusPietro Albini-16/+83
[rustdoc] Specific crate search Reopening of #54706. Fixes #54616. <img width="1440" alt="screenshot 2018-11-29 at 01 29 11" src="https://user-images.githubusercontent.com/3050060/49191372-979adf80-f376-11e8-963e-e4feb927c1da.png"> r? @QuietMisdreavus
2018-12-05Rollup merge of #56523 - JohnHeitmann:es6, r=GuillaumeGomezPietro Albini-2/+6
Added a bare-bones eslint config (removing jslint) This change removes the small bit of jslint config, replacing it with eslint. I've currently configured eslint to mostly only report the more serious of lints, although there are still some style nits turned on. Eslint better supports modern js, and will be a good pre-TypeScript code quality aid. Install eslint with `npm install -g eslint`. Run with `eslint html/static/*.js`, or let your IDE do it. This requires no build step. Upcoming changes will start fixing identified bugs and other lints (mostly unused and var redef issues).
2018-12-05Rollup merge of #55563 - GuillaumeGomez:doc-search-sentence, r=QuietMisdreavusPietro Albini-1/+10
Improve no result found sentence in doc search Fixes #55531. Look: <img width="1440" alt="screenshot 2018-11-01 at 02 21 56" src="https://user-images.githubusercontent.com/3050060/47827257-f6236c80-dd7c-11e8-9ea9-99c8cb4b2de5.png"> r? @QuietMisdreavus
2018-12-04Added a bare-bones eslint config (removing jslint)John Heitmann-2/+6
This change removes the small bit of jslint config, replacing it with eslint. I've currently configured eslint to mostly only report the more serious of lints, although there are still some style nits turned on. Upcoming changes will start fixing lints.
2018-11-28Add crate filteringGuillaume Gomez-16/+83
2018-11-24Add source file sidebarGuillaume Gomez-53/+13
2018-11-21Improve no result found sentence in doc searchGuillaume Gomez-1/+10
2018-11-10Small fixes on code blocks in rustdocGuillaume Gomez-4/+4
2018-11-03Rollup merge of #54162 - GuillaumeGomez:hide-default-impls-items, ↵Guillaume Gomez-0/+44
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-10-30Fix invalid "expand description" displayGuillaume Gomez-8/+9
2018-10-29Rollup merge of #55440 - xfix:patch-11, r=GuillaumeGomezPietro Albini-5/+0
Remove unreachable code in hasClass function in Rustdoc
2018-10-28Remove unreachable code in hasClass function in RustdocKonrad Borowski-5/+0
2018-10-27Fix sub-variant doc displayGuillaume Gomez-7/+10
2018-10-22Fix multiple errorsGuillaume Gomez-4/+14
2018-10-21Fix script to avoid displaying unnecessary itemsGuillaume Gomez-4/+8
2018-10-21Hide items if they use default docsGuillaume Gomez-0/+30
2018-10-09Add line numbers option to rustdocGuillaume Gomez-9/+33
2018-09-29Rollup merge of #54577 - QuietMisdreavus:docs-for-procs, r=GuillaumeGomezkennytm-1/+4
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-25handle proc-macros as macros instead of functionsQuietMisdreavus-1/+4
2018-09-24Fix JS errorGuillaume Gomez-2/+5
2018-09-14Auto merge of #52962 - GuillaumeGomez:few-things, r=QuietMisdreavusbors-9/+34
Fix trait item doc setting, add new setting, start hiding elements by default and then showing them up r? @QuietMisdreavus
2018-09-12Auto merge of #53409 - GuillaumeGomez:associated-const-value, r=QuietMisdreavusbors-4/+3
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-06Fix implementors generation as wellGuillaume Gomez-3/+6
2018-09-05Apply method docs collapse to all impl-items sectionsGuillaume Gomez-1/+3
2018-08-27Fix source automatic scrollGuillaume Gomez-0/+1
2018-08-26Rollup merge of #53626 - kzys:hashchange, r=GuillaumeGomezGuillaume Gomez-16/+36
Automatically expand a section even after page load Fixes #52774
2018-08-25Add collapser for associated constGuillaume Gomez-4/+3
2018-08-25Expand a collapsed element on onclickKazuyoshi Kato-16/+21
Doing the expansion on onhashchange seems too late. Fixes #48726
2018-08-25Auto merge of #53577 - GuillaumeGomez:rustdoc-substring-search, ↵bors-10/+10
r=QuietMisdreavus Search a substring instead of start of string in rustdoc search Fixes #49762. r? @QuietMisdreavus
2018-08-23Check null-able variables before using themKazuyoshi Kato-3/+2
2018-08-23Automatically expand a section even after page loadKazuyoshi Kato-16/+32
Fixes #52774
2018-08-22Search a substring instead of start of string in rustdoc searchGuillaume Gomez-10/+10
2018-08-15restore the page title after escaping out of a searchJack O'Connor-0/+3
2018-08-10Remove unwanted console logGuillaume Gomez-1/+0
2018-08-05Automatically expand section if url id point to one of its componentGuillaume Gomez-0/+19
2018-08-02Fix trait item doc setting, add new setting, start hiding elements by ↵Guillaume Gomez-9/+32
default and then showing them up
2018-07-19Auto merge of #51854 - davidtwco:rfc-2008-rustdoc, r=QuietMisdreavusbors-3/+20
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-18Updated wording and placement of non-exhaustive notice so it is collapsed by ↵David Wood-3/+20
default and easier to understand.