Skip to content

Commit c494a06

Browse files
committed
doc: unifying with rustdoc
Conflicts: src/doc/rust.md
1 parent fb9ea2e commit c494a06

File tree

4 files changed

+50
-43
lines changed

4 files changed

+50
-43
lines changed

src/doc/rust.css

+20-18
Original file line numberDiff line numberDiff line change
@@ -14,38 +14,38 @@
1414
font-family: 'Fira Sans';
1515
font-style: normal;
1616
font-weight: 400;
17-
src: local('Fira Sans'), url("http://rust-lang.org/fonts/FiraSans-Regular.woff") format('woff');
17+
src: local('Fira Sans'), url("http://www.rust-lang.org/fonts/FiraSans-Regular.woff") format('woff');
1818
}
1919
@font-face {
2020
font-family: 'Fira Sans';
2121
font-style: normal;
2222
font-weight: 500;
23-
src: local('Fira Sans Medium'), url("http://rust-lang.org/fonts/FiraSans-Medium.woff") format('woff');
23+
src: local('Fira Sans Medium'), url("http://www.rust-lang.org/fonts/FiraSans-Medium.woff") format('woff');
2424
}
2525
@font-face {
2626
font-family: 'Heuristica';
2727
font-style: normal;
2828
font-weight: 400;
29-
src: local('Heuristica Regular'), url("http://rust-lang.org/fonts/Heuristica-Regular.woff") format('woff');
29+
src: local('Heuristica Regular'), url("http://www.rust-lang.org/fonts/Heuristica-Regular.woff") format('woff');
3030
}
3131
@font-face {
3232
font-family: 'Heuristica';
3333
font-style: italic;
3434
font-weight: 400;
35-
src: local('Heuristica Italic'), url("http://rust-lang.org/fonts/Heuristica-Italic.woff") format('woff');
35+
src: local('Heuristica Italic'), url("http://www.rust-lang.org/fonts/Heuristica-Italic.woff") format('woff');
3636
}
3737
@font-face {
3838
font-family: 'Heuristica';
3939
font-style: normal;
4040
font-weight: 700;
41-
src: local('Heuristica Bold'), url("http://rust-lang.org/fonts/Heuristica-Bold.woff") format('woff');
41+
src: local('Heuristica Bold'), url("http://www.rust-lang.org/fonts/Heuristica-Bold.woff") format('woff');
4242
}
4343
/* Global page semantics
4444
========================================================================== */
4545
body {
4646
margin: 0 auto;
4747
padding: 0 15px;
48-
font-family: Heuristica, "Helvetica Neue", Helvetica, Arial, sans-serif;
48+
font-family: "Heuristica", "Helvetica Neue", Helvetica, Arial, sans-serif;
4949
font-size: 18px;
5050
color: #333;
5151
line-height: 1.428571429;
@@ -66,9 +66,16 @@ h1, h2, h3, h4, h5, h6 {
6666
}
6767
h1, h2, h3 {
6868
margin-top: 20px;
69-
margin-bottom: 10px;
69+
margin-bottom: 15px;
70+
}
71+
h1 {
72+
margin-bottom: 20px;
7073
}
7174
@media (min-width: 1170px) {
75+
h1 {
76+
margin-top: 40px;
77+
margin-bottom: 30px;
78+
}
7279
h1, h2, h3 {
7380
margin-top: 30px;
7481
margin-bottom: 15px;
@@ -87,7 +94,6 @@ h1 {
8794
font-size: 28px;
8895
font-weight: 500;
8996
padding: .1em .4em;
90-
margin: 0.67em 0;
9197
border-bottom: 2px solid #ddd;
9298
}
9399
h1.title {
@@ -227,7 +233,7 @@ pre.rust .lifetime { color: #B76514; }
227233
margin: 0.5em;
228234
font-size: 1.1em;
229235
}
230-
@media handheld, only screen and (min-width: 768px) {
236+
@media only screen and (min-width: 768px) {
231237
#versioninfo {
232238
position: fixed;
233239
bottom: 0px;
@@ -254,21 +260,16 @@ blockquote {
254260
blockquote p {
255261
font-size: 17px;
256262
font-weight: 300;
257-
line-height: 1.25;
263+
line-height: 1.4;
258264
}
259265
blockquote p:last-child {
260266
margin-bottom: 0;
261267
}
262268

263-
ul,
264-
ol {
265-
margin-top: 0;
266-
margin-bottom: 10px;
269+
ul, ol {
270+
padding-left: 25px;
267271
}
268-
ul ul,
269-
ol ul,
270-
ul ol,
271-
ol ol {
272+
ul ul, ol ul, ul ol, ol ol {
272273
margin-bottom: 0;
273274
}
274275
dl {
@@ -280,6 +281,7 @@ dd {
280281

281282
nav ul {
282283
list-style-type: none;
284+
margin: 0;
283285
padding-left: 0px;
284286
}
285287

src/librustdoc/html/layout.rs

+6-7
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ pub fn render<T: fmt::Show, S: fmt::Show>(
3232
r##"<!DOCTYPE html>
3333
<html lang="en">
3434
<head>
35-
<meta charset="utf-8" />
36-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
35+
<meta charset="utf-8">
36+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
3737
<meta name="description" content="The {krate} library documentation.">
3838
3939
<title>{title}</title>
4040
41-
<link href='http://fonts.googleapis.com/css?family=Inconsolata:400,700'
41+
<link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:400,600'
4242
rel='stylesheet' type='text/css'>
4343
<link rel="stylesheet" type="text/css" href="{root_path}main.css">
4444
@@ -54,7 +54,7 @@ r##"<!DOCTYPE html>
5454
5555
<section class="sidebar">
5656
{logo, select, none{} other{
57-
<a href='{root_path}{krate}/index.html'><img src='#' alt='' width='100px' /></a>
57+
<a href='{root_path}{krate}/index.html'><img src='#' alt='' width='100'></a>
5858
}}
5959
6060
{sidebar}
@@ -66,7 +66,7 @@ r##"<!DOCTYPE html>
6666
<input class="search-input" name="search"
6767
autocomplete="off"
6868
placeholder="Search documentation..."
69-
type="search" />
69+
type="search">
7070
</div>
7171
</form>
7272
</nav>
@@ -115,8 +115,7 @@ r##"<!DOCTYPE html>
115115
<script src="{root_path}main.js"></script>
116116
<script async src="{root_path}search-index.js"></script>
117117
</body>
118-
</html>
119-
"##,
118+
</html>"##,
120119
content = *t,
121120
root_path = page.root_path,
122121
ty = page.ty,

src/librustdoc/html/render.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -976,7 +976,7 @@ impl<'a> fmt::Show for Item<'a> {
976976
format!("{}-{}", self.item.source.loline, self.item.source.hiline)
977977
};
978978
try!(write!(fmt.buf,
979-
"<a class='source'\
979+
"<a class='source' \
980980
href='{root}src/{krate}/{path}.html\\#{href}'>\
981981
[src]</a>",
982982
root = self.cx.root_path,

src/librustdoc/html/static/main.css

+23-17
Original file line numberDiff line numberDiff line change
@@ -13,31 +13,31 @@
1313
font-family: 'Fira Sans';
1414
font-style: normal;
1515
font-weight: 400;
16-
src: local('Fira Sans'), url("http://rust-lang.org/fonts/FiraSans-Regular.woff") format('woff');
16+
src: local('Fira Sans'), url("http://www.rust-lang.org/fonts/FiraSans-Regular.woff") format('woff');
1717
}
1818
@font-face {
1919
font-family: 'Fira Sans';
2020
font-style: normal;
2121
font-weight: 500;
22-
src: local('Fira Sans Medium'), url("http://rust-lang.org/fonts/FiraSans-Medium.woff") format('woff');
22+
src: local('Fira Sans Medium'), url("http://www.rust-lang.org/fonts/FiraSans-Medium.woff") format('woff');
2323
}
2424
@font-face {
2525
font-family: 'Heuristica';
2626
font-style: normal;
2727
font-weight: 400;
28-
src: local('Heuristica Regular'), url("http://rust-lang.org/fonts/Heuristica-Regular.woff") format('woff');
28+
src: local('Heuristica Regular'), url("http://www.rust-lang.org/fonts/Heuristica-Regular.woff") format('woff');
2929
}
3030
@font-face {
3131
font-family: 'Heuristica';
3232
font-style: italic;
3333
font-weight: 400;
34-
src: local('Heuristica Italic'), url("http://rust-lang.org/fonts/Heuristica-Italic.woff") format('woff');
34+
src: local('Heuristica Italic'), url("http://www.rust-lang.org/fonts/Heuristica-Italic.woff") format('woff');
3535
}
3636
@font-face {
3737
font-family: 'Heuristica';
3838
font-style: normal;
3939
font-weight: 700;
40-
src: local('Heuristica Bold'), url("http://rust-lang.org/fonts/Heuristica-Bold.woff") format('woff');
40+
src: local('Heuristica Bold'), url("http://www.rust-lang.org/fonts/Heuristica-Bold.woff") format('woff');
4141
}
4242

4343
@import "normalize.css";
@@ -58,39 +58,46 @@ body {
5858
margin: 0;
5959
position: relative;
6060
padding: 10px 15px 20px 15px;
61-
padding-bottom: 20px;
6261
}
6362

64-
h1, h2, h3, h4 {
63+
h1, h2, h3:not(.impl), h4:not(.method) {
6564
color: black;
6665
font-weight: 500;
6766
margin: 30px 0 20px 0;
68-
padding-bottom: 15px;
67+
padding-bottom: 6px;
6968
}
7069
h1.fqn {
7170
border-bottom: 1px dashed #D5D5D5;
7271
margin-top: 0;
7372
}
74-
h2, h3, h4 {
73+
h2, h3:not(.impl), h4:not(.method) {
7574
border-bottom: 1px solid #DDDDDD;
7675
}
77-
h2 code, h3 code, h4 code, .block a {
78-
font-size: 1.2em;
76+
h3.impl, h4.method {
77+
font-weight: 600;
78+
margin-top: 10px;
79+
margin-bottom: 10px;
80+
}
81+
h3.impl {
82+
margin-top: 15px;
7983
}
80-
h1, h2, h3, h4, section.sidebar, a.source, .content a, .search-input {
84+
h1, h2, h3, h4, section.sidebar, a.source, .content a.mod, .search-input {
8185
font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
8286
}
8387

84-
ul {
88+
ol, ul {
8589
padding-left: 25px;
8690
}
91+
ul ul, ol ul, ul ol, ol ol {
92+
margin-bottom: 0;
93+
}
8794

8895
p {
8996
margin: 0 0 1em 0;
9097
}
9198

9299
code, pre {
93-
font-family: Menlo, Monaco, Consolas, Inconsolata, "DejaVu Sans Mono", monospace;
100+
font-family: "Source Code Pro", Menlo, Monaco, Consolas, "DejaVu Sans Mono", Inconsolata, monospace;
94101
}
95102
pre {
96103
font-size: 15px;
@@ -194,9 +201,8 @@ nav.sub {
194201
}
195202

196203
.docblock h1, .docblock h2, .docblock h3, .docblock h4, .docblock h5 {
197-
margin-left: 0;
198204
margin: 40px 0 10px 0;
199-
padding-bottom: 10px;
205+
padding: 10px 0;
200206
border-bottom: 1px solid #DDD;
201207
}
202208

@@ -384,7 +390,7 @@ h3.section-link:hover a:after,
384390
h4.section-link:hover a:after,
385391
h5.section-link:hover a:after,
386392
h6.section-link:hover a:after {
387-
content: ' § ';
393+
content: '\2002\00a7\2002';
388394
}
389395

390396
/** Media Queries **/

0 commit comments

Comments
 (0)