Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit 0cc3356

Browse files
authored
Merge pull request #1 from rust-lang/master
16.9.28.9.47
2 parents 61a5cd4 + 34acfb4 commit 0cc3356

26 files changed

+625
-114
lines changed

_data/users.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,16 @@
7272
url: https://beget.com
7373
logo: beget.png
7474
how: "As part of backup, resource management systems and <a href='https://github.com/LTD-Beget/syncookied'>DDOS mitigation</a>"
75+
-
76+
name: Canonical
77+
url: http://www.canonical.com
78+
logo: canonical.svg
79+
how: "Everything from server monitoring to middleware!"
80+
-
81+
name: Ceph
82+
url: http://ceph.com
83+
logo: ceph.png
84+
how: "Rust <a href='https://github.com/ceph/ceph-rust'>bindings for librbd</a>, an interface into the Ceph storage platform."
7585
-
7686
name: Coursera
7787
url: https://www.coursera.org
@@ -102,6 +112,11 @@
102112
url: http://faraday.io
103113
logo: faraday.svg
104114
how: "<a href='https://github.com/faradayio/credentials_to_env'>Securely transferring credentials.</a>"
115+
-
116+
name: Gremlin Inc
117+
url: https://www.gremlininc.com
118+
logo: gremlininc.svg
119+
how: "Safely and efficiently causing controlled chaos."
105120
-
106121
name: Habitat
107122
url: https://www.habitat.sh

_includes/editor.js

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
var req = new XMLHttpRequest();
9292
var data = JSON.stringify({
9393
version: "beta",
94-
optimize: "2",
94+
optimize: "0",
9595
code: program
9696
});
9797

@@ -183,28 +183,38 @@
183183
// Getting list of ranges with problems
184184
var lines = message.split(newLineRegex);
185185

186-
// Cleaning up the message: keeps only relevant problem output
187-
var cleanMessage = lines.map(function(line) {
188-
if (line.startsWith("<anon>") || line.indexOf("^") !== -1) {
189-
var errIndex = line.indexOf(problem + ": ");
190-
if (errIndex !== -1) {return line.slice(errIndex);}
191-
return "";
192-
}
193-
194-
// Discard playpen messages, keep the rest
195-
if (line.startsWith("playpen:")) {return "";}
196-
return line;
197-
}).filter(function(line) {
198-
return line !== "";
186+
// Cleaning up the message: keeps only relevant problem output.
187+
var cleanMessage = lines.filter(function(line) {
188+
return !line.trim().startsWith("--> <anon>")
189+
&& !line.startsWith("playpen:")
190+
&& !line.trim().startsWith("error: aborting");
199191
}).map(function(line) {
200192
return escapeHTML(line);
193+
}).filter(function(line) {
194+
return line != "";
195+
}).map(function(line) {
196+
return line.replace(/ /g, '\u00a0\u00a0');
201197
}).join("<br />");
202198

199+
// Get all of the row:col in the message.
200+
var errorLines = lines.filter(function(line) {
201+
return line.indexOf("--> <anon>") !== -1;
202+
}).map(function(line) {
203+
var lineIndex = line.indexOf(":");
204+
if (lineIndex !== -1) {
205+
return line.slice(lineIndex);
206+
}
207+
208+
return "";
209+
}).filter(function(line) {
210+
return line != "";
211+
});
212+
203213
// Setting message
204214
displayOutput(cleanMessage, editor.getValue());
205215

206216
// Highlighting the lines
207-
var ranges = parseProblems(lines);
217+
var ranges = parseProblems(errorLines);
208218
markers = ranges.map(function(range) {
209219
return editor.getSession().addMarker(range, "ace-" + problem + "-line",
210220
"fullLine", false);
@@ -223,12 +233,10 @@
223233
var ranges = [];
224234
for (var i in lines) {
225235
var line = lines[i];
226-
if (line.startsWith("<anon>:") && line.indexOf(": ") !== -1) {
227-
var parts = line.split(/:\s?|\s+/, 5).slice(1, 5);
228-
var ip = parts.map(function(p) { return parseInt(p, 10) - 1; });
229-
// console.log("line:", line, parts, ip);
230-
ranges.push(new Range(ip[0], ip[1], ip[2], ip[3]));
231-
}
236+
var parts = line.split(/:\s?|\s+/, 5).slice(1, 5);
237+
var ip = parts.map(function(p) { return parseInt(p, 10) - 1; });
238+
console.log("line:", line, parts, ip);
239+
ranges.push(new Range(ip[0], ip[1], ip[2], ip[3]));
232240
}
233241

234242
return ranges;

_includes/zh-CN/example.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
// 这个代码是可以编辑并且能够运行的
1+
// 这个代码是可以编辑并且能够运行的
22
fn main() {
3-
// 一个简易计算器
4-
// `+` 或 `-` 意味着加减1
5-
// `*` 或 `/` 意味着乘除2
3+
// 一个简易计算器
4+
// `+` 或 `-` 意味着加减1
5+
// `*` 或 `/` 意味着乘除2
66

77
let program = "+ + * - /";
88
let mut accumulator = 0;
@@ -13,10 +13,10 @@ fn main() {
1313
'-' => accumulator -= 1,
1414
'*' => accumulator *= 2,
1515
'/' => accumulator /= 2,
16-
_ => { /* 忽略其他 */ }
16+
_ => { /* 忽略其他 */ }
1717
}
1818
}
1919

20-
println!("程序 \"{}\" 的结果是 {}",
20+
println!("程序 \"{}\" 的结果是 {}",
2121
program, accumulator);
2222
}

_includes/zh-CN/example.rs.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<pre class='rust'>
22
<span class='kw'>fn</span> main() {
3-
<span class='comment'>// 一个简易计算器
4-
// `+` 或 `-` 意味着加减1
5-
// `*` 或 `/` 意味着乘除2</span>
3+
<span class='comment'>// 一个简易计算器
4+
// `+` 或 `-` 意味着加减1
5+
// `*` 或 `/` 意味着乘除2</span>
66

77
<span class='kw'>let</span> program = <span class='string'>"+ + * - /"</span>;
88
<span class='kw'>let</span> <span class='kw'>mut</span> accumulator = <span class='number'>0</span>;
@@ -13,11 +13,11 @@
1313
<span class='string'>'-'</span> => accumulator <span class='op'>-=</span> <span class='number'>1</span>,
1414
<span class='string'>'*'</span> => accumulator <span class='op'>*=</span> <span class='number'>2</span>,
1515
<span class='string'>'/'</span> => accumulator <span class='op'>/=</span> <span class='number'>2</span>,
16-
_ => { <span class='comment'>/* 忽略其他 */</span> }
16+
_ => { <span class='comment'>/* 忽略其他 */</span> }
1717
}
1818
}
1919

20-
<span class='prelude-val'>println!</span>(<span class='string'>"程序 \"{}\" 的结果是 {}"</span>,
20+
<span class='prelude-val'>println!</span>(<span class='string'>"程序 \"{}\" 的结果是 {}"</span>,
2121
program, accumulator);
2222
}
2323
</pre>

_layouts/basic.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ <h2><a href="/contribute.html">Contribute</a></h2>
3636

3737
{{ content }}
3838

39+
<footer>
40+
<p>Our site in other languages:
41+
<a href="/pt-BR/">Português</a>,
42+
<a href="/ru-RU/">Русский</a>,
43+
<a href="/zh-CN/">简体中文</a>
44+
</p>
45+
</footer>
46+
3947
<script>
4048
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
4149
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

_layouts/redirect.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
"pt-BR": "pt-BR",
1414
"ru": "ru-RU",
1515
"ru-RU": "ru-RU",
16+
"zh": "zh-CN",
17+
"zh-CN": "zh-CN",
1618
};
1719

1820
// look up the provided language in the map

_layouts/ru-RU/faq.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
layout: ru-RU/untranslated
3+
---
4+
5+
<link href='https://fonts.googleapis.com/css?family=Source+Serif+Pro:400,600' rel='stylesheet' type='text/css'>
6+
<link href='/css/syntax-highlight.css' rel='stylesheet' type='text/css'>
7+
8+
<div class="faq">
9+
{{ content }}
10+
</div>

_layouts/zh-CN/default.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
layout: basic
2+
layout: zh-CN/basic
33
---
44

55
<div class="content">

css/style.css

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,8 @@ ul.laundry-list {
314314
padding: 10px;
315315
display: none;
316316
border-radius: 4px;
317+
font-family: monospace;
318+
font-size: 12px;
317319
}
318320

319321
.ace-error-text, .ace-error-line, .ace-warning-text, .ace-warning-line {
@@ -603,3 +605,14 @@ ul.laundry-list {
603605
text-align: center;
604606
padding-top: 50px;
605607
}
608+
609+
footer {
610+
border-top: 2px solid #dedede;
611+
margin: 1.2em auto 0 auto;
612+
padding-top: 0.6em; /* half to accomodate p tag margin */
613+
}
614+
615+
footer a {
616+
display: inline-block;
617+
font-weight: bold;
618+
}

en-US/community.md

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -98,29 +98,29 @@ Rust's developers coordinate in [#rust-internals][internals_irc]. It is for real
9898
- [#servo][servo_irc] is for discussion of Servo, the browser engine written in Rust
9999

100100
[IRC]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
101-
[beginners_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-beginners
102-
[bots_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-bots
103-
[br_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-br
104-
[cargo_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23cargo
105-
[community_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-community
106-
[crypto_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-crypto
107-
[de_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-de
108-
[es_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-es
109-
[fr_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-fr
110-
[gamedev_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-gamedev
111-
[internals_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals
112-
[lang_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-lang
113-
[libs_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-libs
114-
[networking_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-networking
115-
[offtopic_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-offtopic
116-
[osdev_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-osdev
117-
[ru_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-ru
118-
[rust_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust
119-
[rustc_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rustc
120-
[servo_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23servo
121-
[tools_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-tools
122-
[webdev_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-webdev
123-
[docs_irc]: https://client00.chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-docs
101+
[beginners_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-beginners
102+
[bots_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-bots
103+
[br_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-br
104+
[cargo_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23cargo
105+
[community_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-community
106+
[crypto_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-crypto
107+
[de_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-de
108+
[es_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-es
109+
[fr_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-fr
110+
[gamedev_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-gamedev
111+
[internals_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-internals
112+
[lang_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-lang
113+
[libs_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-libs
114+
[networking_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-networking
115+
[offtopic_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-offtopic
116+
[osdev_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-osdev
117+
[ru_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-ru
118+
[rust_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust
119+
[rustc_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rustc
120+
[servo_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23servo
121+
[tools_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-tools
122+
[webdev_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-webdev
123+
[docs_irc]: https://chat.mibbit.com/?server=irc.mozilla.org&channel=%23rust-docs
124124

125125
## Discussion Forums
126126

en-US/contribute-translations.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout: default
3+
title: Translating rust-lang.org to other languages to adapt internationalization
4+
---
5+
6+
# Rust is universal
7+
8+
Some docs on contributing translations!

en-US/contribute.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ This guide focuses on a few avenues for the new contributor:
3636
* [Language, compiler and the standard
3737
library](contribute-compiler.html). Language design, feature
3838
implementation, performance improvement.
39+
* [Internationalization](contribute-translations.html). Help spread the
40+
Rust love by translating our site to every language.
3941

4042
If you need additional guidance ask on [#rust-internals] or
4143
[internals.rust-lang.org].

en-US/documentation.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ for learning Rust.
4242
[Standard Library API Reference][api]. Documentation for the
4343
standard library.
4444

45+
[docs.rs]. Documentation for all crates published to [crates.io].
46+
4547
[The Rust Reference][ref]. While Rust does not have a
4648
specification, the reference tries to describe its working in
4749
detail. It tends to be out of date.
@@ -64,6 +66,8 @@ the errors produced by the Rust compiler.
6466
[cargo]: http://doc.crates.io/guide.html
6567
[err]: https://doc.rust-lang.org/error-index.html
6668
[release_notes]: https://github.com/rust-lang/rust/blob/stable/RELEASES.md
69+
[docs.rs]: https://docs.rs
70+
[crates.io]: https://crates.io
6771

6872
## Project policies
6973

en-US/downloads.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,15 @@ <h2 id="nightly">Nightly&nbsp; ({{ site.nightly }})</h2>
166166
</div>
167167
</div>
168168

169+
<hr/>
170+
171+
<div class="row">
172+
<div class="col-md-12">
173+
<p>If you installed using the shell script, run this to uninstall:</p>
174+
<pre><code>curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --uninstall</code></pre>
175+
</div>
176+
</div>
177+
169178
<hr/>
170179

171180
<div class="row">

en-US/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
prevents segfaults,
1212
and guarantees thread safety.
1313
<br/>
14-
<a href="https://doc.rust-lang.org/book/README.html">Show me!</a>
14+
<b><a href="friends.html">See who's using Rust.</a></b>
1515
</p>
1616
</div>
1717
<div class="col-md-4 install-box">

en-US/user-groups.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ even better, open a pull request against
5454

5555
[Rust Meetup Hamburg](https://www.meetup.com/Rust-Meetup-Hamburg/), Hamburg.
5656

57+
[Rust - Modern Systems Programming Leipzig](https://www.meetup.com/de-DE/Rust-Modern-Systems-Programming-in-Leipzig/), Leipzig.
58+
5759
[Rust Munich](https://www.meetup.com/rust-munich/), München.
5860

5961
## India
@@ -98,6 +100,10 @@ even better, open a pull request against
98100

99101
[Wellington Rust Meetup](https://www.meetup.com/Wellington-Rust-Meetup/), Wellington.
100102

103+
## Norway
104+
105+
[Rust Oslo](https://www.meetup.com/Rust-Oslo/), Oslo.
106+
101107
## Phillipines
102108

103109
[Rust Philippines](http://www.rustph.tech), Manila.

0 commit comments

Comments
 (0)