diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2016-05-10 21:01:10 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2016-05-10 21:01:10 +0200 |
| commit | a5a2f2b951ea982a666eaf52b1874d8f1b17290b (patch) | |
| tree | e50f2fad85aa96941a4e19b83ca919f5a97986a3 | |
| parent | d6588097d4d65e567fb234c042e61ad8ce4d41e6 (diff) | |
Improve "since" tag placement
| -rw-r--r-- | src/librustdoc/html/render.rs | 6 | ||||
| -rw-r--r-- | src/librustdoc/html/static/rustdoc.css | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index 6a2a0a37c1c..da0520ebcb8 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -1537,7 +1537,6 @@ impl<'a> Item<'a> { } } - impl<'a> fmt::Display for Item<'a> { fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { debug_assert!(!self.item.is_stripped()); @@ -1575,6 +1574,9 @@ impl<'a> fmt::Display for Item<'a> { write!(fmt, "</span>")?; // in-band write!(fmt, "<span class='out-of-band'>")?; + if let Some(version) = self.item.stable_since() { + write!(fmt, "<span class='since'>{}</span>", version)?; + } write!(fmt, r##"<span id='render-detail'> <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs"> @@ -1922,7 +1924,6 @@ fn item_function(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, generics = f.generics, where_clause = WhereClause(&f.generics), decl = f.decl)?; - render_stability_since_raw(w, it.stable_since(), None)?; document(w, cx, it) } @@ -2236,7 +2237,6 @@ fn item_struct(w: &mut fmt::Formatter, cx: &Context, it: &clean::Item, "", true)?; write!(w, "</pre>")?; - render_stability_since_raw(w, it.stable_since(), None)?; document(w, cx, it)?; let mut fields = s.fields.iter().filter(|f| { diff --git a/src/librustdoc/html/static/rustdoc.css b/src/librustdoc/html/static/rustdoc.css index 4d65b91ed42..d256e939afc 100644 --- a/src/librustdoc/html/static/rustdoc.css +++ b/src/librustdoc/html/static/rustdoc.css @@ -634,6 +634,12 @@ a.test-arrow { padding-left: 10px; } +span.since { + position: initial; + font-size: 20px; + margin-right: 5px; +} + /* Media Queries */ @media (max-width: 700px) { |
