about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2021-04-13Further consolidate search-related vars and funcsJacob Hoffman-Andrews-76/+61
2021-04-13Consolidate search-related vars and functions.Jacob Hoffman-Andrews-175/+167
This allows sharing across main.js and search.js without exporting too many symbols into the global namespace.
2021-04-12Move search JS into search-index.jsJacob Hoffman-Andrews-1524/+1534
Export a few variables and functions into the global scope because they are needed both by main.js and search-index.js.
2021-04-12+ignore-tidy-filelengthManish Goregaokar-1/+2
2021-04-12Move color to themesManish Goregaokar-5/+9
2021-04-12& -> &&Manish Goregaokar-2/+2
2021-04-12Wrap toggle_open()Manish Goregaokar-1/+4
2021-04-12should_hide_fields > 12Manish Goregaokar-2/+1
2021-04-12Add css classesManish Goregaokar-12/+12
2021-04-12Improve CSS for "hide contents, not items"Jacob Hoffman-Andrews-130/+116
Introduce a first use of the `<details>` and `<summary>` tags as replacements for the JS-built toggles. I think this has the potential to replace all the JS toggles and generally clean up the JS, CSS, and HTML. Split rendering of attributes into two cases: in the case where they are rendered as descendents of a `<pre>` tag, where they use indent spaces and newlines for formatting, matching their surrounding markup. In the case where they are rendered as descendants of a `<code>` tag, they are rendered as `<div>`. This let me clean up some fragile CSS that was adjusting the margin-left of attributes depending on context. Remove toggles for attributes. With the ALLOWED_ATTRIBUTES filter, it's rare for an item to have more than one attribute, so hiding attributes behind a toggle doesn't save any screen space in the common case. Fix a couple of invocations of `matches!` that didn't compile on my machine. Fix a boolean for the JS `createToggle` call that was causing "Expand description" to show up spuriously on already-expanded descriptions. Add JS for auto-hide settings and hide all / show all. Remove a z-index property and some font color tweaks made unnecessary by the <details> toggles. Add CSS for the <details> toggles.
2021-04-12Update src/librustdoc/html/render/print_item.rsManish Goregaokar-1/+1
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-04-12Update src/librustdoc/html/render/print_item.rsManish Goregaokar-1/+1
Co-authored-by: Joshua Nelson <joshua@yottadb.com>
2021-04-12rustdoc: Add setting for hiding large itemsManish Goregaokar-1/+6
2021-04-12rustdoc: smartly hide associated items of traits if there are too many of themManish Goregaokar-12/+30
2021-04-12rustdoc: hide fields of structs/unions > 5Manish Goregaokar-8/+31
2021-04-12rustdoc: hide variants of enums > 5Manish Goregaokar-7/+34
2021-04-12rustdoc: Stop hiding entire item declarationsManish Goregaokar-33/+5
2021-04-10rustdoc: clean up and test macro visibility printMichael Howell-10/+38
This fixes the overly-complex invariant mentioned in <https://github.com/rust-lang/rust/pull/83237#issuecomment-815346570>, where the macro source can't have any links in it only because the cache hasn't been populated yet.
2021-04-08Add test for idents mergeGuillaume Gomez-0/+20
2021-04-08Merge idents if they are part of a pathGuillaume Gomez-18/+107
2021-04-06Rollup merge of #82963 - camelid:move-sharedcontext, r=GuillaumeGomezDylan DPC-83/+77
Move `SharedContext` to `context.rs` It is tightly connected to `Context` and is primarily used as a field in `Context`. Thus, it should be next to `Context`.
2021-04-05Move `SharedContext` to `context.rs`Camelid-83/+77
It is tightly connected to `Context` and is primarily used as a field in `Context`. Thus, it should be next to `Context`.
2021-04-06Rollup merge of #83835 - notriddle:sort-index, r=ollie27Yuki Okushi-9/+23
rustdoc: sort search index items for compression This should not affect the appearance of the docs pages themselves. This makes the pre-compressed search index smaller, thanks to the empty-string path duplication format, and also the gzipped version, by giving the algorithm more structure to work with. rust$ wc -c search-index-old.js search-index-new.js 2628334 search-index-old.js 2586181 search-index-new.js 5214515 total rust$ gzip search-index-* rust$ wc -c search-index-old.js.gz search-index-new.js.gz 239486 search-index-old.js.gz 237386 search-index-new.js.gz 476872 total
2021-04-05Rollup merge of #83826 - slightlyoutofphase:rustdoc-sidebar-order-shuffle, ↵Dylan DPC-7/+8
r=jyn514 List trait impls before deref methods in doc's sidebar This PR is acting directly on a suggestion made by ```````@jyn514``````` in #83133. I've tested the changes locally, and can confirm that it does in fact properly achieve what he thought it would. This PR also in turn closes #83133.
2021-04-05Update Source Serif to release 4.004Trevor Spiteri-30/+29
Now the family name is Source Serif 4 (upstream issue 77) instead of Source Serif Pro.
2021-04-05Rollup merge of #83717 - notriddle:main-js-slice-loop, r=GuillaumeGomezDylan DPC-9/+12
rustdoc: Separate filter-empty-string out into its own function
2021-04-04Get rid of unneeded `aliases` fieldMichael Howell-2/+6
2021-04-04Rollup merge of #83809 - GuillaumeGomez:remove-initial-ids, r=camelidDylan DPC-29/+11
Remove unneeded INITIAL_IDS const Some IDs inside this map didn't exist anymore, some others were duplicates of what we have inside `IdMap`. So instead of keeping the two around and since `INITIAL_IDS` was only used by `IdMap`, no need to keep both of them.
2021-04-04Rollup merge of #83793 - notriddle:single-span-macro-highlight, r=GuillaumeGomezDylan DPC-6/+10
rustdoc: highlight macros more efficiently Instead of producing `<span class=macro>assert_eq</span><span class=macro>!</span>`, just produce `<span class=macro>assert_eq!</span>`.
2021-04-03rustdoc: sort search index items for compressionMichael Howell-7/+17
This should not affect the appearance of the docs pages themselves. This makes the pre-compressed search index smaller, thanks to the empty-string path duplication format, and also the gzipped version, by giving the algorithm more structure to work with. rust$ wc -c search-index-old.js search-index-new.js 2628334 search-index-old.js 2586181 search-index-new.js 5214515 total rust$ gzip search-index-* rust$ wc -c search-index-old.js.gz search-index-new.js.gz 239486 search-index-old.js.gz 237386 search-index-new.js.gz 476872 total
2021-04-03Remove unneeded INITIAL_IDS constGuillaume Gomez-29/+11
2021-04-03Remove trailing whitespaceSlightlyOutOfPhase-1/+1
2021-04-03List trait impls before methods from deref in the sidebar of Rustdoc's outputSlightlyOutOfPhase-7/+8
2021-04-04Rollup merge of #83756 - camelid:internal-rename-doc-spotlight, r=GuillaumeGomezYuki Okushi-15/+14
rustdoc: Rename internal uses of `spotlight` I didn't make these renames in #80965 because I didn't want the PR to conflict with #80914.
2021-04-02rustdoc: update macro highlight testsMichael Howell-4/+4
2021-04-02rustdoc: highlight macros more efficientlyMichael Howell-2/+6
Instead of producing `<span class=macro>assert_eq</span><span class=macro>!</span>`, just produce `<span class=macro>assert_eq!</span>`.
2021-04-02rustdoc: Remove unused `spotlight` CSSCamelid-4/+1
I couldn't find any uses of this CSS. I think it was superseded by the `.notable-traits` CSS class and other similarly-named CSS classes.
2021-04-02rustdoc: Rename internal uses of `spotlight`Camelid-11/+13
I didn't make these renames in #80965 because I didn't want the PR to conflict with #80914.
2021-04-02Rollup merge of #83478 - jyn514:fine-grained-files, r=Mark-SimulacrumDylan DPC-134/+178
rustdoc: Add unstable option to only emit shared/crate-specific files The intended use case is for docs.rs, which can now copy exactly the files it cares about, rather than having to guess based on whether they have a resource suffix or not. In particular, some files have a resource suffix but cannot be shared between crates: https://github.com/rust-lang/docs.rs/pull/1312#issuecomment-798783688 The end goal is to fix rust-lang/docs.rs#1327 by reverting rust-lang/docs.rs#1324. This obsoletes `--print=unversioned-files`, which I plan to remove as soon as docs.rs stops using it. I recommend reviewing this one commit at a time. r? ``@GuillaumeGomez`` cc ``@Nemo157`` ``@pietroalbini``
2021-04-02Rollup merge of #83721 - GuillaumeGomez:copy-use, r=Nemo157Yuki Okushi-13/+57
Add a button to copy the "use statement" Fixes https://github.com/rust-lang/rust/issues/50239 When clicking on the button, it'll add the elements prepended by "use " and will end with a ";". So in the images below, I now have in my clipboard `use std::fs::OpenOptions;`. A screenshot of the newly added button: ![Screenshot from 2021-03-31 22-12-12](https://user-images.githubusercontent.com/3050060/113205430-90e64500-926e-11eb-8538-529829f611ec.png) A screenshot after it was clicked: ![Screenshot from 2021-03-31 22-15-31](https://user-images.githubusercontent.com/3050060/113205532-ad827d00-926e-11eb-893d-35f2f8f92696.png) r? `@Nemo157`
2021-04-01rustdoc: Separate filter-empty-string out into its own functionMichael Howell-2/+11
2021-03-31Fix `--external-css` to be invocation-specific and note main.js should be ↵Joshua Nelson-1/+10
invocation specific
2021-03-31Add a button to copy the "use statement"Guillaume Gomez-13/+57
2021-03-31rustdoc: use Array.prototype.filter instead of open-coding itMichael Howell-8/+2
2021-03-31Rename CrateSpecific -> InvocationSpecificJoshua Nelson-7/+7
2021-03-31Enforce that Toolchain files are static and Crate files are dynamicJoshua Nelson-28/+35
This also changes custom themes from Toolchain to Crate files.
2021-03-30Rollup merge of #83645 - pickfire:patch-3, r=GuillaumeGomezDylan DPC-1/+3
Wrap non-pre code blocks Fix #83550 regression ``` $ cargo new --lib whitespace && cd whitespace && echo '//! `" foo "`' > src/lib.rs && cargo doc --open ``` Before ![](https://user-images.githubusercontent.com/89623/112713498-c0dfc200-8ed5-11eb-8c57-efdf26372e74.png) After ![](https://user-images.githubusercontent.com/89623/112713538-f08eca00-8ed5-11eb-8a98-675179f60ae2.png) r? ``@GuillaumeGomez`` cc ``@mgeisler``
2021-03-30Rollup merge of #83543 - camelid:lint-unknown-disambiguator, r=jyn514Dylan DPC-0/+1
Lint on unknown intra-doc link disambiguators
2021-03-29Wrap non-pre code blocksIvan Tham-1/+3
Fix #83550 regression
2021-03-28Point to disambiguator instead of whole linkCamelid-0/+1
And, now that we do that, we can remove the explanatory note since the error span should make it clear what the disambiguator is.