Skip to content

Commit 49c6ae1

Browse files
committed
auto merge of #10421 : adridu59/rust/patch-www, r=alexcrichton
* Closes #10330 * Improves on #9873 * Adds favicon for tutorial files
2 parents 2b2a89d + 3d57b24 commit 49c6ae1

File tree

9 files changed

+86
-124
lines changed

9 files changed

+86
-124
lines changed

doc/favicon.inc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
<link rel="shortcut icon" href="http://www.rust-lang.org/favicon.ico" />

doc/manual.inc

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@
44
display: block;
55
padding-left: 2em;
66
}
7-
</style>
7+
#influences blockquote p:last-child {
8+
display: block;
9+
line-height: 1.428571429;
10+
color: #999999;
11+
}
12+
</style>

doc/rust.css

+7-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Copyright 2013 The Rust Project Developers. See the COPYRIGHT
33
* file at the top-level directory of this distribution and at
44
* http://rust-lang.org/COPYRIGHT.
5-
* With elements taken from Bootstrap v3.0.0 (Apache v2.0 licensed).
5+
* With elements taken from Bootstrap v3.0.2 (MIT licensed).
66
*
77
* Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
88
* http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
@@ -93,6 +93,7 @@ p {
9393
a {
9494
text-decoration: none;
9595
color: #428BCA;
96+
background: transparent;
9697
}
9798
a:hover, a:focus {
9899
color: #2A6496;
@@ -114,7 +115,7 @@ h5 a:link, h5 a:visited {color: black;}
114115
/* Code
115116
========================================================================== */
116117
pre, code {
117-
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
118+
font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
118119
border-radius: 4px;
119120
}
120121
pre {
@@ -141,7 +142,7 @@ pre code {
141142
color: inherit;
142143
white-space: pre-wrap;
143144
background-color: transparent;
144-
border: 0;
145+
border-radius: 0;
145146
}
146147

147148
/* Code highlighting */
@@ -158,7 +159,7 @@ pre code {
158159
.cm-s-default span.cm-string {color: #a11;}
159160
.cm-s-default span.cm-string-2 {color: #f50;}
160161
.cm-s-default span.cm-meta {color: #555;}
161-
.cm-s-default span.cm-error {color: #f00;}
162+
/*.cm-s-default span.cm-error {color: #f00;}*/
162163
.cm-s-default span.cm-qualifier {color: #555;}
163164
.cm-s-default span.cm-builtin {color: #30a;}
164165
.cm-s-default span.cm-bracket {color: #cc7;}
@@ -187,7 +188,7 @@ pre code {
187188
}
188189
#versioninfo a.hash {
189190
color: gray;
190-
font-size: 60%;
191+
font-size: 70%;
191192
}
192193

193194
blockquote {
@@ -303,4 +304,4 @@ hr {
303304
table td, table th {
304305
background-color: #fff !important;
305306
}
306-
}
307+
}

doc/tutorial-macros.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -210,10 +210,10 @@ solves the problem.
210210

211211
# Macro argument pattern matching
212212

213-
Now consider code like the following:
214-
215213
## Motivation
216214

215+
Now consider code like the following:
216+
217217
~~~~
218218
# enum t1 { good_1(t2, uint), bad_1 };
219219
# pub struct t2 { body: t3 }

doc/tutorial-rustpkg.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ $ rustc main.rs
2727
main.rs:1:0: 1:17 error: can't find crate for `hello`
2828
main.rs:1 extern mod hello;
2929
^~~~~~~~~~~~~~~~~
30-
3130
~~~~
3231

3332
This makes sense, as we haven't gotten it from anywhere yet! Luckily for us,
@@ -216,7 +215,7 @@ a function that can be sensibly tested:
216215
#[license = "MIT"];
217216
218217
pub fn is_even(i: uint) -> bool {
219-
i % 2 == 0
218+
i % 2 == 0
220219
}
221220
~~~
222221

@@ -230,9 +229,9 @@ use hello::is_even;
230229
231230
#[test]
232231
fn test_is_even() {
233-
assert!(is_even(0));
234-
assert!(!is_even(1));
235-
assert!(is_even(2));
232+
assert!(is_even(0));
233+
assert!(!is_even(1));
234+
assert!(is_even(2));
236235
}
237236
~~~
238237

doc/tutorial-tasks.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ an environment that it carries across tasks.
104104
let child_task_number = generate_task_number();
105105
106106
do spawn {
107-
// Capture it in the remote task
108-
println!("I am child number {}", child_task_number);
107+
// Capture it in the remote task
108+
println!("I am child number {}", child_task_number);
109109
}
110110
~~~
111111

doc/tutorial.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ confusing numbers that correspond to different units.
804804
We've already seen several function definitions. Like all other static
805805
declarations, such as `type`, functions can be declared both at the
806806
top level and inside other functions (or in modules, which we'll come
807-
back to [later](#modules-and-crates)). The `fn` keyword introduces a
807+
back to [later](#crates-and-the-module-system)). The `fn` keyword introduces a
808808
function. A function has an argument list, which is a parenthesized
809809
list of `expr: type` pairs separated by commas. An arrow `->`
810810
separates the argument list and the function's return type.
@@ -2711,10 +2711,10 @@ extend with the `-L` switch).
27112711
However, Rust also ships with rustpkg, a package manager that is able to automatically download and build
27122712
libraries if you use it for building your crate. How it works is explained [here][rustpkg],
27132713
but for this tutorial it's only important to know that you can optionally annotate an
2714-
`extern mod` statement with an package id that rustpkg can use to identify it:
2714+
`extern mod` statement with a package id that rustpkg can use to identify it:
27152715

27162716
~~~ {.ignore}
2717-
extern mod rust = "github.com/mozilla/rust"; // pretend Rust is an simple library
2717+
extern mod rust = "github.com/mozilla/rust"; // pretend Rust is a simple library
27182718
~~~
27192719

27202720
[rustpkg]: rustpkg.html
@@ -2730,7 +2730,7 @@ the link name and the version. It also hashes the filename and the symbols in a
27302730
based on the link metadata, allowing you to use two different versions of the same library in a crate
27312731
without conflict.
27322732

2733-
Therefor, if you plan to compile your crate as a library, you should annotate it with that information:
2733+
Therefore, if you plan to compile your crate as a library, you should annotate it with that information:
27342734

27352735
~~~~
27362736
// lib.rs
@@ -2746,8 +2746,8 @@ Therefor, if you plan to compile your crate as a library, you should annotate it
27462746
You can also in turn require in a `extern mod` statement that certain link metadata items match some criteria.
27472747
For that, Rust currently parses a comma-separated list of name/value pairs that appear after
27482748
it, and ensures that they match the attributes provided in the `link` attribute of a crate file.
2749-
This enables you to, eg, pick a a crate based on it's version number, or to link an library under an
2750-
different name. For example, this two mod statements would both accept and select the crate define above:
2749+
This enables you to, e.g., pick a crate based on its version number, or link a library under a
2750+
different name. For example, these two `mod` statements would both accept and select the crate define above:
27512751

27522752
~~~~ {.xfail-test}
27532753
extern mod farm(vers = "2.5");
@@ -2836,14 +2836,14 @@ This allows you to use common types and functions like `Option<T>` or `println`
28362836
without needing to import them. And if you need something from `std` that's not in the prelude,
28372837
you just have to import it with an `use` statement.
28382838

2839-
For example, it re-exports `println` which is defined in `std::io::println`:
2839+
For example, it re-exports `println` which is defined in `std::io::stdio::println`:
28402840

28412841
~~~
28422842
use puts = std::io::stdio::println;
28432843
28442844
fn main() {
28452845
println("println is imported per default.");
2846-
puts("Doesn't hinder you from importing it under an different name yourself.");
2846+
puts("Doesn't hinder you from importing it under a different name yourself.");
28472847
::std::io::stdio::println("Or from not using the automatic import.");
28482848
}
28492849
~~~

0 commit comments

Comments
 (0)