Skip to content

Commit

Permalink
doc: add webfonts and tweak the styles accordingly
Browse files Browse the repository at this point in the history
  • Loading branch information
adrientetar committed Apr 19, 2014
1 parent 9503129 commit fb9ea2e
Show file tree
Hide file tree
Showing 7 changed files with 129 additions and 74 deletions.
7 changes: 6 additions & 1 deletion src/doc/full-toc.inc
@@ -1,6 +1,11 @@
<style>
/* Display the full TOC */
#TOC ul ul {
nav {
column-count: auto;
-moz-column-count: auto;
-webkit-column-count: auto;
}
nav ul ul {
display: block;
padding-left: 2em;
}
Expand Down
4 changes: 2 additions & 2 deletions src/doc/guide-lifetimes.md
Expand Up @@ -236,7 +236,7 @@ it. It would violate memory safety for the box that was originally
assigned to `x` to be garbage-collected, since a non-heap
pointer *`y`* still points into it.

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

> ***Note:*** Labelled breaks are not currently supported within `while` loops.
> *Note:* Labelled breaks are not currently supported within `while` loops.
Named labels are hygienic and can be used safely within macros.
See the macros guide section on hygiene for more details.
Expand Down
2 changes: 1 addition & 1 deletion src/doc/guide-tasks.md
Expand Up @@ -462,7 +462,7 @@ an `Error` result.

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

> ***Note:*** A failed task does not currently produce a useful error
> *Note:* A failed task does not currently produce a useful error
> value (`try` always returns `Err(())`). In the
> future, it may be possible for tasks to intercept the value passed to
> `fail!()`.
Expand Down
24 changes: 12 additions & 12 deletions src/doc/po/ja/tutorial.md.po
Expand Up @@ -196,11 +196,11 @@ msgstr ""
#. type: Plain text
#: src/doc/tutorial.md:57
msgid ""
"> ***Warning:*** Rust is a language under ongoing development. Notes > about "
"> *Warning:* Rust is a language under ongoing development. Notes > about "
"potential changes to the language, implementation > deficiencies, and other "
"caveats appear offset in blockquotes."
msgstr ""
"> ***警告:*** Rust は開発途上の言語です。将来予定されている言語への変更や、実"
"> *警告:* Rust は開発途上の言語です。将来予定されている言語への変更や、実"
"装上の不備、その他の注意事項など、 blockquote の段落 (この段落もそうです) に"
"注意してください。"

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

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

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

#. type: Plain text
Expand Down Expand Up @@ -4374,9 +4374,9 @@ msgstr ""

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

#. type: Plain text
Expand Down
101 changes: 79 additions & 22 deletions src/doc/rust.css
Expand Up @@ -10,13 +10,43 @@
* option. This file may not be copied, modified, or distributed
* except according to those terms.
*/
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 400;
src: local('Fira Sans'), url("http://rust-lang.org/fonts/FiraSans-Regular.woff") format('woff');
}
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 500;
src: local('Fira Sans Medium'), url("http://rust-lang.org/fonts/FiraSans-Medium.woff") format('woff');
}
@font-face {
font-family: 'Heuristica';
font-style: normal;
font-weight: 400;
src: local('Heuristica Regular'), url("http://rust-lang.org/fonts/Heuristica-Regular.woff") format('woff');
}
@font-face {
font-family: 'Heuristica';
font-style: italic;
font-weight: 400;
src: local('Heuristica Italic'), url("http://rust-lang.org/fonts/Heuristica-Italic.woff") format('woff');
}
@font-face {
font-family: 'Heuristica';
font-style: normal;
font-weight: 700;
src: local('Heuristica Bold'), url("http://rust-lang.org/fonts/Heuristica-Bold.woff") format('woff');
}
/* Global page semantics
========================================================================== */
body {
margin: 0 auto;
padding: 0 15px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
font-family: Heuristica, "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 18px;
color: #333;
line-height: 1.428571429;
}
Expand All @@ -26,24 +56,36 @@ body {
}
}

h1, h2, h3, h4, h5, h6, nav, #versioninfo {
font-family: "Fira Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
}
h1, h2, h3, h4, h5, h6 {
color: black;
font-weight: 500;
font-weight: 400;
line-height: 1.1;
}
h1, h2, h3 {
margin-top: 20px;
margin-bottom: 10px;
}
@media (min-width: 1170px) {
h1, h2, h3 {
margin-top: 30px;
margin-bottom: 15px;
}
}
h4, h5, h6 {
margin-top: 12px;
margin-bottom: 10px;
padding: .2em .8em;
padding: 5px 10px;
}
h5, h6 {
text-decoration: underline;
}

h1 {
font-size: 36px;
font-size: 28px;
font-weight: 500;
padding: .1em .4em;
margin: 0.67em 0;
border-bottom: 2px solid #ddd;
Expand All @@ -52,7 +94,7 @@ h1.title {
line-height: 1.5em;
}
h2 {
font-size: 30px;
font-size: 26px;
padding: .2em .5em;
border-bottom: 1px solid #ddd;
}
Expand All @@ -62,17 +104,34 @@ h3 {
border-bottom: 1px solid #DDE8FC;
}
h4 {
font-size: 18px;
font-size: 22px;
}
h5 {
font-size: 16px;
font-size: 20px;
}
h6 {
font-size: 14px;
font-size: 18px;
}
@media (min-width: 992px) {
h1 {
font-size: 36px;
}
h2 {
font-size: 30px;
}
h3 {
font-size: 26px;
}
}

nav {
column-count: 2;
-moz-column-count: 2;
-webkit-column-count: 2;
font-size: 15px;
}
p {
margin: 0 0 10px;
margin: 0 0 1em 0;
}

strong {
Expand All @@ -85,10 +144,10 @@ em {

footer {
border-top: 1px solid #ddd;
font-size: 12px;
font-size: 14.3px;
font-style: italic;
padding-top: 4px;
margin-top: 4em;
padding-top: 5px;
margin-top: 3em;
margin-bottom: 1em;
}

Expand Down Expand Up @@ -130,16 +189,14 @@ pre {
border-radius: 0.5em;
white-space: pre-wrap;
padding: 9.5px;
margin: 10px 0;
margin: 20px 0;
font-size: 13px;
word-break: break-all;
word-wrap: break-word;
}
code {
padding: 2px 4px;
font-size: 90%;
color: #C7254E;
background-color: #F9F2F4;
padding: 0 2px;
color: #8D1A38;
white-space: nowrap;
}
pre code {
Expand Down Expand Up @@ -170,7 +227,7 @@ pre.rust .lifetime { color: #B76514; }
margin: 0.5em;
font-size: 1.1em;
}
@media only screen, handheld and (min-width: 768px) {
@media handheld, only screen and (min-width: 768px) {
#versioninfo {
position: fixed;
bottom: 0px;
Expand All @@ -185,7 +242,7 @@ pre.rust .lifetime { color: #B76514; }
}
#versioninfo a.hash {
color: gray;
font-size: 70%;
font-size: 80%;
}

blockquote {
Expand Down Expand Up @@ -221,13 +278,13 @@ dd {
margin-left: 0;
}

#TOC ul {
nav ul {
list-style-type: none;
padding-left: 0px;
}

/* Only display one level of hierarchy in the TOC */
#TOC ul ul {
nav ul ul {
display: none;
}

Expand Down

0 comments on commit fb9ea2e

Please sign in to comment.