Skip to content

Commit fb9ea2e

Browse files
committedApr 19, 2014
doc: add webfonts and tweak the styles accordingly
1 parent 9503129 commit fb9ea2e

File tree

7 files changed

+129
-74
lines changed

7 files changed

+129
-74
lines changed
 

‎src/doc/full-toc.inc

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
<style>
22
/* Display the full TOC */
3-
#TOC ul ul {
3+
nav {
4+
column-count: auto;
5+
-moz-column-count: auto;
6+
-webkit-column-count: auto;
7+
}
8+
nav ul ul {
49
display: block;
510
padding-left: 2em;
611
}

‎src/doc/guide-lifetimes.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ it. It would violate memory safety for the box that was originally
236236
assigned to `x` to be garbage-collected, since a non-heap
237237
pointer *`y`* still points into it.
238238

239-
> ***Note:*** Our current implementation implements the garbage collector
239+
> *Note:* Our current implementation implements the garbage collector
240240
> using reference counting and cycle detection.
241241
242242
For this reason, whenever an `&` expression borrows the interior of a
@@ -674,7 +674,7 @@ Named lifetime notation can also be used to control the flow of execution:
674674
}
675675
~~~
676676

677-
> ***Note:*** Labelled breaks are not currently supported within `while` loops.
677+
> *Note:* Labelled breaks are not currently supported within `while` loops.
678678
679679
Named labels are hygienic and can be used safely within macros.
680680
See the macros guide section on hygiene for more details.

‎src/doc/guide-tasks.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ an `Error` result.
462462

463463
[`Result`]: std/result/index.html
464464

465-
> ***Note:*** A failed task does not currently produce a useful error
465+
> *Note:* A failed task does not currently produce a useful error
466466
> value (`try` always returns `Err(())`). In the
467467
> future, it may be possible for tasks to intercept the value passed to
468468
> `fail!()`.

‎src/doc/po/ja/tutorial.md.po

+12-12
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,11 @@ msgstr ""
196196
#. type: Plain text
197197
#: src/doc/tutorial.md:57
198198
msgid ""
199-
"> ***Warning:*** Rust is a language under ongoing development. Notes > about "
199+
"> *Warning:* Rust is a language under ongoing development. Notes > about "
200200
"potential changes to the language, implementation > deficiencies, and other "
201201
"caveats appear offset in blockquotes."
202202
msgstr ""
203-
"> ***警告:*** Rust は開発途上の言語です。将来予定されている言語への変更や、実"
203+
"> *警告:* Rust は開発途上の言語です。将来予定されている言語への変更や、実"
204204
"装上の不備、その他の注意事項など、 blockquote の段落 (この段落もそうです) に"
205205
"注意してください。"
206206

@@ -287,13 +287,13 @@ msgstr ""
287287
#. type: Plain text
288288
#: src/doc/tutorial.md:88
289289
msgid ""
290-
"> ***Note:*** Windows users should read the detailed > \"[getting started]"
290+
"> *Note:* Windows users should read the detailed > \"[getting started]"
291291
"[wiki-start]\" notes on the wiki. Even when using > the binary installer, "
292292
"the Windows build requires a MinGW installation, > the precise details of "
293293
"which are not discussed here. Finally, `rustc` may > need to be [referred to "
294294
"as `rustc.exe`][bug-3319]. It's a bummer, we > know."
295295
msgstr ""
296-
"> ***注意:*** Windows ユーザーは wiki の [getting started][wiki-start] の記事"
296+
"> *注意:* Windows ユーザーは wiki の [getting started][wiki-start] の記事"
297297
"を読んでください。 本書では詳細を説明しませんが、インストーラを利用する場合で"
298298
"も、MinGW のインストールなど、追加の手順が必要です。また、コンパイラは "
299299
"`rustc` ではなく、 [`rustc.exe` として呼び出す必要がある][bug-3319] かもしれ"
@@ -1254,11 +1254,11 @@ msgstr ""
12541254
#. type: Plain text
12551255
#: src/doc/tutorial.md:504
12561256
msgid ""
1257-
"> ***Note:*** The following code makes use of tuples (`(f64, f64)`) which > "
1257+
"> *Note:* The following code makes use of tuples (`(f64, f64)`) which > "
12581258
"are explained in section 5.3. For now you can think of tuples as a list of > "
12591259
"items."
12601260
msgstr ""
1261-
"> ***注意:*** 以下のコード例では5.3 節で説明されるタプル (`(f64, f64)`) を"
1261+
"> *注意:* 以下のコード例では5.3 節で説明されるタプル (`(f64, f64)`) を"
12621262
"使っています。現時点では、タプルは項目のリストのようなものだとみなしてくださ"
12631263
"い。"
12641264

@@ -3005,11 +3005,11 @@ msgstr ""
30053005
#. type: Plain text
30063006
#: src/doc/tutorial.md:1774
30073007
msgid ""
3008-
"> ***Note:*** Both the syntax and the semantics will be changing > in small "
3008+
"> *Note:* Both the syntax and the semantics will be changing > in small "
30093009
"ways. At the moment they can be unsound in some > scenarios, particularly "
30103010
"with non-copyable types."
30113011
msgstr ""
3012-
"> ***注意*** コードの文法と意味は将来的に変更されるかもしれません。現時点では"
3012+
"> *注意* コードの文法と意味は将来的に変更されるかもしれません。現時点では"
30133013
"いくつかの状況、特にコピーできない型が関連するケースにおいて望ましくない振る"
30143014
"舞いが起こされる場合があります。"
30153015

@@ -3660,10 +3660,10 @@ msgstr ""
36603660
#. type: Plain text
36613661
#: src/doc/tutorial.md:2099
36623662
msgid ""
3663-
"> ***Note:*** These two traits were referred to as 'kinds' in earlier > "
3663+
"> *Note:* These two traits were referred to as 'kinds' in earlier > "
36643664
"iterations of the language, and often still are."
36653665
msgstr ""
3666-
"> ***注意*** これら2つのトレイトは、以前は 「種」 (kind) と呼ばれており、現在"
3666+
"> *注意* これら2つのトレイトは、以前は 「種」 (kind) と呼ばれており、現在"
36673667
"でもそう呼ばれる場合があります。"
36683668

36693669
#. type: Plain text
@@ -4374,9 +4374,9 @@ msgstr ""
43744374

43754375
#. type: Plain text
43764376
#: src/doc/tutorial.md:2511
4377-
msgid "> ***Note:*** Trait inheritance does not actually work with objects yet"
4377+
msgid "> *Note:* Trait inheritance does not actually work with objects yet"
43784378
msgstr ""
4379-
"> ***注意*** トレイトの継承は、実際にはまだオブジェクトに対しては動作しませ"
4379+
"> *注意* トレイトの継承は、実際にはまだオブジェクトに対しては動作しませ"
43804380
"ん。"
43814381

43824382
#. type: Plain text

‎src/doc/rust.css

+79-22
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,43 @@
1010
* option. This file may not be copied, modified, or distributed
1111
* except according to those terms.
1212
*/
13+
@font-face {
14+
font-family: 'Fira Sans';
15+
font-style: normal;
16+
font-weight: 400;
17+
src: local('Fira Sans'), url("http://rust-lang.org/fonts/FiraSans-Regular.woff") format('woff');
18+
}
19+
@font-face {
20+
font-family: 'Fira Sans';
21+
font-style: normal;
22+
font-weight: 500;
23+
src: local('Fira Sans Medium'), url("http://rust-lang.org/fonts/FiraSans-Medium.woff") format('woff');
24+
}
25+
@font-face {
26+
font-family: 'Heuristica';
27+
font-style: normal;
28+
font-weight: 400;
29+
src: local('Heuristica Regular'), url("http://rust-lang.org/fonts/Heuristica-Regular.woff") format('woff');
30+
}
31+
@font-face {
32+
font-family: 'Heuristica';
33+
font-style: italic;
34+
font-weight: 400;
35+
src: local('Heuristica Italic'), url("http://rust-lang.org/fonts/Heuristica-Italic.woff") format('woff');
36+
}
37+
@font-face {
38+
font-family: 'Heuristica';
39+
font-style: normal;
40+
font-weight: 700;
41+
src: local('Heuristica Bold'), url("http://rust-lang.org/fonts/Heuristica-Bold.woff") format('woff');
42+
}
1343
/* Global page semantics
1444
========================================================================== */
1545
body {
1646
margin: 0 auto;
1747
padding: 0 15px;
18-
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
19-
font-size: 14px;
48+
font-family: Heuristica, "Helvetica Neue", Helvetica, Arial, sans-serif;
49+
font-size: 18px;
2050
color: #333;
2151
line-height: 1.428571429;
2252
}
@@ -26,24 +56,36 @@ body {
2656
}
2757
}
2858

59+
h1, h2, h3, h4, h5, h6, nav, #versioninfo {
60+
font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
61+
}
2962
h1, h2, h3, h4, h5, h6 {
3063
color: black;
31-
font-weight: 500;
64+
font-weight: 400;
3265
line-height: 1.1;
3366
}
3467
h1, h2, h3 {
3568
margin-top: 20px;
3669
margin-bottom: 10px;
3770
}
71+
@media (min-width: 1170px) {
72+
h1, h2, h3 {
73+
margin-top: 30px;
74+
margin-bottom: 15px;
75+
}
76+
}
3877
h4, h5, h6 {
3978
margin-top: 12px;
4079
margin-bottom: 10px;
41-
padding: .2em .8em;
80+
padding: 5px 10px;
81+
}
82+
h5, h6 {
4283
text-decoration: underline;
4384
}
4485

4586
h1 {
46-
font-size: 36px;
87+
font-size: 28px;
88+
font-weight: 500;
4789
padding: .1em .4em;
4890
margin: 0.67em 0;
4991
border-bottom: 2px solid #ddd;
@@ -52,7 +94,7 @@ h1.title {
5294
line-height: 1.5em;
5395
}
5496
h2 {
55-
font-size: 30px;
97+
font-size: 26px;
5698
padding: .2em .5em;
5799
border-bottom: 1px solid #ddd;
58100
}
@@ -62,17 +104,34 @@ h3 {
62104
border-bottom: 1px solid #DDE8FC;
63105
}
64106
h4 {
65-
font-size: 18px;
107+
font-size: 22px;
66108
}
67109
h5 {
68-
font-size: 16px;
110+
font-size: 20px;
69111
}
70112
h6 {
71-
font-size: 14px;
113+
font-size: 18px;
114+
}
115+
@media (min-width: 992px) {
116+
h1 {
117+
font-size: 36px;
118+
}
119+
h2 {
120+
font-size: 30px;
121+
}
122+
h3 {
123+
font-size: 26px;
124+
}
72125
}
73126

127+
nav {
128+
column-count: 2;
129+
-moz-column-count: 2;
130+
-webkit-column-count: 2;
131+
font-size: 15px;
132+
}
74133
p {
75-
margin: 0 0 10px;
134+
margin: 0 0 1em 0;
76135
}
77136

78137
strong {
@@ -85,10 +144,10 @@ em {
85144

86145
footer {
87146
border-top: 1px solid #ddd;
88-
font-size: 12px;
147+
font-size: 14.3px;
89148
font-style: italic;
90-
padding-top: 4px;
91-
margin-top: 4em;
149+
padding-top: 5px;
150+
margin-top: 3em;
92151
margin-bottom: 1em;
93152
}
94153

@@ -130,16 +189,14 @@ pre {
130189
border-radius: 0.5em;
131190
white-space: pre-wrap;
132191
padding: 9.5px;
133-
margin: 10px 0;
192+
margin: 20px 0;
134193
font-size: 13px;
135194
word-break: break-all;
136195
word-wrap: break-word;
137196
}
138197
code {
139-
padding: 2px 4px;
140-
font-size: 90%;
141-
color: #C7254E;
142-
background-color: #F9F2F4;
198+
padding: 0 2px;
199+
color: #8D1A38;
143200
white-space: nowrap;
144201
}
145202
pre code {
@@ -170,7 +227,7 @@ pre.rust .lifetime { color: #B76514; }
170227
margin: 0.5em;
171228
font-size: 1.1em;
172229
}
173-
@media only screen, handheld and (min-width: 768px) {
230+
@media handheld, only screen and (min-width: 768px) {
174231
#versioninfo {
175232
position: fixed;
176233
bottom: 0px;
@@ -185,7 +242,7 @@ pre.rust .lifetime { color: #B76514; }
185242
}
186243
#versioninfo a.hash {
187244
color: gray;
188-
font-size: 70%;
245+
font-size: 80%;
189246
}
190247

191248
blockquote {
@@ -221,13 +278,13 @@ dd {
221278
margin-left: 0;
222279
}
223280

224-
#TOC ul {
281+
nav ul {
225282
list-style-type: none;
226283
padding-left: 0px;
227284
}
228285

229286
/* Only display one level of hierarchy in the TOC */
230-
#TOC ul ul {
287+
nav ul ul {
231288
display: none;
232289
}
233290

0 commit comments

Comments
 (0)
Please sign in to comment.