Rollup merge of #33867 - oli-obk:rustdoc_variant_types, r=GuillaumeGomez
print enum variant fields in docs Right now we are repeating enum variants at the top, because the fields aren't shown with the actual docs. It's very annoying to have to scroll up and down to have both docs and field info. For struct variants we already list the fields. enum docs look like this after this PR:  There are degenerate cases for enum tuple variants with lots of fields:  I was thinking that we could move the docs below the variant (slightly indented) or list the variant fields vertically instead of horizontally r? @steveklabnik
This commit is contained in:
commit
653ce3e525
4 changed files with 65 additions and 40 deletions
|
|
@ -265,6 +265,10 @@ nav.sub {
|
|||
.docblock h2 { font-size: 1.15em; }
|
||||
.docblock h3, .docblock h4, .docblock h5 { font-size: 1em; }
|
||||
|
||||
.docblock {
|
||||
margin-left: 24px;
|
||||
}
|
||||
|
||||
.content .out-of-band {
|
||||
font-size: 23px;
|
||||
margin: 0px;
|
||||
|
|
@ -640,6 +644,21 @@ span.since {
|
|||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.enum > .toggle-wrapper > .collapse-toggle, .struct > .toggle-wrapper > .collapse-toggle {
|
||||
left: 0;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.enum > .toggle-wrapper + .docblock, .struct > .toggle-wrapper + .docblock {
|
||||
margin-left: 30px;
|
||||
margin-bottom: 20px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.enum > .collapsed, .struct > .collapsed {
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
:target > code {
|
||||
background: #FDFFD3;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue