From 4477c7c52e7c7058c8aed3b74366174f4d1b7241 Mon Sep 17 00:00:00 2001 From: Dirk Gadsden Date: Sat, 27 Dec 2014 22:45:13 -0500 Subject: [PATCH 1/2] Indent where clause in rustdoc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add around clause * CSS rule to format the span (for #20176) --- src/librustdoc/html/format.rs | 3 ++- src/librustdoc/html/static/main.css | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 25c4f4e01b620..ffc96debe3abe 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(" 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("".as_bytes())); Ok(()) } } diff --git a/src/librustdoc/html/static/main.css b/src/librustdoc/html/static/main.css index dc62273364c20..0b4ec38e0a398 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; } From 57a3ef3f9b59ad74a2ce369150f72007fb8b2e62 Mon Sep 17 00:00:00 2001 From: Dirk Gadsden Date: Sun, 28 Dec 2014 12:24:27 -0500 Subject: [PATCH 2/2] Use CSS whitespace rather than padding to indent --- src/librustdoc/html/static/main.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/librustdoc/html/static/main.css b/src/librustdoc/html/static/main.css index 0b4ec38e0a398..9d4f341a30e25 100644 --- a/src/librustdoc/html/static/main.css +++ b/src/librustdoc/html/static/main.css @@ -306,8 +306,10 @@ 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; } +/* Shift "where ..." part of method definition down a line */ +.content .method .where { display: block; } +/* Bit of whitespace to indent it */ +.content .method .where::before { content: ' '; } .content .methods .docblock { margin-left: 40px; }