about summary refs log tree commit diff
diff options
context:
space:
mode:
author许杰友 Jieyou Xu (Joe) <39484203+jieyouxu@users.noreply.github.com>2025-01-29 03:53:00 +0000
committerGitHub <noreply@github.com>2025-01-29 03:53:00 +0000
commit852003184239453391dca44378281eaeb43a9276 (patch)
treeff19ffc601833d22b784188d85c46a86a0d4abf1
parent3d4b24ac0e2f67e6156f8a7660a6adbc9c7aee8b (diff)
parent5861aa21d9acfae6e83acb79081b81c7a7c4994f (diff)
downloadrust-852003184239453391dca44378281eaeb43a9276.tar.gz
rust-852003184239453391dca44378281eaeb43a9276.zip
Merge pull request #2229 from notriddle/typescript
Add some extra pointers for rustdoc frontend devs
-rw-r--r--src/doc/rustc-dev-guide/src/rustdoc.md9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/doc/rustc-dev-guide/src/rustdoc.md b/src/doc/rustc-dev-guide/src/rustdoc.md
index 3867d248988..2a0e212f98e 100644
--- a/src/doc/rustc-dev-guide/src/rustdoc.md
+++ b/src/doc/rustc-dev-guide/src/rustdoc.md
@@ -58,10 +58,13 @@ does is call the `main()` that's in this crate's `lib.rs`, though.)
   * If you want to copy those docs to a webserver, copy all of
     `build/host/doc`, since that's where the CSS, JS, fonts, and landing
     page are.
+  * For frontend debugging, disable the `rust.docs-minification` option in [`config.toml`].
 * Use `./x test tests/rustdoc*` to run the tests using a stage1
   rustdoc.
   * See [Rustdoc internals] for more information about tests.
 
+[`config.toml`]: ./building/how-to-build-and-run.md
+
 ## Code structure
 
 * All paths in this section are relative to `src/librustdoc` in the rust-lang/rust repository.
@@ -77,6 +80,7 @@ does is call the `main()` that's in this crate's `lib.rs`, though.)
 * The tests on the structure of rustdoc HTML output are located in `tests/rustdoc`, where
   they're handled by the test runner of bootstrap and the supplementary script
   `src/etc/htmldocck.py`.
+* Frontend CSS and JavaScript are stored in `html/static/`.
 
 ## Tests
 
@@ -91,6 +95,11 @@ does is call the `main()` that's in this crate's `lib.rs`, though.)
   browser-UI-test](https://github.com/GuillaumeGomez/browser-UI-test/) that uses
   puppeteer to run tests in a headless browser and check rendering and
   interactivity.
+* Additionally, JavaScript type annotations are written using [TypeScript-flavored JSDoc]
+  comments and an external d.ts file. The code itself is plain, valid JavaScript; we only
+  use tsc as a linter.
+
+[TypeScript-flavored JSDoc]: https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html
 
 ## Constraints