Skip to content

Commit e6c8c7c

Browse files
committed
auto merge of #13587 : adrientetar/rust/more-docs, r=brson
- Use Fira Sans for headlines, Heuristica for the body (Adobe Utopia derivative). Both are licensed under the SIL OFL license. (I didn't include BoldItalic because it is sparingly used.) - Split TOC into 2 columns for the docs except manual (too tall, too wide to be readable). - Some fixes to rustdoc, bring styles in coherency with eachother - A few tweaks Two examples: [modified tutorial](http://adrientetar.legtux.org/cached/rust-docs/tutorial.htm) and [modified manual](http://adrientetar.legtux.org/cached/rust-docs/manual.htm). Rustdoc got some fixes, here is [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). #13484, #13485 follow-up. cc @brson
2 parents 960bf8c + c494a06 commit e6c8c7c

File tree

10 files changed

+172
-110
lines changed

10 files changed

+172
-110
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
@@ -456,7 +456,7 @@ an `Error` result.
456456

457457
[`Result`]: std/result/index.html
458458

459-
> ***Note:*** A failed task does not currently produce a useful error
459+
> *Note:* A failed task does not currently produce a useful error
460460
> value (`try` always returns `Err(())`). In the
461461
> future, it may be possible for tasks to intercept the value passed to
462462
> `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

+92-33
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://www.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://www.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://www.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://www.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://www.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,33 +56,51 @@ 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;
36-
margin-bottom: 10px;
69+
margin-bottom: 15px;
70+
}
71+
h1 {
72+
margin-bottom: 20px;
73+
}
74+
@media (min-width: 1170px) {
75+
h1 {
76+
margin-top: 40px;
77+
margin-bottom: 30px;
78+
}
79+
h1, h2, h3 {
80+
margin-top: 30px;
81+
margin-bottom: 15px;
82+
}
3783
}
3884
h4, h5, h6 {
3985
margin-top: 12px;
4086
margin-bottom: 10px;
41-
padding: .2em .8em;
87+
padding: 5px 10px;
88+
}
89+
h5, h6 {
4290
text-decoration: underline;
4391
}
4492

4593
h1 {
46-
font-size: 36px;
94+
font-size: 28px;
95+
font-weight: 500;
4796
padding: .1em .4em;
48-
margin: 0.67em 0;
4997
border-bottom: 2px solid #ddd;
5098
}
5199
h1.title {
52100
line-height: 1.5em;
53101
}
54102
h2 {
55-
font-size: 30px;
103+
font-size: 26px;
56104
padding: .2em .5em;
57105
border-bottom: 1px solid #ddd;
58106
}
@@ -62,17 +110,34 @@ h3 {
62110
border-bottom: 1px solid #DDE8FC;
63111
}
64112
h4 {
65-
font-size: 18px;
113+
font-size: 22px;
66114
}
67115
h5 {
68-
font-size: 16px;
116+
font-size: 20px;
69117
}
70118
h6 {
71-
font-size: 14px;
119+
font-size: 18px;
120+
}
121+
@media (min-width: 992px) {
122+
h1 {
123+
font-size: 36px;
124+
}
125+
h2 {
126+
font-size: 30px;
127+
}
128+
h3 {
129+
font-size: 26px;
130+
}
72131
}
73132

133+
nav {
134+
column-count: 2;
135+
-moz-column-count: 2;
136+
-webkit-column-count: 2;
137+
font-size: 15px;
138+
}
74139
p {
75-
margin: 0 0 10px;
140+
margin: 0 0 1em 0;
76141
}
77142

78143
strong {
@@ -85,10 +150,10 @@ em {
85150

86151
footer {
87152
border-top: 1px solid #ddd;
88-
font-size: 12px;
153+
font-size: 14.3px;
89154
font-style: italic;
90-
padding-top: 4px;
91-
margin-top: 4em;
155+
padding-top: 5px;
156+
margin-top: 3em;
92157
margin-bottom: 1em;
93158
}
94159

@@ -130,16 +195,14 @@ pre {
130195
border-radius: 0.5em;
131196
white-space: pre-wrap;
132197
padding: 9.5px;
133-
margin: 10px 0;
198+
margin: 20px 0;
134199
font-size: 13px;
135200
word-break: break-all;
136201
word-wrap: break-word;
137202
}
138203
code {
139-
padding: 2px 4px;
140-
font-size: 90%;
141-
color: #C7254E;
142-
background-color: #F9F2F4;
204+
padding: 0 2px;
205+
color: #8D1A38;
143206
white-space: nowrap;
144207
}
145208
pre code {
@@ -170,7 +233,7 @@ pre.rust .lifetime { color: #B76514; }
170233
margin: 0.5em;
171234
font-size: 1.1em;
172235
}
173-
@media only screen, handheld and (min-width: 768px) {
236+
@media only screen and (min-width: 768px) {
174237
#versioninfo {
175238
position: fixed;
176239
bottom: 0px;
@@ -185,7 +248,7 @@ pre.rust .lifetime { color: #B76514; }
185248
}
186249
#versioninfo a.hash {
187250
color: gray;
188-
font-size: 70%;
251+
font-size: 80%;
189252
}
190253

191254
blockquote {
@@ -197,21 +260,16 @@ blockquote {
197260
blockquote p {
198261
font-size: 17px;
199262
font-weight: 300;
200-
line-height: 1.25;
263+
line-height: 1.4;
201264
}
202265
blockquote p:last-child {
203266
margin-bottom: 0;
204267
}
205268

206-
ul,
207-
ol {
208-
margin-top: 0;
209-
margin-bottom: 10px;
269+
ul, ol {
270+
padding-left: 25px;
210271
}
211-
ul ul,
212-
ol ul,
213-
ul ol,
214-
ol ol {
272+
ul ul, ol ul, ul ol, ol ol {
215273
margin-bottom: 0;
216274
}
217275
dl {
@@ -221,13 +279,14 @@ dd {
221279
margin-left: 0;
222280
}
223281

224-
#TOC ul {
282+
nav ul {
225283
list-style-type: none;
284+
margin: 0;
226285
padding-left: 0px;
227286
}
228287

229288
/* Only display one level of hierarchy in the TOC */
230-
#TOC ul ul {
289+
nav ul ul {
231290
display: none;
232291
}
233292

0 commit comments

Comments
 (0)