Commit 2d37f38
committed
Auto merge of rust-lang#95024 - koehlma:rustdoc-private-items, r=GuillaumeGomez,camelid,jsha
rustdoc: add 🔒 to items with restricted visibility
This change marks items with restricted visibility with 🔒 when building with `--document-private-items`:
<img width="278" alt="Screen Shot 2022-03-20 at 23 50 24" src="https://user-images.githubusercontent.com/509209/159189513-9e4b09bb-6785-41a5-bfe2-df02f83f8641.png">
There also appears a “Restricted Visibility” tooltip when hovering over the emoji.
---
The original PR for reference:
This change makes private items slightly transparent (similar to `unstable` items in rustc):
<img width="272" alt="Screen Shot 2022-03-16 at 22 17 43" src="https://user-images.githubusercontent.com/509209/158692627-a1f6f5ec-e043-4aa2-9352-8d2b15c31c08.png">
I found myself using `--document-private-items` a lot recently because I find the documentation of private internals quite helpful when working on a larger project. However, not being able to distinguish private from public items (see rust-lang#87785) when looking at the documentation makes this somewhat cumbersome.
This PR addresses the third suggestion of issue rust-lang#87785 by marking private items typographically. It seems to me that the other suggestions are more involved but this is at least a first step.
A private item is also made slightly transparent in the path displayed in the header of a page:
<img width="467" alt="Screen Shot 2022-03-16 at 22 19 51" src="https://user-images.githubusercontent.com/509209/158692885-0bbd3417-3c0b-486f-b8ab-99c05c6fa7ca.png">
I am looking forward to feedback and suggestions.File tree
2 files changed
+43
-3
lines changed- src
- librustdoc/html/render
- test/rustdoc
2 files changed
+43
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
376 | 376 | | |
377 | 377 | | |
378 | 378 | | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
379 | 386 | | |
380 | 387 | | |
381 | 388 | | |
382 | 389 | | |
383 | 390 | | |
384 | | - | |
385 | | - | |
386 | | - | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
387 | 395 | | |
388 | 396 | | |
389 | 397 | | |
| 398 | + | |
390 | 399 | | |
391 | 400 | | |
392 | 401 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
| 13 | + | |
11 | 14 | | |
12 | 15 | | |
| 16 | + | |
13 | 17 | | |
14 | 18 | | |
| 19 | + | |
15 | 20 | | |
16 | 21 | | |
| 22 | + | |
17 | 23 | | |
18 | 24 | | |
19 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
20 | 33 | | |
| 34 | + | |
21 | 35 | | |
22 | 36 | | |
| 37 | + | |
23 | 38 | | |
24 | 39 | | |
| 40 | + | |
25 | 41 | | |
26 | 42 | | |
27 | 43 | | |
| 44 | + | |
28 | 45 | | |
29 | 46 | | |
30 | 47 | | |
31 | 48 | | |
| 49 | + | |
32 | 50 | | |
| 51 | + | |
33 | 52 | | |
34 | 53 | | |
| 54 | + | |
35 | 55 | | |
36 | 56 | | |
| 57 | + | |
37 | 58 | | |
38 | 59 | | |
39 | 60 | | |
| 61 | + | |
40 | 62 | | |
41 | 63 | | |
42 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
43 | 69 | | |
44 | 70 | | |
45 | 71 | | |
| |||
53 | 79 | | |
54 | 80 | | |
55 | 81 | | |
| 82 | + | |
| 83 | + | |
56 | 84 | | |
57 | 85 | | |
58 | 86 | | |
59 | 87 | | |
60 | 88 | | |
61 | 89 | | |
62 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
63 | 94 | | |
64 | 95 | | |
65 | 96 | | |
| |||
0 commit comments