Skip to content

Commit

Permalink
doc: unifying with rustdoc
Browse files Browse the repository at this point in the history
Conflicts:
	src/doc/rust.md
  • Loading branch information
adrientetar committed Apr 20, 2014
1 parent fb9ea2e commit c494a06
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 43 deletions.
38 changes: 20 additions & 18 deletions src/doc/rust.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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 {
Expand Down Expand Up @@ -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;
Expand All @@ -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 {
Expand All @@ -280,6 +281,7 @@ dd {

nav ul {
list-style-type: none;
margin: 0;
padding-left: 0px;
}

Expand Down
13 changes: 6 additions & 7 deletions src/librustdoc/html/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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">
Expand All @@ -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}
Expand All @@ -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>
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/html/render.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
40 changes: 23 additions & 17 deletions src/librustdoc/html/static/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}

Expand Down Expand Up @@ -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 **/
Expand Down

0 comments on commit c494a06

Please sign in to comment.