Skip to content

Commit 83a269c

Browse files
committed
Replace the whole contents with the latest English edition
- Rename the old Japanese contents to "src-ord" directory. - Delete old "docs" directory containing generated HTML files. - Delete all other old stuff such as "Cargo.toml", "src/*.rs" and "node-modules". - Update git submodule ".examples" to the latest revision. (This submodule is pointing to the English edition at rust-lang/rust-by-example) - Copy all the English stuff including "src/*.md" and "book.toml". - Change the build tool from gitbook to mdbook. - Update the CircleCI config and a shell script.
1 parent e2b18c7 commit 83a269c

File tree

1,493 files changed

+11127
-471580
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,493 files changed

+11127
-471580
lines changed

.circleci/config.yml

+5-33
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,19 @@
11
version: 2
22

3-
# TODO: ENHANCEME: (tatsuya6502) Utilize Circle CI cache for the following items:
4-
# - The "update" tool (written in Rust) with Cargo's crates.io-index
5-
# - node_modules
6-
73
jobs:
84
build:
95
docker:
10-
- image: quay.io/rust-lang-ja/circleci:rust-by-example
6+
- image: hrektts/mdbook:0.3.5
117
parallelism: 1
128
steps:
139
- checkout
1410
# Remove .gitconfig added by Circle CI as cargo doesn't support ssh authorization
1511
- run: rm -f ~/.gitconfig
16-
- run: make clean all
17-
- run:
18-
name: Building book
19-
command: |
20-
source $NVM_DIR/nvm.sh
21-
make book
22-
- run:
23-
name: Creating artifact
24-
command: |
25-
mkdir /tmp/rust-by-example
26-
cp -rp ./stage/_book/* /tmp/rust-by-example/
27-
cp -rp ./gitbook/* /tmp/rust-by-example/
28-
# Fix fonts path
29-
sed -i -e 's!.//fonts/!./fonts/!g' /tmp/rust-by-example/gitbook/style.css
30-
# Change mode-rust.js path. An example of CircleCI artifact URI:
31-
# "https://33-57046702-circle-artifacts.com/0/"
32-
sed -i -e "s!/gitbook/plugins/gitbook-plugin-rust-playpen/mode-rust.js!/${CIRCLE_NODE_INDEX}/rust-by-example/gitbook/plugins/gitbook-plugin-rust-playpen/mode-rust.js!" /tmp/rust-by-example/gitbook/plugins/gitbook-plugin-rust-playpen/editor.js
33-
cd /tmp
34-
tar cJf rust-by-example-ja.txz rust-by-example
35-
- run:
36-
name: Running tests (allowing failures)
37-
command: make test || true
38-
- store_artifacts:
39-
path: /tmp/rust-by-example
40-
distination: rust-by-example
12+
- run: rm -rf docs
13+
- run: mdbook build
14+
- run: mdbook test
4115
- store_artifacts:
42-
path: /tmp/rust-by-example-ja.txz
43-
distination: rust-by-example-ja.txz
44-
- run: rm -rf /tmp rust-by-example
16+
path: docs
4517
- deploy:
4618
name: If master branch, publish to GitHub Page
4719
command: |

.examples-en

Submodule .examples-en updated 445 files

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto eol=lf

.gitignore

+1-12
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,2 @@
1-
*.swp
2-
Cargo.lock
3-
bin/*
4-
count_table
51
docs/
6-
gh-pages
7-
node_modules/*
8-
!node_modules/gitbook-plugin-rust-playpen
9-
node_modules/gitbook-plugin-rust-playpen/book/ace
10-
node_modules/gitbook-plugin-rust-playpen/book/mode-rust.js
11-
rust-playgen
12-
stage/*
13-
target
2+

CODE_OF_CONDUCT.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# The Rust Code of Conduct
2+
3+
A version of this document [can be found online](https://www.rust-lang.org/conduct.html).
4+
5+
## Conduct
6+
7+
**Contact**: [[email protected]](mailto:[email protected])
8+
9+
* We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, nationality, or other similar characteristic.
10+
* On IRC, please avoid using overtly sexual nicknames or other nicknames that might detract from a friendly, safe and welcoming environment for all.
11+
* Please be kind and courteous. There's no need to be mean or rude.
12+
* Respect that people have differences of opinion and that every design or implementation choice carries a trade-off and numerous costs. There is seldom a right answer.
13+
* Please keep unstructured critique to a minimum. If you have solid ideas you want to experiment with, make a fork and see how it works.
14+
* We will exclude you from interaction if you insult, demean or harass anyone. That is not welcome behavior. We interpret the term "harassment" as including the definition in the <a href="http://citizencodeofconduct.org/">Citizen Code of Conduct</a>; if you have any lack of clarity about what might be included in that concept, please read their definition. In particular, we don't tolerate behavior that excludes people in socially marginalized groups.
15+
* Private harassment is also unacceptable. No matter who you are, if you feel you have been or are being harassed or made uncomfortable by a community member, please contact one of the channel ops or any of the [Rust moderation team][mod_team] immediately. Whether you're a regular contributor or a newcomer, we care about making this community a safe place for you and we've got your back.
16+
* Likewise any spamming, trolling, flaming, baiting or other attention-stealing behavior is not welcome.
17+
18+
## Moderation
19+
20+
21+
These are the policies for upholding our community's standards of conduct. If you feel that a thread needs moderation, please contact the [Rust moderation team][mod_team].
22+
23+
1. Remarks that violate the Rust standards of conduct, including hateful, hurtful, oppressive, or exclusionary remarks, are not allowed. (Cursing is allowed, but never targeting another user, and never in a hateful manner.)
24+
2. Remarks that moderators find inappropriate, whether listed in the code of conduct or not, are also not allowed.
25+
3. Moderators will first respond to such remarks with a warning.
26+
4. If the warning is unheeded, the user will be "kicked," i.e., kicked out of the communication channel to cool off.
27+
5. If the user comes back and continues to make trouble, they will be banned, i.e., indefinitely excluded.
28+
6. Moderators may choose at their discretion to un-ban the user if it was a first offense and they offer the offended party a genuine apology.
29+
7. If a moderator bans someone and you think it was unjustified, please take it up with that moderator, or with a different moderator, **in private**. Complaints about bans in-channel are not allowed.
30+
8. Moderators are held to a higher standard than other community members. If a moderator creates an inappropriate situation, they should expect less leeway than others.
31+
32+
In the Rust community we strive to go the extra step to look out for each other. Don't just aim to be technically unimpeachable, try to be your best self. In particular, avoid flirting with offensive or sensitive issues, particularly if they're off-topic; this all too often leads to unnecessary fights, hurt feelings, and damaged trust; worse, it can drive people away from the community entirely.
33+
34+
And if someone takes issue with something you said or did, resist the urge to be defensive. Just stop doing what it was they complained about and apologize. Even if you feel you were misinterpreted or unfairly accused, chances are good there was something you could've communicated better — remember that it's your responsibility to make your fellow Rustaceans comfortable. Everyone wants to get along and we are all here first and foremost because we want to talk about cool technology. You will find that people will be eager to assume good intent and forgive as long as you earn their trust.
35+
36+
The enforcement policies listed above apply to all official Rust venues; including official IRC channels (#rust, #rust-internals, #rust-tools, #rust-libs, #rustc, #rust-beginners, #rust-docs, #rust-community, #rust-lang, and #cargo); GitHub repositories under rust-lang, rust-lang-nursery, and rust-lang-deprecated; and all forums under rust-lang.org (users.rust-lang.org, internals.rust-lang.org). For other projects adopting the Rust Code of Conduct, please contact the maintainers of those projects for enforcement. If you wish to use this code of conduct for your own project, consider explicitly mentioning your moderation policy or making a copy with your own moderation policy so as to avoid confusion.
37+
38+
*Adapted from the [Node.js Policy on Trolling](http://blog.izs.me/post/30036893703/policy-on-trolling) as well as the [Contributor Covenant v1.3.0](https://www.contributor-covenant.org/version/1/3/0/).*
39+
40+
[mod_team]: https://www.rust-lang.org/team.html#Moderation-team

CONTRIBUTING-en.md

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Rust by Example contribution guidelines
2+
3+
Thank you for your interest in making Rust by Example (also known as RBE)
4+
better! We'd love to have your contribution. We expect all contributors to
5+
abide by the [Rust code of conduct], which you can find at that link or in the
6+
[`CODE_OF_CONDUCT.md`] file in this repository.
7+
8+
[Rust code of conduct]: https://www.rust-lang.org/policies/code-of-conduct
9+
[`CODE_OF_CONDUCT.md`]: https://github.com/rust-lang/rust-by-example/blob/master/CODE_OF_CONDUCT.md
10+
11+
## License
12+
13+
RBE is dual licenced under the MIT and Apache 2.0 licenses, and so are all
14+
contributions. Please see the [`LICENSE-MIT`] and [`LICENSE-APACHE`] files in
15+
this directory for more details.
16+
17+
[`LICENSE-MIT`]: https://github.com/rust-lang/rust-by-example/blob/master/LICENSE-MIT
18+
[`LICENSE-APACHE`]: https://github.com/rust-lang/rust-by-example/blob/master/LICENSE-APACHE
19+
20+
## Pull Requests
21+
22+
To make changes to RBE, please send in pull requests on GitHub to the `master`
23+
branch. We'll review them and either merge or request changes. Travis CI tests
24+
everything as well, so you may get feedback from it too.
25+
26+
If you make additions or other changes to a pull request, feel free to either amend
27+
previous commits or only add new ones, however you prefer. We may ask you to squash
28+
your commits before merging, depending.
29+
30+
31+
## Issue Tracker
32+
33+
You can find the issue tracker [on
34+
GitHub](https://github.com/rust-lang/rust-by-example/issues). If you've found a
35+
problem with RBE, please open an issue there.
36+
37+
We use the following labels:
38+
39+
* `enhancement`: This is for any request for new sections or functionality.
40+
* `bug`: This is for anything that's in RBE, but incorrect or not working.
41+
* `discussion`: A discussion about improving something in RBE; this may lead to new
42+
enhancement or bug issues.
43+
* `E-mentor`: This issue has someone dedicated to helping a new contributor fix it!
44+
Can apply to both enhancement or bug issues.
45+
46+
## Development workflow
47+
48+
To build RBE, [install Rust], and then:
49+
50+
```bash
51+
$ git clone https://github.com/rust-lang/rust-by-example
52+
$ cd rust-by-example
53+
$ cargo install mdbook
54+
$ mdbook build
55+
```
56+
57+
[install Rust]: http://rust-lang.org/install.html
58+
59+
The files will be in the `book` directory at the top-level; `mdbook serve` will
60+
open the contents in your web browser.
61+
62+
To run the tests:
63+
64+
```bash
65+
$ mdbook test
66+
```
67+
68+
If you're adding a new chapter, you'll need to edit `src\SUMMARY.md` to add it. If
69+
you're tweaking an existing example, you'll need to edit the corresponding file; check
70+
`src\SUMMARY.md` to see a mapping of where chapters go to files.

0 commit comments

Comments
 (0)