Skip to content

Commit b221a6b

Browse files
authored
Merge pull request #2229 from notriddle/typescript
Add some extra pointers for rustdoc frontend devs
2 parents 15929a3 + bc8f003 commit b221a6b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/rustdoc.md

+9
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,13 @@ does is call the `main()` that's in this crate's `lib.rs`, though.)
5858
* If you want to copy those docs to a webserver, copy all of
5959
`build/host/doc`, since that's where the CSS, JS, fonts, and landing
6060
page are.
61+
* For frontend debugging, disable the `rust.docs-minification` option in [`config.toml`].
6162
* Use `./x test tests/rustdoc*` to run the tests using a stage1
6263
rustdoc.
6364
* See [Rustdoc internals] for more information about tests.
6465

66+
[`config.toml`]: ./building/how-to-build-and-run.md
67+
6568
## Code structure
6669

6770
* 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.)
7780
* The tests on the structure of rustdoc HTML output are located in `tests/rustdoc`, where
7881
they're handled by the test runner of bootstrap and the supplementary script
7982
`src/etc/htmldocck.py`.
83+
* Frontend CSS and JavaScript are stored in `html/static/`.
8084

8185
## Tests
8286

@@ -91,6 +95,11 @@ does is call the `main()` that's in this crate's `lib.rs`, though.)
9195
browser-UI-test](https://github.com/GuillaumeGomez/browser-UI-test/) that uses
9296
puppeteer to run tests in a headless browser and check rendering and
9397
interactivity.
98+
* Additionally, JavaScript type annotations are written using [TypeScript-flavored JSDoc]
99+
comments and an external d.ts file. The code itself is plain, valid JavaScript; we only
100+
use tsc as a linter.
101+
102+
[TypeScript-flavored JSDoc]: https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html
94103

95104
## Constraints
96105

0 commit comments

Comments
 (0)