diff options
| author | Adrien Tétar <adri-from-59@hotmail.fr> | 2014-04-18 11:08:34 +0900 |
|---|---|---|
| committer | Adrien Tétar <adri-from-59@hotmail.fr> | 2014-04-20 21:11:44 +0900 |
| commit | c494a06064017f307a8d9dc4797e614d2ed99143 (patch) | |
| tree | b1a7434deca2307930ff2412e5ccc32365aecfb2 | |
| parent | fb9ea2eaca50108bcf1da1bdc6067986410f4240 (diff) | |
| download | rust-c494a06064017f307a8d9dc4797e614d2ed99143.tar.gz rust-c494a06064017f307a8d9dc4797e614d2ed99143.zip | |
doc: unifying with rustdoc
Conflicts: src/doc/rust.md
| -rw-r--r-- | src/doc/rust.css | 38 | ||||
| -rw-r--r-- | src/librustdoc/html/layout.rs | 13 | ||||
| -rw-r--r-- | src/librustdoc/html/render.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/static/main.css | 40 |
4 files changed, 50 insertions, 43 deletions
diff --git a/src/doc/rust.css b/src/doc/rust.css index 2177123cfde..b581dc2cce8 100644 --- a/src/doc/rust.css +++ b/src/doc/rust.css @@ -14,38 +14,38 @@ font-family: 'Fira Sans'; font-style: normal; font-weight: 400; - src: local('Fira Sans'), url("http://rust-lang.org/fonts/FiraSans-Regular.woff") format('woff'); + src: local('Fira Sans'), url("http://www.rust-lang.org/fonts/FiraSans-Regular.woff") format('woff'); } @font-face { font-family: 'Fira Sans'; font-style: normal; font-weight: 500; - src: local('Fira Sans Medium'), url("http://rust-lang.org/fonts/FiraSans-Medium.woff") format('woff'); + src: local('Fira Sans Medium'), url("http://www.rust-lang.org/fonts/FiraSans-Medium.woff") format('woff'); } @font-face { font-family: 'Heuristica'; font-style: normal; font-weight: 400; - src: local('Heuristica Regular'), url("http://rust-lang.org/fonts/Heuristica-Regular.woff") format('woff'); + src: local('Heuristica Regular'), url("http://www.rust-lang.org/fonts/Heuristica-Regular.woff") format('woff'); } @font-face { font-family: 'Heuristica'; font-style: italic; font-weight: 400; - src: local('Heuristica Italic'), url("http://rust-lang.org/fonts/Heuristica-Italic.woff") format('woff'); + src: local('Heuristica Italic'), url("http://www.rust-lang.org/fonts/Heuristica-Italic.woff") format('woff'); } @font-face { font-family: 'Heuristica'; font-style: normal; font-weight: 700; - src: local('Heuristica Bold'), url("http://rust-lang.org/fonts/Heuristica-Bold.woff") format('woff'); + src: local('Heuristica Bold'), url("http://www.rust-lang.org/fonts/Heuristica-Bold.woff") format('woff'); } /* Global page semantics ========================================================================== */ body { margin: 0 auto; padding: 0 15px; - font-family: Heuristica, "Helvetica Neue", Helvetica, Arial, sans-serif; + font-family: "Heuristica", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 18px; color: #333; line-height: 1.428571429; @@ -66,9 +66,16 @@ h1, h2, h3, h4, h5, h6 { } h1, h2, h3 { margin-top: 20px; - margin-bottom: 10px; + margin-bottom: 15px; +} +h1 { + margin-bottom: 20px; } @media (min-width: 1170px) { + h1 { + margin-top: 40px; + margin-bottom: 30px; + } h1, h2, h3 { margin-top: 30px; margin-bottom: 15px; @@ -87,7 +94,6 @@ h1 { font-size: 28px; font-weight: 500; padding: .1em .4em; - margin: 0.67em 0; border-bottom: 2px solid #ddd; } h1.title { @@ -227,7 +233,7 @@ pre.rust .lifetime { color: #B76514; } margin: 0.5em; font-size: 1.1em; } -@media handheld, only screen and (min-width: 768px) { +@media only screen and (min-width: 768px) { #versioninfo { position: fixed; bottom: 0px; @@ -254,21 +260,16 @@ blockquote { blockquote p { font-size: 17px; font-weight: 300; - line-height: 1.25; + line-height: 1.4; } blockquote p:last-child { margin-bottom: 0; } -ul, -ol { - margin-top: 0; - margin-bottom: 10px; +ul, ol { + padding-left: 25px; } -ul ul, -ol ul, -ul ol, -ol ol { +ul ul, ol ul, ul ol, ol ol { margin-bottom: 0; } dl { @@ -280,6 +281,7 @@ dd { nav ul { list-style-type: none; + margin: 0; padding-left: 0px; } diff --git a/src/librustdoc/html/layout.rs b/src/librustdoc/html/layout.rs index 0b5ca604cc3..d0cfabc8c11 100644 --- a/src/librustdoc/html/layout.rs +++ b/src/librustdoc/html/layout.rs @@ -32,13 +32,13 @@ pub fn render<T: fmt::Show, S: fmt::Show>( r##"<!DOCTYPE html> <html lang="en"> <head> - <meta charset="utf-8" /> - <meta name="viewport" content="width=device-width, initial-scale=1.0" /> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="description" content="The {krate} library documentation."> <title>{title}</title> - <link href='http://fonts.googleapis.com/css?family=Inconsolata:400,700' + <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600' rel='stylesheet' type='text/css'> <link rel="stylesheet" type="text/css" href="{root_path}main.css"> @@ -54,7 +54,7 @@ r##"<!DOCTYPE html> <section class="sidebar"> {logo, select, none{} other{ - <a href='{root_path}{krate}/index.html'><img src='#' alt='' width='100px' /></a> + <a href='{root_path}{krate}/index.html'><img src='#' alt='' width='100'></a> }} {sidebar} @@ -66,7 +66,7 @@ r##"<!DOCTYPE html> <input class="search-input" name="search" autocomplete="off" placeholder="Search documentation..." - type="search" /> + type="search"> </div> </form> </nav> @@ -115,8 +115,7 @@ r##"<!DOCTYPE html> <script src="{root_path}main.js"></script> <script async src="{root_path}search-index.js"></script> </body> -</html> -"##, +</html>"##, content = *t, root_path = page.root_path, ty = page.ty, diff --git a/src/librustdoc/html/render.rs b/src/librustdoc/html/render.rs index f842c44dec8..1ea2d3fdf95 100644 --- a/src/librustdoc/html/render.rs +++ b/src/librustdoc/html/render.rs @@ -976,7 +976,7 @@ impl<'a> fmt::Show for Item<'a> { format!("{}-{}", self.item.source.loline, self.item.source.hiline) }; try!(write!(fmt.buf, - "<a class='source'\ + "<a class='source' \ href='{root}src/{krate}/{path}.html\\#{href}'>\ [src]</a>", root = self.cx.root_path, diff --git a/src/librustdoc/html/static/main.css b/src/librustdoc/html/static/main.css index 9a9b00e7d5d..9a0b9912373 100644 --- a/src/librustdoc/html/static/main.css +++ b/src/librustdoc/html/static/main.css @@ -13,31 +13,31 @@ font-family: 'Fira Sans'; font-style: normal; font-weight: 400; - src: local('Fira Sans'), url("http://rust-lang.org/fonts/FiraSans-Regular.woff") format('woff'); + src: local('Fira Sans'), url("http://www.rust-lang.org/fonts/FiraSans-Regular.woff") format('woff'); } @font-face { font-family: 'Fira Sans'; font-style: normal; font-weight: 500; - src: local('Fira Sans Medium'), url("http://rust-lang.org/fonts/FiraSans-Medium.woff") format('woff'); + src: local('Fira Sans Medium'), url("http://www.rust-lang.org/fonts/FiraSans-Medium.woff") format('woff'); } @font-face { font-family: 'Heuristica'; font-style: normal; font-weight: 400; - src: local('Heuristica Regular'), url("http://rust-lang.org/fonts/Heuristica-Regular.woff") format('woff'); + src: local('Heuristica Regular'), url("http://www.rust-lang.org/fonts/Heuristica-Regular.woff") format('woff'); } @font-face { font-family: 'Heuristica'; font-style: italic; font-weight: 400; - src: local('Heuristica Italic'), url("http://rust-lang.org/fonts/Heuristica-Italic.woff") format('woff'); + src: local('Heuristica Italic'), url("http://www.rust-lang.org/fonts/Heuristica-Italic.woff") format('woff'); } @font-face { font-family: 'Heuristica'; font-style: normal; font-weight: 700; - src: local('Heuristica Bold'), url("http://rust-lang.org/fonts/Heuristica-Bold.woff") format('woff'); + src: local('Heuristica Bold'), url("http://www.rust-lang.org/fonts/Heuristica-Bold.woff") format('woff'); } @import "normalize.css"; @@ -58,39 +58,46 @@ body { margin: 0; position: relative; padding: 10px 15px 20px 15px; - padding-bottom: 20px; } -h1, h2, h3, h4 { +h1, h2, h3:not(.impl), h4:not(.method) { color: black; font-weight: 500; margin: 30px 0 20px 0; - padding-bottom: 15px; + padding-bottom: 6px; } h1.fqn { border-bottom: 1px dashed #D5D5D5; margin-top: 0; } -h2, h3, h4 { +h2, h3:not(.impl), h4:not(.method) { border-bottom: 1px solid #DDDDDD; } -h2 code, h3 code, h4 code, .block a { - font-size: 1.2em; +h3.impl, h4.method { + font-weight: 600; + margin-top: 10px; + margin-bottom: 10px; +} +h3.impl { + margin-top: 15px; } -h1, h2, h3, h4, section.sidebar, a.source, .content a, .search-input { +h1, h2, h3, h4, section.sidebar, a.source, .content a.mod, .search-input { font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; } -ul { +ol, ul { padding-left: 25px; } +ul ul, ol ul, ul ol, ol ol { + margin-bottom: 0; +} p { margin: 0 0 1em 0; } code, pre { - font-family: Menlo, Monaco, Consolas, Inconsolata, "DejaVu Sans Mono", monospace; + font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace; } pre { font-size: 15px; @@ -194,9 +201,8 @@ nav.sub { } .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 { - margin-left: 0; margin: 40px 0 10px 0; - padding-bottom: 10px; + padding: 10px 0; border-bottom: 1px solid #DDD; } @@ -384,7 +390,7 @@ h3.section-link:hover a:after, h4.section-link:hover a:after, h5.section-link:hover a:after, h6.section-link:hover a:after { - content: ' § '; + content: '\2002\00a7\2002'; } /** Media Queries **/ |
