rust/src/librustdoc/html/static/js
Michael Howell 47c46324aa rustdoc: clean up the In [name] up-pointer
This commit makes three changes for consistency and readability:

  - It shows the sibling navigation on module pages. It's weird
    that it didn't work before, and is inconsistent with everything
    else (even Crates have sibling navigation with other Crates).
  - It hides the "In [parent]" header if it's the same as the
    current crate, and if there's no other header between them.
    We need to keep it on modules and types, since they have
    their own header and data between them, and we don't want
    to show siblings under a header implying that they're children.
  - It adds a margin to deal with the headers butting directly into
    the branding lockup.
2023-10-08 20:17:53 -07:00
..
externs.js rustdoc: bug fix for -> option<t> 2023-09-03 13:06:07 -07:00
main.js rustdoc: clean up the In [name] up-pointer 2023-10-08 20:17:53 -07:00
README.md Add some JSDoc comments to rustdoc JS 2021-12-22 14:20:04 -08:00
scrape-examples.js Improve calculation of scraped example minimized height 2022-12-07 10:42:09 -08:00
search.js rustdoc-search: fix bug with multi-item impl trait 2023-10-05 22:32:37 -07:00
settings.js Change syntax for anonymous functions set 2023-09-08 12:08:42 +02:00
src-script.js rustdoc: rename to src-script.js 2023-07-14 16:54:14 -07:00
storage.js rustdoc: avoid calling document.write after the page loads 2023-09-15 07:40:17 -07: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