Add more links and put the link character to the left

This commit is contained in:
Guillaume Gomez 2017-09-17 22:11:37 +02:00
parent 1cdd68922d
commit e47279f512
2 changed files with 15 additions and 5 deletions

View File

@ -2671,8 +2671,9 @@ fn item_struct(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
let ns_id = derive_id(format!("{}.{}", let ns_id = derive_id(format!("{}.{}",
field.name.as_ref().unwrap(), field.name.as_ref().unwrap(),
ItemType::StructField.name_space())); ItemType::StructField.name_space()));
write!(w, "<span id='{id}' class=\"{item_type}\"> write!(w, "<span id=\"{id}\" class=\"{item_type} small-section-header\">
<span id='{ns_id}' class='invisible'> <a href=\"#{id}\" class=\"anchor field\"></a>
<span id=\"{ns_id}\" class='invisible'>
<code>{name}: {ty}</code> <code>{name}: {ty}</code>
</span></span>", </span></span>",
item_type = ItemType::StructField, item_type = ItemType::StructField,
@ -2793,7 +2794,8 @@ fn item_enum(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item,
let ns_id = derive_id(format!("{}.{}", let ns_id = derive_id(format!("{}.{}",
variant.name.as_ref().unwrap(), variant.name.as_ref().unwrap(),
ItemType::Variant.name_space())); ItemType::Variant.name_space()));
write!(w, "<span id='{id}' class='variant'>\ write!(w, "<span id=\"{id}\" class=\"variant small-section-header\">\
<a href=\"#{id}\" class=\"anchor field\"></a>\
<span id='{ns_id}' class='invisible'><code>{name}", <span id='{ns_id}' class='invisible'><code>{name}",
id = id, id = id,
ns_id = ns_id, ns_id = ns_id,

View File

@ -288,6 +288,7 @@ nav.sub {
.docblock { .docblock {
margin-left: 24px; margin-left: 24px;
position: relative;
} }
.content .out-of-band { .content .out-of-band {
@ -456,8 +457,13 @@ a {
} }
.anchor { .anchor {
display: none; display: none;
position: absolute;
left: -25px;
} }
.anchor:after { .anchor.field {
left: -20px;
}
.anchor:before {
content: '\2002\00a7\2002'; content: '\2002\00a7\2002';
} }
@ -625,7 +631,9 @@ a.test-arrow:hover{
text-decoration: none; text-decoration: none;
} }
.section-header:hover a:after { .section-header:hover a:before {
position: absolute;
left: -25px;
content: '\2002\00a7\2002'; content: '\2002\00a7\2002';
} }