Make source links highlight the entire definition and not just the first line
This commit is contained in:
parent
49e6db7f35
commit
f00d72b78b
1 changed files with 7 additions and 2 deletions
|
@ -714,13 +714,18 @@ impl<'self> fmt::Default for Item<'self> {
|
||||||
do clean_srcpath(it.item.source.filename) |component| {
|
do clean_srcpath(it.item.source.filename) |component| {
|
||||||
path.push(component.to_owned());
|
path.push(component.to_owned());
|
||||||
}
|
}
|
||||||
|
let href = if it.item.source.loline == it.item.source.hiline {
|
||||||
|
format!("{}", it.item.source.loline)
|
||||||
|
} else {
|
||||||
|
format!("{}-{}", it.item.source.loline, it.item.source.hiline)
|
||||||
|
};
|
||||||
write!(fmt.buf,
|
write!(fmt.buf,
|
||||||
"<a class='source'
|
"<a class='source'
|
||||||
href='{root}src/{crate}/{path}.html\\#{line}'>[src]</a>",
|
href='{root}src/{crate}/{path}.html\\#{href}'>[src]</a>",
|
||||||
root = it.cx.root_path,
|
root = it.cx.root_path,
|
||||||
crate = it.cx.layout.crate,
|
crate = it.cx.layout.crate,
|
||||||
path = path.connect("/"),
|
path = path.connect("/"),
|
||||||
line = it.item.source.loline);
|
href = href);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Write the breadcrumb trail header for the top
|
// Write the breadcrumb trail header for the top
|
||||||
|
|
Loading…
Add table
Reference in a new issue