diff options
| author | Dirk Gadsden <dirk@esherido.com> | 2014-12-27 22:45:13 -0500 |
|---|---|---|
| committer | Dirk Gadsden <dirk@esherido.com> | 2014-12-27 22:45:13 -0500 |
| commit | 4477c7c52e7c7058c8aed3b74366174f4d1b7241 (patch) | |
| tree | 940706b9e4cf92478f204dfed2836b0a8e73078f | |
| parent | 070ab63807dc80fa6a6c5ee80531284761ab42de (diff) | |
| download | rust-4477c7c52e7c7058c8aed3b74366174f4d1b7241.tar.gz rust-4477c7c52e7c7058c8aed3b74366174f4d1b7241.zip | |
Indent where clause in rustdoc
* Add <span class=‘where’> around clause * CSS rule to format the span (for #20176)
| -rw-r--r-- | src/librustdoc/html/format.rs | 3 | ||||
| -rw-r--r-- | src/librustdoc/html/static/main.css | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 25c4f4e01b6..ffc96debe3a 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -123,7 +123,7 @@ impl<'a> fmt::Show for WhereClause<'a> { if gens.where_predicates.len() == 0 { return Ok(()); } - try!(f.write(" where ".as_bytes())); + try!(f.write(" <span class='where'>where ".as_bytes())); for (i, pred) in gens.where_predicates.iter().enumerate() { if i > 0 { try!(f.write(", ".as_bytes())); @@ -149,6 +149,7 @@ impl<'a> fmt::Show for WhereClause<'a> { } } } + try!(f.write("</span>".as_bytes())); Ok(()) } } diff --git a/src/librustdoc/html/static/main.css b/src/librustdoc/html/static/main.css index dc62273364c..0b4ec38e0a3 100644 --- a/src/librustdoc/html/static/main.css +++ b/src/librustdoc/html/static/main.css @@ -306,6 +306,9 @@ nav.sub { font-size: 1em; position: relative; } +/* Shift "where ..." part of method definition down a line and indent it */ +.content .method .where { display: block; padding-left: 3.75em; } + .content .methods .docblock { margin-left: 40px; } .content .impl-items .docblock { margin-left: 40px; } |
