summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2018-10-29Remove redundant cloneShotaro Yamada-4/+4
2018-10-21improve search tabs lookGuillaume Gomez-23/+14
2018-10-19Prefer `Default::default` over `FxHash*::default` in struct constructorsOliver Scherer-10/+10
2018-10-19Deprecate the `FxHashMap()` and `FxHashSet()` constructor function hackOliver Scherer-15/+15
2018-10-18Auto merge of #54349 - GuillaumeGomez:no-example-lint, r=QuietMisdreavusbors-2/+4
[rustdoc] Add lint for doc without codeblocks Fixes #53805. r? @QuietMisdreavus
2018-10-18Rollup merge of #55161 - akxcv:rustdoc/disable-spellcheck, ↵kennytm-0/+1
r=QuietMisdreavus,GuillaumeGomez [librustdoc] Disable spellcheck for search field This disables spellchecking for the search field in the rustdoc web interface. As someone who uses Safari to browse through Rust docs, spellchecking gets really annoying.
2018-10-18Rollup merge of #55080 - thanatos:fix-localstorage-crash, r=GuillaumeGomezkennytm-2/+20
Detect if access to localStorage is forbidden by the user's browser If the user's cookie/persistent storage setting forbid access to `localStorage`, catch the exception and abort the access. Currently, attempting to use the expand/contract links at the top of the page for structs/consts/etc. fails due to an unhandled error while accessing `localStorage`, if such access is forbidden, as the exception from the failed access propagates all the way out, interrupting the expand/contract. Instead, I would like to degrade gracefully; the access won't happen (the collapse/expand state won't get persisted) but the actual expanding/contracting of the item will go on to succeed. Fixes #55079
2018-10-17[librustdoc] Disable spellcheck for search fieldAlexander Komarov-0/+1
2018-10-16Move usableLocalStorage() above functions that make use of itRoy Wellington Ⅳ-15/+15
2018-10-15Extract localStorage tests out into a helper method; use in getCurrentValue()Roy Wellington Ⅳ-8/+20
1. Extract the tests for whether or not we have workable localStorage out into a helper method, so it can be more easily reused 2. Use it in getCurrentValue() too, for the same reasons, as suggested in code review
2018-10-14Detect if access to localStorage is forbidden by the user's browserRoy Wellington Ⅳ-0/+6
If the user's cookie/persistent storage setting forbid access to localStorage, catch the exception and abort the access. Currently, attempting to use the expand/contract links at the top of the page for structs/consts/etc. fails due to an unhandled error while accessing localStorage, if such access is forbidden, as the exception from the failed access propagates all the way out, interrupting the expand/contract. Instead, I would like to degrade gracefully; the access won't happen (the collapse/expand state won't get persisted) but the actual expanding/contracting of the item will go on to succeed. Fixes #55079
2018-10-15rustdoc: Use dyn keyword when rendering dynamic traitsOliver Middleton-0/+3
The dyn keyword has been stable for a while now so rustdoc should start using it.
2018-10-12Rollup merge of #54869 - GuillaumeGomez:fix-mobile-docs, r=QuietMisdreavuskennytm-15/+27
Fix mobile docs Fixes #54836. <img width="1440" alt="screen shot 2018-10-06 at 18 53 19" src="https://user-images.githubusercontent.com/3050060/46573683-1b4cd700-c999-11e8-9e6b-86a23b332e22.png"> r? @QuietMisdreavus
2018-10-12Auto merge of #53933 - GuillaumeGomez:codeblock-error-display, r=QuietMisdreavusbors-7/+18
Improve error display for codeblocks in rustdoc Part of #53919. r? @QuietMisdreavus
2018-10-11Fix mobile doc displayGuillaume Gomez-15/+27
2018-10-09Add lint for doc without codeblocksGuillaume Gomez-2/+4
2018-10-04rustdoc: overflow:auto doesn't work nicely on small screensKazuyoshi Kato-1/+0
This property was introduced by 3f92ff34b5, but looks it doesn't overwrap even without the property. Fixes #54672.
2018-09-29Add a sentence before rustc errorsGuillaume Gomez-1/+1
2018-09-29Improve error display for codeblocks in rustdocGuillaume Gomez-7/+18
2018-09-29Rollup merge of #54577 - QuietMisdreavus:docs-for-procs, r=GuillaumeGomezkennytm-7/+90
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-27show "all items" link even if crate doesn't have a versionQuietMisdreavus-4/+5
2018-09-27add attributes/derives to "all items" pageQuietMisdreavus-0/+8
2018-09-26add derive macros' helper attributes to doc outputQuietMisdreavus-0/+8
2018-09-26add declaration blocks to attribute/derive pagesQuietMisdreavus-4/+18
2018-09-25Rollup merge of #54539 - GuillaumeGomez:fix-js-error, r=QuietMisdreavusPietro Albini-2/+5
Fix js error r? @QuietMisdreavus
2018-09-25Rollup merge of #54368 - GuillaumeGomez:reduce-side-padding, r=QuietMisdreavusPietro Albini-1/+1
Reduce code block sides padding Fixes #42013. <img width="1440" alt="screen shot 2018-09-19 at 22 58 32" src="https://user-images.githubusercontent.com/3050060/45781266-c6525680-bc5f-11e8-8eb0-98fc4c22a96e.png"> r? @QuietMisdreavus
2018-09-25handle proc-macros as macros instead of functionsQuietMisdreavus-3/+55
2018-09-24Fix JS errorGuillaume Gomez-2/+5
2018-09-22Rollup merge of #54350 - Munksgaard:support-edition-in-doc-test, r=steveklabnikPietro Albini-31/+76
Support specifying edition in doc test Fixes #52623 r? @QuietMisdreavus
2018-09-20shuffle ownership of `external_traits`QuietMisdreavus-1/+1
constraints: - clean/inline.rs needs this map to fill in traits when inlining - fold.rs needs this map to allow passes to fold trait items - html/render.rs needs this map to seed the Cache.traits map of all known traits The first two are the real problem, since `DocFolder` only operates on `clean::Crate` but `clean/inline.rs` only sees the `DocContext`. The introduction of early passes means that these two now exist at the same time, so they need to share ownership of the map. Even better, the use of `Crate` in a rustc thread pool means that it needs to be Sync, so it can't use `Lrc<Lock>` to manually activate thread-safety. `parking_lot` is reused from elsewhere in the tree to allow use of its `ReentrantMutex`, as the relevant parts of rustdoc are still single-threaded and this allows for easier use in that context.
2018-09-20refactor: move `access_levels` into RenderInfoQuietMisdreavus-2/+4
2018-09-20don't index trait impls if the trait isn't also documentedQuietMisdreavus-5/+29
2018-09-20add a bunch of debug printsQuietMisdreavus-0/+4
2018-09-20Add a documentation banner for edition specific codePhilip Munksgaard-13/+44
2018-09-19Reduce code block sides paddingGuillaume Gomez-1/+1
2018-09-19Add support for running doc test in specific editionPhilip Munksgaard-18/+32
2018-09-18Rollup merge of #54097 - GuillaumeGomez:remove-keyword-namespace, ↵Guillaume Gomez-2/+2
r=QuietMisdreavus rustdoc: Remove namespace for keywords Fixes #54084. r? @QuietMisdreavus
2018-09-16Rollup merge of #53941 - kzys:sort-impls, r=GuillaumeGomezGuillaume Gomez-4/+20
rustdoc: Sort implementors Fixes #53812
2018-09-14Auto merge of #52962 - GuillaumeGomez:few-things, r=QuietMisdreavusbors-10/+36
Fix trait item doc setting, add new setting, start hiding elements by default and then showing them up r? @QuietMisdreavus
2018-09-12rustdoc: Sort implementorsKazuyoshi Kato-4/+20
Fixes #53812
2018-09-12Auto merge of #53409 - GuillaumeGomez:associated-const-value, r=QuietMisdreavusbors-44/+27
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-10Remove namespace for keywordsGuillaume Gomez-2/+2
2018-09-09rustdoc: Remove generated blanket impls from trait pagesOliver Middleton-14/+12
2018-09-06Don't show default docsGuillaume Gomez-16/+11
2018-09-06Fix implementors generation as wellGuillaume Gomez-3/+6
2018-09-06Fix hover on implsGuillaume Gomez-37/+43
2018-09-05Apply method docs collapse to all impl-items sectionsGuillaume Gomez-1/+3
2018-09-01Rollup merge of #53801 - GuillaumeGomez:duplicated-foreign-type-impls, ↵kennytm-5/+9
r=QuietMisdreavus Prevent duplicated impl on foreign types Fixes #53689. r? @QuietMisdreavus
2018-08-31Auto merge of #51384 - QuietMisdreavus:extern-version, r=GuillaumeGomezbors-2/+14
rustdoc: add flag to control the html_root_url of dependencies The `--extern-html-root-url` flag in this PR allows one to override links to crates whose docs are not already available locally in the doc bundle. Docs.rs currently uses a version of this to make sure links to other crates go into that crate's docs.rs page. See the included test for intended use, but the idea is as follows: Calling rustdoc with `--extern-html-root-url crate=https://some-url.com` will cause rustdoc to override links that point to that crate to instead be replaced with a link rooted at `https://some-url.com/`. (e.g. for docs.rs this would be `https://docs.rs/crate/0.1.0` or the like.) Cheekily, rustup could use these options to redirect links to std/core/etc to instead point to locally-downloaded docs, if it so desired. Fixes https://github.com/rust-lang/rust/issues/19603
2018-08-30Rollup merge of #53806 - GuillaumeGomez:fix-ui-issues-foreign-type-impls, ↵Pietro Albini-0/+11
r=QuietMisdreavus Fix UI issues on Implementations on Foreign types Fixes #53800. <img width="1440" alt="screen shot 2018-08-29 at 22 06 35" src="https://user-images.githubusercontent.com/3050060/44814733-e9986180-abdd-11e8-97e0-0e3c1816ca04.png"> r? @QuietMisdreavus