1
Fork 0
rust/src/librustdoc/html/static/js
Matthias Krüger c3ddca6d4a
Rollup merge of #93251 - jsha:theme-radio, r=GuillaumeGomez
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-25 05:51:13 +01:00
..
externs.js Add some JSDoc comments to rustdoc JS 2021-12-22 14:20:04 -08:00
main.js Simplify and unify rustdoc sidebar styles 2022-01-18 10:43:14 -08:00
README.md Add some JSDoc comments to rustdoc JS 2021-12-22 14:20:04 -08:00
scrape-examples.js Move more scrape-examples logic from JS to rust 2021-10-08 11:14:01 -07:00
search.js Rustdoc style cleanups 2022-01-17 11:45:28 -08:00
settings.js rustdoc settings: use radio buttons for theme 2022-01-23 15:55:50 -08:00
source-script.js Simplify and unify rustdoc sidebar styles 2022-01-18 10:43:14 -08:00
storage.js Update theme on pageshow event 2022-01-23 17:17:58 -08:00

Rustdoc JS

These JavaScript files are incorporated into the rustdoc binary at build time, and are minified and written to the filesystem as part of the doc build process.

We use the Closure Compiler dialect of JSDoc to comment our code and annotate params and return types. To run a check:

./x.py doc library/std
npm i -g google-closure-compiler
google-closure-compiler -W VERBOSE \
  build/<YOUR PLATFORM>/doc/{search-index*.js,crates*.js} \
  src/librustdoc/html/static/js/{search.js,main.js,storage.js} \
  --externs src/librustdoc/html/static/js/externs.js >/dev/null