Skip to content

Commit 5371146

Browse files
committed
rustdoc: refactor and unstyle inline section headers
1 parent a692e9b commit 5371146

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

src/librustdoc/html/markdown.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ pub fn render(w: &mut io::Writer, s: &str, print_toc: bool) -> fmt::Result {
209209
};
210210

211211
// Render the HTML
212-
let text = format!(r#"<h{lvl} id="{id}" class='section-link'><a
212+
let text = format!(r#"<h{lvl} id="{id}" class='section-header'><a
213213
href="\#{id}">{sec_len,plural,=0{}other{{sec} }}{}</a></h{lvl}>"#,
214214
s, lvl = level, id = id,
215215
sec_len = sec.len(), sec = sec);

src/librustdoc/html/render.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1121,7 +1121,7 @@ fn item_module(w: &mut Writer, cx: &Context,
11211121
clean::MacroItem(..) => ("macros", "Macros"),
11221122
};
11231123
try!(write!(w,
1124-
"<h2 id='{id}' class='section-link'>\
1124+
"<h2 id='{id}' class='section-header'>\
11251125
<a href=\"\\#{id}\">{name}</a></h2>\n<table>",
11261126
id = short, name = name));
11271127
}

src/librustdoc/html/static/main.css

+9-8
Original file line numberDiff line numberDiff line change
@@ -388,16 +388,17 @@ pre.rust .doccomment { color: #4D4D4C; }
388388
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
389389
pre.rust .lifetime { color: #B76514; }
390390

391-
h1.section-link:hover a:after,
392-
h2.section-link:hover a:after,
393-
h3.section-link:hover a:after,
394-
h4.section-link:hover a:after,
395-
h5.section-link:hover a:after,
396-
h6.section-link:hover a:after {
397-
content: '\2002\00a7\2002';
391+
.section-header {
392+
border-bottom: none !important;
393+
font-size: 1.1em !important;
394+
margin: 0 !important;
395+
padding: 0 !important;
396+
}
397+
.section-header:hover a:after {
398+
content: '\2002\00a7\2002';
398399
}
399400

400-
/** Media Queries **/
401+
/* Media Queries */
401402

402403
@media (max-width: 700px) {
403404
.sidebar {

0 commit comments

Comments
 (0)