about summary refs log tree commit diff
path: root/src/librustdoc/html/static/js
AgeCommit message (Collapse)AuthorLines
2022-04-26Migrate storage.js to ES6Guillaume Gomez-22/+25
2022-04-26Migrate source-script to ES6Guillaume Gomez-44/+45
2022-04-26Migrate main.js to ES6Guillaume Gomez-128/+130
2022-04-26Migrate externs.js to ES6Guillaume Gomez-7/+10
2022-04-26Small JS code improvementsGuillaume Gomez-6/+5
2022-04-26Update rustdoc search parser to handle `!` correctlyGuillaume Gomez-2/+13
2022-04-24Update settings.js to ES6Guillaume Gomez-6/+9
2022-04-24Update search.js to ES6Guillaume Gomez-218/+207
2022-04-20Extend `handleSingleArg` documentationGuillaume Gomez-0/+4
2022-04-18Correctly handle single `:`Guillaume Gomez-10/+6
2022-04-18Add an extra check over filter typeGuillaume Gomez-3/+30
2022-04-18Fix some corner casesGuillaume Gomez-5/+3
2022-04-18Parse idents the same way in both quote string elements and "normal" elementsGuillaume Gomez-32/+44
2022-04-18Remove unnecessary `elem.name.length === 0` since the rustdoc search eBNF ↵Guillaume Gomez-1/+1
does not allow elements without a name
2022-04-18Update the eBNF to allow generics bracket to not be closed if it's EOFGuillaume Gomez-1/+1
2022-04-18Handle separators in their own functions and fix missing handling of tabsGuillaume Gomez-3/+18
2022-04-18Improve the BNF description a bit and fix some issuesGuillaume Gomez-18/+44
2022-04-18Forbid rustdoc search query to end with ->Guillaume Gomez-0/+3
2022-04-18Add isIdentCharacter function to ensure that unexpected characters are ↵Guillaume Gomez-10/+29
handled correctly
2022-04-18Replace unneeded use of regex with a simple ifGuillaume Gomez-1/+4
2022-04-18Apply suggestions:Guillaume Gomez-37/+74
* Forbid generics without a path (so "<p>" is forbidden). * Change `handleSingleArg` so that it takes `results_others`, `results_in_args` and `results_returned` as arguments instead of using the "global" variables. * Change `createQueryElement` so that it returns the newly created element instead of taking `elems` as argument. * Improve documentation
2022-04-18Improve documentation and add some explanations in the codeGuillaume Gomez-9/+23
2022-04-18Simplify parser syntaxGuillaume Gomez-41/+39
2022-04-18Make query parser more strict and improve display of errorsGuillaume Gomez-51/+64
2022-04-18* Greatly improve the rustdoc search parser source codeGuillaume Gomez-398/+497
* Move all functions outside parseQuery
2022-04-18Add query syntax for the parserGuillaume Gomez-12/+71
2022-04-18* If type filter is in quotes, throw an error.Guillaume Gomez-3/+11
* If there are generics, don't allow to have quotes.
2022-04-18Improve naming of "val" fieldGuillaume Gomez-32/+32
2022-04-18Update search engine and parser to error when quotes are used on queries ↵Guillaume Gomez-58/+104
with more than one element.
2022-04-18Greatly improve rustdoc searchGuillaume Gomez-394/+602
2022-04-13Rollup merge of #93217 - willcrichton:example-analyzer, r=GuillaumeGomezDylan DPC-8/+24
Improve Rustdoc UI for scraped examples with multiline arguments, fix overflow in line numbers This PR improves a few aspects of the scrape examples feature in Rustdoc. * Only function names and not the full call expression are highlighted. * For call-sites with multiline arguments, the minimized code viewer will scroll to the top of the call-site rather than the middle if the argument is larger than the viewer size, ensuring that the function name is visible. * This fixes an issue where the line numbers column had a visible x-scroll bar. r? `@GuillaumeGomez`
2022-04-12rustdoc: discr. required+provided assoc consts+tysLeón Orell Valerian Liehr-1/+1
2022-03-27Improve alignment of additional scraped examples, add scrape examples help pageWill Crichton-2/+4
2022-03-27Improve Rustdoc UI for scraped examples with multiline arguments, fixWill Crichton-6/+20
overflow in line numbers
2022-03-08Unify inherent impl blocks by wrapping them into a divGuillaume Gomez-1/+1
2022-03-05Scroll when the anchor change and is linking outside of the displayed contentGuillaume Gomez-9/+7
2022-02-10Remove support for multi-query searchGuillaume Gomez-97/+6
2022-02-07Rollup merge of #93673 - jsha:linkify-sidebar-headings, r=GuillaumeGomezMara Bos-16/+24
Linkify sidebar headings for sibling items Also adjust CSS so this doesn't produce excess padding/margin. Note: I tried and failed to write a test with browser-UI-test. First I tried to `assert-property: (".block.mod h3 a", {"href": "index.html#macros"})`. But the `href` that gets read out is the fully-quallified URL, starting with `file:///`. That URL will differ depending on what path the test is run from, so that doesn't work. Next I tried clicking on the appropriate sidebar link, and verifying that the appropriate heading on the next page is highlighted with the right background color. However, that also didn't work: according to browser-UI-test, the targeted heading was plain white. However, running with no-headless, I could see that it actually was yellow. I suspect this is a bug in the older version of Chromium used with browser-UI-test's bundled puppeteer, since it doesn't reproduce on latest Chrome. Fixes #92957 Demo: https://rustdoc.crud.net/jsha/linkify-sidebar-headings/std/string/trait.ToString.html r? ``@GuillaumeGomez``
2022-02-05Linkify sidebar headings for sibling itemsJacob Hoffman-Andrews-16/+24
Also adjust CSS so this doesn't produce excess padding/margin.
2022-02-04Refactor conditionalEliaz Bobadilla-5/+2
2022-02-04Rollup merge of #92735 - GuillaumeGomez:crate-filter-url-param, r=jshaMatthias Krüger-58/+108
Add crate filter parameter in URL Fixes #92621. r? `@jsha`
2022-02-03Add filter-crate URL parameterGuillaume Gomez-47/+97
2022-02-02Unify storage getter and setter functionsGuillaume Gomez-12/+12
2022-01-29rustdoc: small fixes to mobile navigationJacob Hoffman-Andrews-1/+1
- Make sure the mobile-topbar doesn't overflow its height if the user sets a bigger font. - Make sure the sidebar can be scrolled all the way to the bottom by shortening it to accommodate the mobile-topbar. - Make the item name in the mobile-topbar clickable to go to the top of the page. - Remove excess padding sidebar in mobile mode.
2022-01-25Rollup merge of #93251 - jsha:theme-radio, r=GuillaumeGomezMatthias Krüger-10/+19
rustdoc settings: use radio buttons for theme This reduces the number of clicks required to change theme. Also, simplify the UI a bit (remove setting grouping), and add a "Back" link close to the settings icon. Demo: https://rustdoc.crud.net/jsha/theme-radio/settings.html r? ``@GuillaumeGomez`` New: ![image](https://user-images.githubusercontent.com/220205/150702647-4826d525-54fa-439a-b24c-6d5bca6f95bf.png) Old: ![image](https://user-images.githubusercontent.com/220205/150702669-6a4214ed-1dab-4fee-b1aa-59acfce3dbca.png)
2022-01-23Update theme on pageshow eventJacob Hoffman-Andrews-6/+25
When a user goes forward or back, the page may be rendered from the back/forward cache (https://web.dev/bfcache/) rather than from scratch. If they have changed theme in the meantime, that means seeing an incorrect theme on the page they went forward or back to. The `pageshow` event fires on such navigations, so we can update the theme based on that event.
2022-01-23rustdoc settings: use radio buttons for themeJacob Hoffman-Andrews-10/+19
This reduces the number of clicks required to change theme. Also, simplify the UI a bit (remove setting grouping), and add a "Back" link close to the settings icon.
2022-01-18Simplify and unify rustdoc sidebar stylesJacob Hoffman-Andrews-40/+22
This switches to just use size, weight, and spacing to distinguish headings in the sidebar. We no longer use boxes, horizontal bars, or centering to distinguish headings. This makes it much easier to understand the hierarchy of headings, and reduces visual noise. I also refactored how the mobile topbar works. Previously, we tried to shift around elements from the sidebar to make the topbar. Now, the topbar gets its own elements, which can be styled on their own. This makes styling and reasoning about those elements simpler. Because the heading font sizes are bigger, increase the sidebar width slightly. As a very minor change, removed version from the "All types" page. It's now only on the crate page.
2022-01-18Rollup merge of #92830 - jsha:style-cleanups, r=GuillaumeGomezMatthias Krüger-33/+12
Rustdoc style cleanups - Make "since" version numbers grey again (regressed in #92602). - Remove unneeded selectors for when crate filter dropdown is a sibling of search-input. - Crate filter dropdown doesn't need to be 100% width on mobile. - Only build crate filter dropdown when there is more than one crate. - Remove unused addCrateDropdown Demo: https://rustdoc.crud.net/jsha/style-cleanups/std/string/struct.String.html r? `@GuillaumeGomez`
2022-01-18Rollup merge of #92803 - jsha:hide-sidebar, r=GuillaumeGomezMatthias Krüger-0/+4
Hide mobile sidebar on some clicks When the user clicks outside the sidebar, the sidebar should close. Also, when the user clicks an internal link in the sidebar, it should close. Fixes #92682 Demo: https://rustdoc.crud.net/jsha/hide-sidebar/std/string/struct.String.html