Commit 9a7016d
authored
Rollup merge of rust-lang#61505 - ebarnard:doc-shrink, r=GuillaumeGomez
Only show methods that appear in `impl` blocks in the Implementors sections of trait doc pages
In the "Implementors" and "Implementations on Foreign Types" sections, only show methods that appear in the `impl` block for that type. This has the benefit of
- Reducing the size of the Iterator page, and other large trait documentation pages.
- Retaining documentation on the `impl` blocks and functions in the `impl` blocks.
- Indicating which provided methods are overridden.
- Making the documentation match the structure of the code being documented.
- Being a small change that can be easily backed out if issues arise.
A set of Rust stdlib docs build with this change are [available here](https://ebarnard.github.io/2019-06-03-rust-smaller-trait-implementers-docs/).
The size of the [`Iterator` doc page](https://ebarnard.github.io/2019-06-03-rust-smaller-trait-implementers-docs/std/iter/trait.Iterator.html) is reduced from 14.4MB (latest nightly) to 724kB.
Before:
<img width="1411" alt="Screenshot 2019-06-03 at 23 12 17" src="https://user-images.githubusercontent.com/1059683/58837971-1722a780-8655-11e9-8d81-51e48130951d.png">
After:
<img width="1428" alt="Screenshot 2019-06-03 at 16 41 27" src="https://user-images.githubusercontent.com/1059683/58814907-84ffac80-861e-11e9-8692-79be473a5299.png">
cc rust-lang#559001 file changed
+13
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3066 | 3066 | | |
3067 | 3067 | | |
3068 | 3068 | | |
3069 | | - | |
| 3069 | + | |
3070 | 3070 | | |
3071 | 3071 | | |
3072 | 3072 | | |
| |||
3077 | 3077 | | |
3078 | 3078 | | |
3079 | 3079 | | |
3080 | | - | |
| 3080 | + | |
3081 | 3081 | | |
3082 | 3082 | | |
3083 | 3083 | | |
| |||
3307 | 3307 | | |
3308 | 3308 | | |
3309 | 3309 | | |
3310 | | - | |
| 3310 | + | |
3311 | 3311 | | |
3312 | 3312 | | |
3313 | 3313 | | |
| |||
3979 | 3979 | | |
3980 | 3980 | | |
3981 | 3981 | | |
3982 | | - | |
| 3982 | + | |
3983 | 3983 | | |
3984 | 3984 | | |
3985 | 3985 | | |
| |||
4161 | 4161 | | |
4162 | 4162 | | |
4163 | 4163 | | |
4164 | | - | |
| 4164 | + | |
| 4165 | + | |
4165 | 4166 | | |
4166 | 4167 | | |
4167 | 4168 | | |
| |||
4345 | 4346 | | |
4346 | 4347 | | |
4347 | 4348 | | |
4348 | | - | |
4349 | | - | |
4350 | | - | |
| 4349 | + | |
| 4350 | + | |
| 4351 | + | |
| 4352 | + | |
| 4353 | + | |
| 4354 | + | |
| 4355 | + | |
4351 | 4356 | | |
4352 | 4357 | | |
4353 | 4358 | | |
| |||
0 commit comments