mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
rustdoc: bring it inline
This commit is contained in:
parent
c9d995d384
commit
b3577a10f3
@ -41,7 +41,7 @@
|
|||||||
src: local('Heuristica Bold'), url("Heuristica-Bold.woff") format('woff');
|
src: local('Heuristica Bold'), url("Heuristica-Bold.woff") format('woff');
|
||||||
}
|
}
|
||||||
|
|
||||||
* {
|
*:not(body) {
|
||||||
-webkit-box-sizing: border-box;
|
-webkit-box-sizing: border-box;
|
||||||
-moz-box-sizing: border-box;
|
-moz-box-sizing: border-box;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
@ -78,16 +78,6 @@ h1, h2, h3 {
|
|||||||
h1 {
|
h1 {
|
||||||
margin-bottom: 20px;
|
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 {
|
h4, h5, h6 {
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
@ -197,7 +187,6 @@ pre, code {
|
|||||||
}
|
}
|
||||||
pre {
|
pre {
|
||||||
border-left: 2px solid #eee;
|
border-left: 2px solid #eee;
|
||||||
border-radius: 0;
|
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
padding: 14px;
|
padding: 14px;
|
||||||
padding-right: 0;
|
padding-right: 0;
|
||||||
@ -209,14 +198,12 @@ pre {
|
|||||||
code {
|
code {
|
||||||
padding: 0 2px;
|
padding: 0 2px;
|
||||||
color: #8D1A38;
|
color: #8D1A38;
|
||||||
white-space: nowrap;
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
pre code {
|
pre code {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
font-size: inherit;
|
font-size: inherit;
|
||||||
color: inherit;
|
color: inherit;
|
||||||
white-space: pre-wrap;
|
|
||||||
background-color: transparent;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Code highlighting */
|
/* Code highlighting */
|
||||||
@ -237,7 +224,7 @@ pre.rust .lifetime { color: #B76514; }
|
|||||||
margin: 0.5em;
|
margin: 0.5em;
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
}
|
}
|
||||||
@media (min-width: 768px) {
|
@media (min-width: 992px) {
|
||||||
#versioninfo {
|
#versioninfo {
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
@ -248,7 +235,7 @@ pre.rust .lifetime { color: #B76514; }
|
|||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
margin: 2px;
|
margin: 2px;
|
||||||
padding: 0 2px;
|
padding: 0 2px;
|
||||||
border-radius: .3em;
|
border-radius: .2em;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#versioninfo a.hash {
|
#versioninfo a.hash {
|
||||||
|
@ -924,19 +924,6 @@ impl<'a> Item<'a> {
|
|||||||
|
|
||||||
impl<'a> fmt::Show for Item<'a> {
|
impl<'a> fmt::Show for Item<'a> {
|
||||||
fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
|
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
|
// Write the breadcrumb trail header for the top
|
||||||
try!(write!(fmt.buf, "\n<h1 class='fqn'>"));
|
try!(write!(fmt.buf, "\n<h1 class='fqn'>"));
|
||||||
match self.item.inner {
|
match self.item.inner {
|
||||||
@ -964,6 +951,21 @@ impl<'a> fmt::Show for Item<'a> {
|
|||||||
try!(write!(fmt.buf, "<a class='{}' href=''>{}</a>",
|
try!(write!(fmt.buf, "<a class='{}' href=''>{}</a>",
|
||||||
shortty(self.item), self.item.name.get_ref().as_slice()));
|
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 {
|
if self.cx.include_sources {
|
||||||
let mut path = Vec::new();
|
let mut path = Vec::new();
|
||||||
clean_srcpath(self.item.source.filename.as_bytes(), |component| {
|
clean_srcpath(self.item.source.filename.as_bytes(), |component| {
|
||||||
|
@ -98,9 +98,18 @@ p {
|
|||||||
|
|
||||||
code, pre {
|
code, pre {
|
||||||
font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
|
font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
|
||||||
|
white-space: pre-wrap;
|
||||||
}
|
}
|
||||||
pre {
|
pre {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
|
padding: 14px;
|
||||||
|
padding-right: 0;
|
||||||
|
border-left: 2px solid #eee;
|
||||||
|
}
|
||||||
|
|
||||||
|
.source pre {
|
||||||
|
border-left: none;
|
||||||
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
nav.sub {
|
nav.sub {
|
||||||
@ -164,7 +173,6 @@ nav.sub {
|
|||||||
padding: 20px 0;
|
padding: 20px 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.content pre { padding: 14px; }
|
|
||||||
.content.source pre.rust {
|
.content.source pre.rust {
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
@ -355,10 +363,9 @@ a {
|
|||||||
.stability {
|
.stability {
|
||||||
border-left: 6px solid #000;
|
border-left: 6px solid #000;
|
||||||
border-radius: 3px;
|
border-radius: 3px;
|
||||||
padding: 8px 3px 8px 10px;
|
padding: 2px 10px;
|
||||||
text-transform: lowercase;
|
text-transform: lowercase;
|
||||||
display: block;
|
margin-left: 10px;
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.stability.Deprecated { border-color: #D60027; color: #880017; }
|
.stability.Deprecated { border-color: #D60027; color: #880017; }
|
||||||
@ -370,8 +377,6 @@ a {
|
|||||||
|
|
||||||
:target { background: #FDFFD3; }
|
:target { background: #FDFFD3; }
|
||||||
|
|
||||||
pre.rust, pre.line-numbers { background-color: #F5F5F5; }
|
|
||||||
|
|
||||||
/* Code highlighting */
|
/* Code highlighting */
|
||||||
pre.rust .kw { color: #8959A8; }
|
pre.rust .kw { color: #8959A8; }
|
||||||
pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
|
pre.rust .kw-2, pre.rust .prelude-ty { color: #4271AE; }
|
||||||
|
Loading…
Reference in New Issue
Block a user