about summary refs log tree commit diff
path: root/src/librustdoc/html
AgeCommit message (Collapse)AuthorLines
2022-05-05Use "strict" mode in JS scriptsGuillaume Gomez-5/+15
2022-05-04Move callback to the () => {} syntax.Folyd-112/+109
Fix lint Fix main.js Restore anonymous functions Fix Fix more
2022-05-03Rollup merge of #93097 - GuillaumeGomez:settings-js, r=jshaYuki Okushi-197/+354
Switch settings menu to full js Since the settings can only be set when the JS is enabled, it's not really a problem. It also fixes a debate we had around the themes not being accessible easily before. ![Screenshot from 2022-01-19 23-06-59](https://user-images.githubusercontent.com/3050060/150221936-fd1a1e76-06b6-4416-a653-dbae111979ed.png) You can test it [here](https://rustdoc.crud.net/imperio/settings-js/doc/foo/index.html). r? ``@jsha``
2022-05-02Fix regression in link-to-definition introduced in #93803Guillaume Gomez-2/+12
2022-05-02rustc: Panic by default in `DefIdTree::parent`Vadim Petrochenkov-1/+1
Only crate root def-ids don't have a parent, and in majority of cases the argument of `DefIdTree::parent` cannot be a crate root. So we now panic by default in `parent` and introduce a new non-panicing function `opt_parent` for cases where the argument can be a crate root. Same applies to `local_parent`/`opt_local_parent`.
2022-05-01* Add documentation for settings page rendering functions.Guillaume Gomez-55/+65
* Improve code. * Fix some documentation argument types. * Make settings order the same as before this PR. * Change timeout to 0 so that browser will render it as fast as possible.
2022-04-30Store all generic bounds as where predicates.Camille GILLOT-11/+2
2022-04-30Move settings into full JSGuillaume Gomez-196/+343
2022-04-29Rollup merge of #96390 - GuillaumeGomez:es6-part2, r=notriddleDylan DPC-245/+233
Switch JS code to ES6 - part 2 Part of #93058. It's based on https://github.com/rust-lang/rust/pull/96361 so it needs to wait for it to be merged first. r? `@notriddle`
2022-04-27Rollup merge of #96430 - GuillaumeGomez:search-exclamation, r=notriddleDylan DPC-2/+13
Fix handling of `!` in rustdoc search Fixes #96399. I also updated the eBNF. cc `@jsha` r? `@notriddle`
2022-04-27Rollup merge of #96410 - notriddle:notriddle/issue-95873, r=GuillaumeGomezDylan DPC-1/+2
rustdoc: do not write `{{root}}` in `pub use ::foo` docs Fixes #95873
2022-04-26Remove dead code in main.jsGuillaume Gomez-23/+0
2022-04-26Migrate scrape-examples.js to ES6Guillaume Gomez-21/+24
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-26Rollup merge of #96361 - GuillaumeGomez:es6, r=notriddleGuillaume Gomez-224/+216
Switch JS code to ES6 Considering it's already quite big, I'll do the remaining files in another PR. Part of #93058. r? ``@notriddle``
2022-04-26Rollup merge of #96279 - GuillaumeGomez:remove-woff-fonts, r=camelid,jshaDylan DPC-85/+30
rustdoc: Remove .woff font files Copying `@jsha's` great comment: > Right now we ship 1.5MB of woff files in the rustdoc binary, and 1MB of woff2 files, for a total of 2.5MB. > > Per: > > https://caniuse.com/woff > https://caniuse.com/woff2 > > The only listed browser that supports woff and not woff2 is IE, which is not supported per https://github.com/rust-lang/rfcs/blob/master/text/1985-tiered-browser-support.md. > > I propose we stop shipping woff files and save 1.5MB from the rustdoc binary (and from each doc build). r? `@jsha`
2022-04-25rustdoc: do not write `{{root}}` in `pub use ::foo` docsMichael Howell-1/+2
2022-04-24Update settings.js to ES6Guillaume Gomez-6/+9
2022-04-24Update search.js to ES6Guillaume Gomez-218/+207
2022-04-21Auto merge of #96260 - Kobzol:rustdoc-idmap, r=petrochenkovbors-44/+48
rustdoc: Optimize IdMap Slightly optimizes `IdMap`, which is hot in `markdown_links` (context [here](https://github.com/rust-lang/rust/pull/96135#issuecomment-1103539052)). There are more improvements that can be made near this place, but this seemed like an easy win locally (although I tried it on top of https://github.com/rust-lang/rust/pull/94857, so let's see what happens without that PR). r? `@petrochenkov`
2022-04-21Remove .woff font filesGuillaume Gomez-85/+30
2022-04-21Auto merge of #95828 - vacuus:rustdoc-print-where-clause, r=notriddlebors-70/+62
rustdoc: Clean up `html::format::print_where_clause` (Arguably) closes https://github.com/rust-lang/rust/issues/95814
2022-04-21Auto merge of #96263 - Dylan-DPC:rollup-0eofl13, r=Dylan-DPCbors-425/+1010
Rollup of 5 pull requests Successful merges: - #90630 (Create real parser for search queries) - #96193 ([fuchsia] Add implementation for `current_exe`) - #96196 (Remove assertion that all paths in `ShouldRun` exist) - #96228 (Fix locations for intrinsics impls and change to links) - #96236 (Add an explicit `Span` field to `OutlivesConstraint`) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
2022-04-20rustdoc: Clean up `html::format::print_where_clause`Roc Yu-70/+62
2022-04-21Rollup merge of #90630 - GuillaumeGomez:improve-rustdoc-search, r=notriddleDylan DPC-425/+1010
Create real parser for search queries You can test it [here](https://rustdoc.crud.net/imperio/improve-rustdoc-search/std/index.html). This PR adds a real parser for the query engine in rustdoc. The parser is quite simple but it allows to makes query handling much easier. I added a new testsuite to ensure it works as expected and ran fuzzing checks on it for a few hours without problems. So about the parser: as you can see in the screenshot, it handles recursive generics parsing. It also allows to set which item should use exact matching by adding double-quotes around it (look for `exact_search` in the screenshot). Now about the query engine itself: I simplified it a lot thanks to the parsed query. It behaves mostly the same when there is only one argument, but is much more powerful when there are more than one. When making this change, we also removed the support for multi-query. PS: A big part of the PR is tests and test-related code. :) r? `@camelid`
2022-04-21rustdoc: Optimize IdMapJakub Beránek-44/+48
2022-04-20Extend `handleSingleArg` documentationGuillaume Gomez-0/+4
2022-04-20Remove `<>` links to be potential intra-doc linksGuillaume Gomez-1/+13
2022-04-20Auto merge of #96135 - petrochenkov:doclink6, r=GuillaumeGomezbors-4/+6
rustdoc: Optimize and refactor doc link resolution One more subset of https://github.com/rust-lang/rust/pull/94857 that should bring perf improvements rather than regressions + a couple more optimizations on top of it. It's better to read individual commits and their descriptions to understand the changes. The `may_have_doc_links` optimization is not *very* useful here, but it's much more important for https://github.com/rust-lang/rust/pull/94857. Closes https://github.com/rust-lang/rust/issues/96079
2022-04-19Rollup merge of #95813 - Urgau:rustdoc-where-clause-space, r=GuillaumeGomezDylan DPC-1/+2
Remove extra space before a where clause Remove extra space before where clause in the generated documentation. The fix is to move the space before the break-line so that it doesn't appear visually but is still here. Removing it completely would create things like this `impl<D> Delta<D>where D: MyTrait` (missing a space before the where) which I don't think we want. Added two regression test, first one test that the `<br>` is after the space and the second check that the `<br>` is before the spaces. Before: ![image](https://user-images.githubusercontent.com/3616612/162475212-d4bb6727-ed66-4a55-a4a2-4f55189bf8bd.png) After: ![image](https://user-images.githubusercontent.com/3616612/162475467-508fd082-60a7-4a8c-b693-8b188e8843e6.png) r? ``@GuillaumeGomez``
2022-04-19rustdoc: Cache preprocessed markdown linksVadim Petrochenkov-4/+6
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