1
Fork 0

doc: unifying with rustdoc

Conflicts:
	src/doc/rust.md
This commit is contained in:
Adrien Tétar 2014-04-18 11:08:34 +09:00
parent fb9ea2eaca
commit c494a06064
4 changed files with 50 additions and 43 deletions

View file

@ -14,38 +14,38 @@
font-family: 'Fira Sans'; font-family: 'Fira Sans';
font-style: normal; font-style: normal;
font-weight: 400; 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-face {
font-family: 'Fira Sans'; font-family: 'Fira Sans';
font-style: normal; font-style: normal;
font-weight: 500; 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-face {
font-family: 'Heuristica'; font-family: 'Heuristica';
font-style: normal; font-style: normal;
font-weight: 400; 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-face {
font-family: 'Heuristica'; font-family: 'Heuristica';
font-style: italic; font-style: italic;
font-weight: 400; 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-face {
font-family: 'Heuristica'; font-family: 'Heuristica';
font-style: normal; font-style: normal;
font-weight: 700; 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 /* Global page semantics
========================================================================== */ ========================================================================== */
body { body {
margin: 0 auto; margin: 0 auto;
padding: 0 15px; padding: 0 15px;
font-family: Heuristica, "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: "Heuristica", "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 18px; font-size: 18px;
color: #333; color: #333;
line-height: 1.428571429; line-height: 1.428571429;
@ -66,9 +66,16 @@ h1, h2, h3, h4, h5, h6 {
} }
h1, h2, h3 { h1, h2, h3 {
margin-top: 20px; margin-top: 20px;
margin-bottom: 10px; margin-bottom: 15px;
}
h1 {
margin-bottom: 20px;
} }
@media (min-width: 1170px) { @media (min-width: 1170px) {
h1 {
margin-top: 40px;
margin-bottom: 30px;
}
h1, h2, h3 { h1, h2, h3 {
margin-top: 30px; margin-top: 30px;
margin-bottom: 15px; margin-bottom: 15px;
@ -87,7 +94,6 @@ h1 {
font-size: 28px; font-size: 28px;
font-weight: 500; font-weight: 500;
padding: .1em .4em; padding: .1em .4em;
margin: 0.67em 0;
border-bottom: 2px solid #ddd; border-bottom: 2px solid #ddd;
} }
h1.title { h1.title {
@ -227,7 +233,7 @@ pre.rust .lifetime { color: #B76514; }
margin: 0.5em; margin: 0.5em;
font-size: 1.1em; font-size: 1.1em;
} }
@media handheld, only screen and (min-width: 768px) { @media only screen and (min-width: 768px) {
#versioninfo { #versioninfo {
position: fixed; position: fixed;
bottom: 0px; bottom: 0px;
@ -254,21 +260,16 @@ blockquote {
blockquote p { blockquote p {
font-size: 17px; font-size: 17px;
font-weight: 300; font-weight: 300;
line-height: 1.25; line-height: 1.4;
} }
blockquote p:last-child { blockquote p:last-child {
margin-bottom: 0; margin-bottom: 0;
} }
ul, ul, ol {
ol { padding-left: 25px;
margin-top: 0;
margin-bottom: 10px;
} }
ul ul, ul ul, ol ul, ul ol, ol ol {
ol ul,
ul ol,
ol ol {
margin-bottom: 0; margin-bottom: 0;
} }
dl { dl {
@ -280,6 +281,7 @@ dd {
nav ul { nav ul {
list-style-type: none; list-style-type: none;
margin: 0;
padding-left: 0px; padding-left: 0px;
} }

View file

@ -32,13 +32,13 @@ pub fn render<T: fmt::Show, S: fmt::Show>(
r##"<!DOCTYPE html> r##"<!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="utf-8" /> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="The {krate} library documentation."> <meta name="description" content="The {krate} library documentation.">
<title>{title}</title> <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'> rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="{root_path}main.css"> <link rel="stylesheet" type="text/css" href="{root_path}main.css">
@ -54,7 +54,7 @@ r##"<!DOCTYPE html>
<section class="sidebar"> <section class="sidebar">
{logo, select, none{} other{ {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} {sidebar}
@ -66,7 +66,7 @@ r##"<!DOCTYPE html>
<input class="search-input" name="search" <input class="search-input" name="search"
autocomplete="off" autocomplete="off"
placeholder="Search documentation..." placeholder="Search documentation..."
type="search" /> type="search">
</div> </div>
</form> </form>
</nav> </nav>
@ -115,8 +115,7 @@ r##"<!DOCTYPE html>
<script src="{root_path}main.js"></script> <script src="{root_path}main.js"></script>
<script async src="{root_path}search-index.js"></script> <script async src="{root_path}search-index.js"></script>
</body> </body>
</html> </html>"##,
"##,
content = *t, content = *t,
root_path = page.root_path, root_path = page.root_path,
ty = page.ty, ty = page.ty,

View file

@ -976,7 +976,7 @@ impl<'a> fmt::Show for Item<'a> {
format!("{}-{}", self.item.source.loline, self.item.source.hiline) format!("{}-{}", self.item.source.loline, self.item.source.hiline)
}; };
try!(write!(fmt.buf, try!(write!(fmt.buf,
"<a class='source'\ "<a class='source' \
href='{root}src/{krate}/{path}.html\\#{href}'>\ href='{root}src/{krate}/{path}.html\\#{href}'>\
[src]</a>", [src]</a>",
root = self.cx.root_path, root = self.cx.root_path,

View file

@ -13,31 +13,31 @@
font-family: 'Fira Sans'; font-family: 'Fira Sans';
font-style: normal; font-style: normal;
font-weight: 400; 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-face {
font-family: 'Fira Sans'; font-family: 'Fira Sans';
font-style: normal; font-style: normal;
font-weight: 500; 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-face {
font-family: 'Heuristica'; font-family: 'Heuristica';
font-style: normal; font-style: normal;
font-weight: 400; 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-face {
font-family: 'Heuristica'; font-family: 'Heuristica';
font-style: italic; font-style: italic;
font-weight: 400; 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-face {
font-family: 'Heuristica'; font-family: 'Heuristica';
font-style: normal; font-style: normal;
font-weight: 700; 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"; @import "normalize.css";
@ -58,39 +58,46 @@ body {
margin: 0; margin: 0;
position: relative; position: relative;
padding: 10px 15px 20px 15px; padding: 10px 15px 20px 15px;
padding-bottom: 20px;
} }
h1, h2, h3, h4 { h1, h2, h3:not(.impl), h4:not(.method) {
color: black; color: black;
font-weight: 500; font-weight: 500;
margin: 30px 0 20px 0; margin: 30px 0 20px 0;
padding-bottom: 15px; padding-bottom: 6px;
} }
h1.fqn { h1.fqn {
border-bottom: 1px dashed #D5D5D5; border-bottom: 1px dashed #D5D5D5;
margin-top: 0; margin-top: 0;
} }
h2, h3, h4 { h2, h3:not(.impl), h4:not(.method) {
border-bottom: 1px solid #DDDDDD; border-bottom: 1px solid #DDDDDD;
} }
h2 code, h3 code, h4 code, .block a { h3.impl, h4.method {
font-size: 1.2em; font-weight: 600;
margin-top: 10px;
margin-bottom: 10px;
} }
h1, h2, h3, h4, section.sidebar, a.source, .content a, .search-input { h3.impl {
margin-top: 15px;
}
h1, h2, h3, h4, section.sidebar, a.source, .content a.mod, .search-input {
font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
} }
ul { ol, ul {
padding-left: 25px; padding-left: 25px;
} }
ul ul, ol ul, ul ol, ol ol {
margin-bottom: 0;
}
p { p {
margin: 0 0 1em 0; margin: 0 0 1em 0;
} }
code, pre { 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 { pre {
font-size: 15px; font-size: 15px;
@ -194,9 +201,8 @@ nav.sub {
} }
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 { .docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
margin-left: 0;
margin: 40px 0 10px 0; margin: 40px 0 10px 0;
padding-bottom: 10px; padding: 10px 0;
border-bottom: 1px solid #DDD; border-bottom: 1px solid #DDD;
} }
@ -384,7 +390,7 @@ h3.section-link:hover a:after,
h4.section-link:hover a:after, h4.section-link:hover a:after,
h5.section-link:hover a:after, h5.section-link:hover a:after,
h6.section-link:hover a:after { h6.section-link:hover a:after {
content: ' § '; content: '\2002\00a7\2002';
} }
/** Media Queries **/ /** Media Queries **/