auto merge of #13744 : adrientetar/rust/derp, r=brson

- Serve webfonts locally
- Style changes around `blockquote` and `code`
- Minor adjustments from previous changes

Bringing back updated examples: [modified tutorial](http://adrientetar.legtux.org/cached/rust-docs/tutorial.htm) and [modified manual](http://adrientetar.legtux.org/cached/rust-docs/manual.htm).
And for rustdoc, [modified `enum.FileType`](http://adrientetar.legtux.org/cached/rust-docs/enum.FileType.htm), [modified `std`](http://adrientetar.legtux.org/cached/rust-docs/std.htm) and [modified `std::io`](http://adrientetar.legtux.org/cached/rust-docs/io.htm).
This commit is contained in:
bors 2014-04-25 18:26:33 -07:00
commit 395d8857d6
11 changed files with 98 additions and 70 deletions

View File

@ -141,6 +141,26 @@ doc/footer.inc: $(D)/footer.inc | doc/
@$(call E, cp: $@)
$(Q)cp -a $< $@ 2> /dev/null
doc/FiraSans-Regular.woff: $(D)/FiraSans-Regular.woff | doc/
@$(call E, cp: $@)
$(Q)cp -a $< $@ 2> /dev/null
doc/FiraSans-Medium.woff: $(D)/FiraSans-Medium.woff | doc/
@$(call E, cp: $@)
$(Q)cp -a $< $@ 2> /dev/null
doc/Heuristica-Regular.woff: $(D)/Heuristica-Regular.woff | doc/
@$(call E, cp: $@)
$(Q)cp -a $< $@ 2> /dev/null
doc/Heuristica-Italic.woff: $(D)/Heuristica-Italic.woff | doc/
@$(call E, cp: $@)
$(Q)cp -a $< $@ 2> /dev/null
doc/Heuristica-Bold.woff: $(D)/Heuristica-Bold.woff | doc/
@$(call E, cp: $@)
$(Q)cp -a $< $@ 2> /dev/null
# The (english) documentation for each doc item.
define DEF_SHOULD_BUILD_PDF_DOC

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1 +1,3 @@
<link rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico" />
<link rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico">
<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:400'
rel='stylesheet' type='text/css'>

View File

@ -14,34 +14,41 @@
font-family: 'Fira Sans';
font-style: normal;
font-weight: 400;
src: local('Fira Sans'), url("http://www.rust-lang.org/fonts/FiraSans-Regular.woff") format('woff');
src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff');
}
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 500;
src: local('Fira Sans Medium'), url("http://www.rust-lang.org/fonts/FiraSans-Medium.woff") format('woff');
src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff');
}
@font-face {
font-family: 'Heuristica';
font-style: normal;
font-weight: 400;
src: local('Heuristica Regular'), url("http://www.rust-lang.org/fonts/Heuristica-Regular.woff") format('woff');
src: local('Heuristica Regular'), url("Heuristica-Regular.woff") format('woff');
}
@font-face {
font-family: 'Heuristica';
font-style: italic;
font-weight: 400;
src: local('Heuristica Italic'), url("http://www.rust-lang.org/fonts/Heuristica-Italic.woff") format('woff');
src: local('Heuristica Italic'), url("Heuristica-Italic.woff") format('woff');
}
@font-face {
font-family: 'Heuristica';
font-style: normal;
font-weight: 700;
src: local('Heuristica Bold'), url("http://www.rust-lang.org/fonts/Heuristica-Bold.woff") format('woff');
src: local('Heuristica Bold'), url("Heuristica-Bold.woff") format('woff');
}
/* Global page semantics
========================================================================== */
*:not(body) {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
/* General structure */
body {
margin: 0 auto;
padding: 0 15px;
@ -71,16 +78,6 @@ h1, h2, h3 {
h1 {
margin-bottom: 20px;
}
@media (min-width: 1170px) {
h1 {
margin-top: 40px;
margin-bottom: 30px;
}
h1, h2, h3 {
margin-top: 30px;
margin-bottom: 15px;
}
}
h4, h5, h6 {
margin-top: 12px;
margin-bottom: 10px;
@ -157,8 +154,8 @@ footer {
margin-bottom: 1em;
}
/* Links layout
========================================================================== */
/* Links layout */
a {
text-decoration: none;
color: #428BCA;
@ -183,18 +180,16 @@ h5 a:link, h5 a:visited {color: black;}
h1 a:hover, h2 a:hover, h3 a:hover, h4 a:hover,
h5 a:hover {text-decoration: none;}
/* Code
========================================================================== */
/* Code */
pre, code {
font-family: Menlo, Monaco, Consolas, "DejaVu Sans Mono", monospace;
border-radius: 4px;
font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", monospace;
}
pre {
background-color: #FDFDFD;
border: 1px solid #CCC;
border-radius: 0.5em;
border-left: 2px solid #eee;
white-space: pre-wrap;
padding: 9.5px;
padding: 14px;
padding-right: 0;
margin: 20px 0;
font-size: 13px;
word-break: break-all;
@ -203,15 +198,12 @@ pre {
code {
padding: 0 2px;
color: #8D1A38;
white-space: nowrap;
white-space: pre-wrap;
}
pre code {
padding: 0;
font-size: inherit;
color: inherit;
white-space: pre-wrap;
background-color: transparent;
border-radius: 0;
}
/* Code highlighting */
@ -225,16 +217,16 @@ pre.rust .doccomment { color: #4D4D4C; }
pre.rust .macro, pre.rust .macro-nonterminal { color: #3E999F; }
pre.rust .lifetime { color: #B76514; }
/* The rest */
/* The rest
========================================================================== */
#versioninfo {
text-align: center;
margin: 0.5em;
font-size: 1.1em;
}
@media only screen and (min-width: 768px) {
@media (min-width: 992px) {
#versioninfo {
font-size: 0.8em;
position: fixed;
bottom: 0px;
right: 0px;
@ -243,7 +235,7 @@ pre.rust .lifetime { color: #B76514; }
background-color: #fff;
margin: 2px;
padding: 0 2px;
border-radius: .3em;
border-radius: .2em;
}
}
#versioninfo a.hash {
@ -252,10 +244,12 @@ pre.rust .lifetime { color: #B76514; }
}
blockquote {
color: black;
border-left: 5px solid #eee;
margin: 0 0 20px;
padding: 10px 20px;
color: #000;
margin: 20px 0;
padding: 15px 20px;
background-color: #f2f7f9;
border-top: .1em solid #e5eef2;
border-bottom: .1em solid #e5eef2;
}
blockquote p {
font-size: 17px;
@ -319,6 +313,12 @@ table th {
padding: 5px;
}
@media (min-width: 1170px) {
pre {
font-size: 15px;
}
}
@media print {
* {
text-shadow: none !important;

View File

@ -38,11 +38,11 @@ r##"<!DOCTYPE html>
<title>{title}</title>
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600'
<link href='http://fonts.googleapis.com/css?family=Source+Code+Pro:400,600'
rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="{root_path}main.css">
{favicon, select, none{} other{<link rel="shortcut icon" href="#" />}}
{favicon, select, none{} other{<link rel="shortcut icon" href="#">}}
</head>
<body>
<!--[if lte IE 8]>

View File

@ -924,19 +924,6 @@ impl<'a> Item<'a> {
impl<'a> fmt::Show for Item<'a> {
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
match attr::find_stability(self.item.attrs.iter()) {
Some(ref stability) => {
try!(write!(fmt.buf,
"<a class='stability {lvl}' title='{reason}'>{lvl}</a>",
lvl = stability.level.to_str(),
reason = match stability.text {
Some(ref s) => (*s).clone(),
None => InternedString::new(""),
}));
}
None => {}
}
// Write the breadcrumb trail header for the top
try!(write!(fmt.buf, "\n<h1 class='fqn'>"));
match self.item.inner {
@ -964,6 +951,21 @@ impl<'a> fmt::Show for Item<'a> {
try!(write!(fmt.buf, "<a class='{}' href=''>{}</a>",
shortty(self.item), self.item.name.get_ref().as_slice()));
// Write stability attributes
match attr::find_stability(self.item.attrs.iter()) {
Some(ref stability) => {
try!(write!(fmt.buf,
"<a class='stability {lvl}' title='{reason}'>{lvl}</a>",
lvl = stability.level.to_str(),
reason = match stability.text {
Some(ref s) => (*s).clone(),
None => InternedString::new(""),
}));
}
None => {}
}
// Write `src` tag
if self.cx.include_sources {
let mut path = Vec::new();
clean_srcpath(self.item.source.filename.as_bytes(), |component| {

View File

@ -13,31 +13,31 @@
font-family: 'Fira Sans';
font-style: normal;
font-weight: 400;
src: local('Fira Sans'), url("http://www.rust-lang.org/fonts/FiraSans-Regular.woff") format('woff');
src: local('Fira Sans'), url("FiraSans-Regular.woff") format('woff');
}
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 500;
src: local('Fira Sans Medium'), url("http://www.rust-lang.org/fonts/FiraSans-Medium.woff") format('woff');
src: local('Fira Sans Medium'), url("FiraSans-Medium.woff") format('woff');
}
@font-face {
font-family: 'Heuristica';
font-style: normal;
font-weight: 400;
src: local('Heuristica Regular'), url("http://www.rust-lang.org/fonts/Heuristica-Regular.woff") format('woff');
src: local('Heuristica Regular'), url("Heuristica-Regular.woff") format('woff');
}
@font-face {
font-family: 'Heuristica';
font-style: italic;
font-weight: 400;
src: local('Heuristica Italic'), url("http://www.rust-lang.org/fonts/Heuristica-Italic.woff") format('woff');
src: local('Heuristica Italic'), url("Heuristica-Italic.woff") format('woff');
}
@font-face {
font-family: 'Heuristica';
font-style: normal;
font-weight: 700;
src: local('Heuristica Bold'), url("http://www.rust-lang.org/fonts/Heuristica-Bold.woff") format('woff');
src: local('Heuristica Bold'), url("Heuristica-Bold.woff") format('woff');
}
@import "normalize.css";
@ -63,7 +63,7 @@ body {
h1, h2, h3:not(.impl), h4:not(.method) {
color: black;
font-weight: 500;
margin: 30px 0 20px 0;
margin: 30px 0 15px 0;
padding-bottom: 6px;
}
h1.fqn {
@ -81,7 +81,7 @@ h3.impl, h4.method {
h3.impl {
margin-top: 15px;
}
h1, h2, h3, h4, section.sidebar, a.source, .content a.mod, .search-input {
h1, h2, h3, h4, section.sidebar, a.source, .search-input, .content table a {
font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
@ -98,9 +98,18 @@ p {
code, pre {
font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
white-space: pre-wrap;
}
pre {
font-size: 15px;
padding: 14px;
padding-right: 0;
border-left: 2px solid #eee;
}
.source pre {
border-left: none;
padding: 20px;
}
nav.sub {
@ -164,7 +173,6 @@ nav.sub {
padding: 20px 0;
}
.content pre { padding: 20px; }
.content.source pre.rust {
white-space: pre;
overflow: auto;
@ -201,8 +209,7 @@ nav.sub {
}
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
margin: 40px 0 10px 0;
padding: 10px 0;
margin: 30px 0 15px 0;
border-bottom: 1px solid #DDD;
}
@ -356,10 +363,9 @@ a {
.stability {
border-left: 6px solid #000;
border-radius: 3px;
padding: 8px 3px 8px 10px;
padding: 2px 10px;
text-transform: lowercase;
display: block;
margin-bottom: 20px;
margin-left: 10px;
}
.stability.Deprecated { border-color: #D60027; color: #880017; }
@ -371,8 +377,6 @@ a {
:target { background: #FDFFD3; }
pre.rust, pre.line-numbers { background-color: #F5F5F5; }
/* Code highlighting */
pre.rust .kw { color: #8959A8; }
pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }