about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2024-09-02Fix scraped examples background gradientGuillaume Gomez-1/+11
2024-09-01Correctly handle code examples buttons positionGuillaume Gomez-1/+5
2024-09-01Fix position of scraped examples title on mobile devicesGuillaume Gomez-3/+14
2024-09-01Fix wrong rounded corners when line numbers are displayed on code examplesGuillaume Gomez-1/+17
2024-08-31Auto merge of #129831 - matthiaskrgr:rollup-befq6zx, r=matthiaskrgrbors-2/+8
Rollup of 11 pull requests Successful merges: - #128523 (Add release notes for 1.81.0) - #129605 (Add missing `needs-llvm-components` directives for run-make tests that need target-specific codegen) - #129650 (Clean up `library/profiler_builtins/build.rs`) - #129651 (skip stage 0 target check if `BOOTSTRAP_SKIP_TARGET_SANITY` is set) - #129684 (Enable Miri to pass pointers through FFI) - #129762 (Update the `wasm-component-ld` binary dependency) - #129782 (couple more crash tests) - #129816 (tidy: say which feature gate has a stability issue mismatch) - #129818 (make the const-unstable-in-stable error more clear) - #129824 (Fix code examples buttons not appearing on click on mobile) - #129826 (library: Fix typo in `core::mem`) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-31Rollup merge of #129824 - GuillaumeGomez:code-example-buttons-mobile, ↵Matthias Krüger-2/+8
r=notriddle Fix code examples buttons not appearing on click on mobile When browsing docs on mobile today, I realized that the buttons didn't appear when I tapped on the code example. One issue: I have no idea how to add a regression test for this case... r? ``@notriddle``
2024-08-31Fix code examples buttons not appearing on click on mobileGuillaume Gomez-2/+8
2024-08-31Rollup merge of #129774 - nnethercote:rm-extern-crate-tracing-remainder, ↵Matthias Krüger-0/+8
r=GuillaumeGomez Remove `#[macro_use] extern crate tracing` from rustdoc and rustfmt A follow-up to #129767 and earlier PRs doing this for `rustc_*` crates. r? ```@GuillaumeGomez```
2024-08-31Rollup merge of #126183 - Folyd:search-core, r=GuillaumeGomez,notriddleMatthias Krüger-2277/+2316
Separate core search logic with search ui Currenty, the `search.js` mixed with UI/DOM manipulation codes and search logic codes, I propose to extract the search logic to a class for following benefits: - Clean code. Separation of DOM manipulation and search logic can lead better code maintainability and easy code testings. - Easy share the search logic for third party to utilize the search function, such as [Rust Search Extension](https://rust.extension.sh), https://query.rs. This PR added a new class called `DocSearch`, which mainly expose following methods: ```js class DocSearch { // Dependency inject searchIndex, rootPath and searchState constructor(rawSearchIndex, rootPath, searchState) { // build search index... } static parseQuery(userQuery) { } async execQuery(parsedQuery, filterCrates, currentCrate) { } } ```
2024-08-31Unify scraped examples with other code examplesGuillaume Gomez-130/+134
2024-08-30Remove `#[macro_use] extern crate tracing` from rustdoc.Nicholas Nethercote-0/+8
2024-08-29Rollup merge of #129743 - GuillaumeGomez:fix-rustdoc-clippy, r=notriddleGuillaume Gomez-10/+9
Fix rustdoc clippy lints Ran clippy on rustdoc and fixed the errors. r? `@notriddle`
2024-08-29Fix clippy lintsGuillaume Gomez-10/+9
2024-08-29Separate core search logic with search uiFolyd-2277/+2316
2024-08-26rustdoc: fix missing resource suffix on `crates.js`Michael Howell-9/+15
Fixes a regression introduced in #128252.
2024-08-27Rollup merge of #129560 - GuillaumeGomez:impl-assoc-type-source-link, ↵Matthias Krüger-0/+2
r=notriddle [rustdoc] Generate source link on impl associated types Currently, impl associated types are generated but don't get a source link. This PR fixes that. Before: ![image](https://github.com/user-attachments/assets/3a22adb5-8b66-4124-9267-7c26eed1aa5e) After: ![Screenshot from 2024-08-25 16-31-36](https://github.com/user-attachments/assets/6e9b35e7-4357-4ecf-8c49-1d8294051283) r? `@notriddle`
2024-08-26Rollup merge of #129525 - notriddle:notriddle/fake-variadic-tuple-array, ↵Matthias Krüger-40/+74
r=GuillaumeGomez rustdoc: clean up tuple <-> primitive conversion docs This adds a minor missing feature to `fake_variadic`, so that it can render `impl From<(T,)> for [T; 1]` correctly.
2024-08-25Generate missing source link on impl associated typesGuillaume Gomez-0/+2
2024-08-24Rollup merge of #129430 - lolbinarycat:rustdoc-search-exact-case, r=notriddleTrevor Gross-0/+8
rustdoc: show exact case-sensitive matches first fixes #119480
2024-08-24rustdoc: clean up tuple <-> primitive conversion docsMichael Howell-40/+74
This adds a minor missing feature to `fake_variadic`, so that it can render `impl From<(T,)> for [T; 1]` correctly.
2024-08-23rustdoc: show exact case-sensitive matches firstbinarycat-0/+8
fixes #119480
2024-08-22rustdoc-search: use tighter json for names and parentsMichael Howell-13/+40
File size --------- ```console $ du -hs doc.old/search-index1.82.0.js doc/search-index1.82.0.js 3.2M doc.old/search-index1.82.0.js 2.8M doc/search-index1.82.0.js $ gzip doc/search-index1.82.0.js $ gzip doc.old/search-index1.82.0.js $ du -hs doc.old/search-index1.82.0.js.gz doc/search-index1.82.0.js.gz 464K doc.old/search-index1.82.0.js.gz 456K doc/search-index1.82.0.js.gz $ du -hs compiler-doc.old/search-index.js compiler-doc/search-index.js 8.5M compiler-doc.old/search-index.js 6.5M compiler-doc/search-index.js $ gzip compiler-doc/search-index1.82.0.js $ gzip compiler-doc.old/search-index1.82.0.js $ du -hs compiler-doc.old/search-index.js.gz compiler-doc/search-index.js.gz 1.4M compiler-doc.old/search-index.js.gz 1.4M compiler-doc/search-index.js.gz ```
2024-08-21Rollup merge of #129284 - notriddle:notriddle/animate-target=light, ↵Matthias Krüger-0/+13
r=GuillaumeGomez rustdoc: animate the `:target` highlight This approach is, roughly, based on how Discourse does it. It came up while discussing [some other possible sidebar changes](https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/Moving.20deprecated.20items.20out.20of.20the.20way), as a design that made rapid scanning easier while avoiding the inherent trade-offs in summarizing. https://github.com/user-attachments/assets/f7a8fec3-70a5-40a1-92ea-bfdffbd61c22
2024-08-21Auto merge of #129331 - matthiaskrgr:rollup-rxv463w, r=matthiaskrgrbors-24/+20
Rollup of 9 pull requests Successful merges: - #128662 (Lint on tail expr drop order change in Edition 2024) - #128932 (skip updating when external binding is existed) - #129270 (Don't consider locals to shadow inner items' generics) - #129277 (Update annotate-snippets to 0.11) - #129294 (Stabilize `iter::repeat_n`) - #129308 (fix: simple typo in compiler directory) - #129309 (ctfe: make CompileTimeInterpCx type alias public) - #129314 (fix a broken link in `mir/mod.rs`) - #129318 (Remove unneeded conversion to `DefId` for `ExtraInfo`) r? `@ghost` `@rustbot` modify labels: rollup
2024-08-20rustdoc: add test case for modnav position when TOC is offMichael Howell-11/+7
2024-08-20rustdoc: consistentify `#TOC` and `#ModNav` to lowercaseMichael Howell-8/+9
2024-08-20rustdoc: show code spans as `<code>` in TOCMichael Howell-11/+69
2024-08-20rustdoc: add separate section for module itemsMichael Howell-3/+14
2024-08-20rustdoc: add separate section for module itemsMichael Howell-11/+35
2024-08-20Add configuration options to hide TOC or module navigationMichael Howell-20/+74
2024-08-20Add Top TOC support to rustdocMichael Howell-121/+201
This commit adds the headers for the top level documentation to rustdoc's existing table of contents, along with associated items. It only show two levels of headers. Going further would require the sidebar to be wider, and that seems unnecessary (the crates that have manually-built TOCs usually don't need deeply nested headers).
2024-08-20Auto merge of #128252 - EtomicBomb:pre-rfc, r=notriddlebors-683/+1551
modularize rustdoc's write_shared Refactor src/librustdoc/html/render/write_shared.rs to reduce code duplication, adding unit tests * Extract + unit test code for sorting and rendering JSON, which is duplicated 9 times in the current impl * Extract + unit test code for encoding JSON as single quoted strings, which is duplicated twice in the current impl * Unit tests for cross-crate information file formats * Generic interface to add new kinds of cross-crate information files in the future * Intended to match current behavior exactly, except for a merge info comment it adds to the bottom of cci files * This PR is intended to reduce the review burden from my [mergeable rustdoc rfc](https://github.com/rust-lang/rfcs/pull/3662) implementation PR, which is a [small commit based on this branch](https://github.com/EtomicBomb/rust/tree/rfc). This code is agnostic to the RFC and does not include any of the flags discussed there, but cleanly enables the addition of these flags in the future because it is more modular
2024-08-20Remove unneeded conversion to `DefId` for `ExtraInfo`Guillaume Gomez-24/+20
2024-08-19rustdoc: animate the `:target` highlightMichael Howell-0/+13
This approach is, roughly, based on how Discourse does it. It came up while discussing some other possible sidebar changes, as a design that made rapid scanning easier while avoiding the inherent trade-offs in summarizing.
2024-08-13Unify naming of `DocTest`Guillaume Gomez-2/+2
2024-08-13Improve code readabilityGuillaume Gomez-1/+1
2024-08-13Rename `DocTest` into `DocTestBuilder`Guillaume Gomez-1/+1
2024-08-13Correctly handle doctests with invalid ASTGuillaume Gomez-1/+1
2024-08-13Add new doc codeblock `standalone` attributeGuillaume Gomez-0/+6
2024-08-13Split standalone and mergeable doctestsGuillaume Gomez-2/+2
2024-08-13Split doctests between standalone and mergeable onesGuillaume Gomez-2/+2
2024-08-13Add `DocTest` typeGuillaume Gomez-2/+3
2024-08-12Rollup merge of #128394 - GuillaumeGomez:run-button, r=t-rustdocGuillaume Gomez-44/+29
Unify run button display with "copy code" button and with mdbook buttons Follow-up of https://github.com/rust-lang/rust/pull/128339. It looks like this (coherency++, yeay!): ![Screenshot from 2024-07-30 15-16-31](https://github.com/user-attachments/assets/5e262e5b-f338-4085-94ca-e223033a43db) Can be tested [here](https://rustdoc.crud.net/imperio/run-button/foo/struct.Bar.html). r? `@notriddle`
2024-08-10Rollup merge of #128923 - GuillaumeGomez:negative-impls-items, r=fmeaseGuillaume Gomez-19/+23
[rustdoc] Stop showing impl items for negative impls Fixes https://github.com/rust-lang/rust/issues/128799. As discussed with `@fmease,` they have a broader patch in progress, so this (small) PR will at least allow for them to have a regression test. :) r? `@fmease`
2024-08-10Stop showing impl items for negative implsGuillaume Gomez-19/+23
2024-08-08rustdoc: do not run doctests with invalid langstringsMichael Howell-7/+19
2024-08-08fix typos, more SelfEtomicBomb-17/+13
typos in comments, remove references to crate-info, Self type in ordered_json and sorted_template
2024-08-07rename sortedjson -> orderedjsonEtomicBomb-192/+227
2024-08-07added unit tests for write_sharedEtomicBomb-51/+257
2024-08-07move sorted_template and sorted_json testsEtomicBomb-271/+270