about summary refs log tree commit diff
path: root/src/librustdoc/html/static
AgeCommit message (Collapse)AuthorLines
2025-07-03setup CI and tidy to use typos for spellchecking and fix few typosklensy-2/+2
2025-07-01Improve CSS for source code block line numbersGuillaume Gomez-68/+30
2025-06-27Rollup merge of #142270 - lolbinarycat:rustdoc-search-Results-type, ↵Guillaume Gomez-77/+43
r=GuillaumeGomez Rustdoc js: even more typechecking improvements I noticed some oddities when I went to start working on type aliases, so I've gone and cleaned up a bunch of stuff. Notably `fullId` was nearly always an integer in practice, but tsc was being told it should be a string. r? ``@notriddle``
2025-06-26rustdoc js: several typechecking improvmentsbinarycat-77/+43
non-exhaustive list of changes: * rustdoc.Results has a max_dist field * improve typechecking around pathDist and addIntoResults * give handleNameSearch a type signature * typecheck sortQ * currentCrate is string and not optional * searchState is referenced as a global, not through window
2025-06-24Rollup merge of #142354 - gstjepan2:firefox_copy_paste_issue, r=GuillaumeGomezGuillaume Gomez-1/+29
Fixes firefox copy paste issue
2025-06-23Fixes firefox copy paste issuegstjepan2-1/+29
2025-06-20Rollup merge of #142497 - GuillaumeGomez:fix-random-search-failure, ↵Trevor Gross-37/+41
r=lolbinarycat Fix random failure when JS code is executed when the whole file was not read yet Very randomly (and rarely), when I arrived on a page with `?search=something` in the URL, I got this error: ![Screenshot From 2025-06-14 11-27-46](https://github.com/user-attachments/assets/4b61b067-4e80-49c1-9a45-cff1509bf86a) Moving the `initSearch` function at the bottom to ensure everything has been loaded fixes the issue. PS: Sorry for the noise. Pushed to the wrong branch and https://github.com/rust-lang/rust/pull/142496 closed. ><
2025-06-17Rollup merge of #142618 - GuillaumeGomez:eslint-no-console, r=lolbinarycatJacob Pratt-0/+2
Lint about `console` calls in rustdoc JS As discussed [here](https://github.com/rust-lang/rust/pull/142100#discussion_r2151764395), this PR enforces that `console` is not used in rustdoc JS by default. cc `@lolbinarycat`
2025-06-17Lint about `console` calls in rustdoc JSGuillaume Gomez-0/+2
2025-06-16rustdoc: make srcIndex no longer a global variablebinarycat-8/+7
this is one-time initialization data, it can just be a function parameter. we also move the json parsing into createSrcSidebar to save a few bytes.
2025-06-16rustdoc: add ways of collapsing all impl blocksbinarycat-6/+22
either shift+click the Summary button, or use the `_` key. this collapses everything, including (inherent) impl blocks. no need for a special "expand all impl blocks" method, as impl blocks are expanded during regular "expand all". doing "expand all" -> "collapse all" will always result in only impl blocks being expaned. some of the html is split up a bit awkwardly to try to avoid introducing new whitespaces nodes, which could affect display. Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2025-06-16Add comment to prevent having code other than `initSearch` at the end of ↵Guillaume Gomez-0/+4
`search.js`
2025-06-14Fix random failure when JS code is executed when the whole file was not read yetGuillaume Gomez-37/+37
2025-06-10rustdoc search: prefer stable items in search resultsbinarycat-2/+24
fixes https://github.com/rust-lang/rust/issues/138067
2025-05-27scrape-examples.js: fix typoslolbinarycat-2/+2
Co-authored-by: Guillaume Gomez <guillaume1.gomez@gmail.com>
2025-05-25Rollup merge of #139831 - lolbinarycat:rustdoc-mobile-sidebar, r=GuillaumeGomezJacob Pratt-1/+4
rustdoc: on mobile, make the sidebar full width and linewrap this is because the mobile sidebar cannot be resized, unlike on desktop.
2025-05-22scrape-examples.js: add another nonnull() invokationbinarycat-1/+1
2025-05-22fix typobinarycat-4/+5
2025-05-22Rollup merge of #140868 - SpecificProtagonist:rustdoc-trait-impl-code-link, ↵Matthias Krüger-1/+3
r=notriddle rustdoc: Fix links with inline code in trait impl docs Fixes #140857
2025-05-21rustdoc js: add rustdoc.ScrapedLoc typebinarycat-1/+5
2025-05-21rustdoc js: add ScrapedLoc typebinarycat-4/+16
2025-05-21scrape-examples.js: give each function a signaturebinarycat-9/+24
2025-05-16rustdoc: on mobile, make the sidebar full width and linewrapbinarycat-1/+4
this is because the mobile sidebar cannot be resized, unlike on desktop.
2025-05-10rustdoc: Fix links in trait impl docsSpecificProtagonist-1/+3
2025-05-09rustdoc: use a different style of grip trackMichael Howell-39/+19
2025-05-09rustdoc: add a handle that makes sidebar resizing more obviousMichael Howell-7/+53
This change is based on some discussion on [lolbinarycat's idea], but with a more "traditional" design. Specifically, this is the closest thing I could find to a consensus across many systems I looked at for inspiration: - In Jira, resizable sidebars have a stack of four dots. - In The GIMP, resizable sidebars have a stack of three dots. - In [old Windows], "panes" are defined to have the same border style as a window, which has a raised appearance. - In [NeXT], a drag point usually had an innie, whether the line in a slider or the circle in a scroller; I can also hide and show the favorites bar in Workspace by dragging on a circular "grip spot" - In [old Mac], drag handles for things usually had a "grip track" of parallel lines. - [OSX] kept that, but the "Source List" part of the Finder still had the circle grip for a time the same way Workspace did [lolbinarycat's idea]: https://github.com/rust-lang/rust/pull/139420 [old Windows]: https://archive.org/details/windowsinterface00micr/page/n9/mode/2up [old Mac]: https://archive.org/details/apple-hig/1996_Human_Interface_Guidelines_for_Mac_OS_8_%28WWDC_Release%29/page/16/mode/2up [NeXT]: https://archive.org/details/apple-hig/1993%20NeXTSTEP%20User%20Interface%20Guidelines%20-%20Release%203/page/145/mode/2up [OSX]: https://dn721903.ca.archive.org/0/items/apple-hig/MacOSX_HIG_2005_09_08.pdf#page=267
2025-05-06Rollup merge of #140135 - GuillaumeGomez:sidebars-image, r=rustdocGuillaume Gomez-21/+22
Unify sidebar buttons to use the same image Part of https://github.com/rust-lang/rust/issues/139832. The source sidebar looks like this with the new image: ![image](https://github.com/user-attachments/assets/df4fee52-fb71-4794-91b7-3afc6d2aab70) You can test it [here](https://rustdoc.crud.net/imperio/sidebar-images/src/foo/foo.rs.html). r? `@notriddle`
2025-04-24Fix indent of impl docsGuillaume Gomez-1/+4
2025-04-23Unify sidebar buttons to use the same imageGuillaume Gomez-21/+22
2025-04-21Use correct annotation for CSS pseudo elementsGuillaume Gomez-20/+20
2025-04-07Fix CSSGuillaume Gomez-1/+1
2025-04-05Rollup merge of #139274 - lolbinarycat:rustdoc-js-less-expect-error-part5, ↵Stuart Cook-46/+100
r=notriddle Rustdoc: typecheck settings.js This makes the file fully typechecked with no instances of ``````@ts-expect-error`````` and no type casts. r? `````@notriddle`````
2025-04-02rustdoc js: satisfy eslintbinarycat-4/+4
2025-04-02rustdoc: make settings checkboxes always squarebinarycat-0/+3
2025-04-02settings.js: fix whitespacebinarycat-1/+1
2025-04-02settings.js: add elemContainsTarget utility functionbinarycat-6/+15
this allows us to eliminate the last 3 @ts-expect-error in this file.
2025-04-02main.js: make hideAllModals docs clearerbinarycat-1/+1
"true" looks like a string value, `true` makes it more clear that we are talking about the actual boolean value.
2025-04-02settings.js: make top-level code typecheckbinarycat-9/+13
With this, almost the entire file is fully typechecked, the only exception being the Element.contains(EventTarget) pattern that is used several times, those are annotated with @ts-expect-error
2025-04-02settings.js: add some null checks to buildSettingsPagebinarycat-2/+8
2025-04-02settings.js: refactor settingsBlurHandlerbinarycat-5/+14
changes: * Add type signature * Add null checks * getHelpButton and getSettingsButton are only called once, which should marginally improve performance due to less queries. unfortunatly 2 @ts-expect-error was needed, as typescript is unaware the EventTarget is likely an Element.
2025-04-02settings.js: remove dead code for adding <hr> to settings pagebinarycat-5/+0
2025-04-02settings.js: add new rustdoc.Setting interfacebinarycat-17/+36
2025-04-02settings.js: begin typechecking migrationbinarycat-7/+19
this also makes `changeSetting` more robust in case it somehow gets called before `main.js` has finished loading.
2025-03-27search.js: revert usage of nonundef for now (not available under test)binarycat-2/+3
specifically, `storage.js` is not loaded during `rustdoc-js` and `rustdoc-js-std` tests.
2025-03-26satisfy eslintbinarycat-3/+3
2025-03-24search.js: fix whitespacebinarycat-1/+1
2025-03-24search.js: give type annotation to newSolutionsbinarycat-2/+2
2025-03-24search.js: give type to unifiedGenericsMgensbinarycat-2/+1
2025-03-24search.js: fix return type of unifyFunctionTypesbinarycat-2/+1
2025-03-24search.js: use @type instead of @ts-expect-errorbinarycat-5/+1