rustdoc: hardcode each header as a link.
This avoids having to include JS in the guide/tutorial/manual pages just to get the headers being links. The on-hover behaviour showing the little section marker § is preserved, because that gives a useful hint that the heading is a link.
This commit is contained in:
parent
f22c96cc88
commit
7a70ec1ba6
4 changed files with 17 additions and 14 deletions
|
@ -1064,7 +1064,8 @@ fn item_module(w: &mut Writer, cx: &Context,
|
|||
clean::ForeignStaticItem(..) => ("ffi-statics", "Foreign Statics"),
|
||||
clean::MacroItem(..) => ("macros", "Macros"),
|
||||
};
|
||||
try!(write!(w, "<h2 id='{}'>{}</h2>\n<table>", short, name));
|
||||
try!(write!(w, "<h2 id='{id}'><a href=\"\\#{id}\">{name}</a></h2>\n<table>",
|
||||
id = short, name = name));
|
||||
}
|
||||
|
||||
match myitem.inner {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue