Skip to content

Commit 512ded8

Browse files
committed
Done community exercises page
1 parent 69a9e9c commit 512ded8

File tree

1 file changed

+24
-16
lines changed
  • website/content/community-exercises

1 file changed

+24
-16
lines changed

website/content/community-exercises/index.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,37 +2,36 @@
22
title = "Community Exercises"
33
+++
44

5-
Do you want to create your own set of Rustlings exercises to focus on some specific topic?
6-
Or do you want to translate the original Rustlings exercises?
7-
85
## List of Community Exercises
96

107
- 🇯🇵 [Japanese Rustlings](https://github.com/sotanengel/rustlings-jp):A Japanese translation of the Rustlings exercises.
118
- 🇨🇳 [Simplified Chinese Rustlings](https://github.com/SandmeyerX/rustlings-zh-cn): A simplified Chinese translation of the Rustlings exercises.
129

13-
You can use the same `rustlings` program that you installed with `cargo install rustlings` to run them
10+
> You can use the same `rustlings` program that you installed with `cargo install rustlings` to run community exercises.
11+
12+
## Creating Community Exercises
1413

15-
The support of Rustlings for community exercises allows you to create your own set of Rustlings exercises to focus on some specific topic.
14+
Rustling's support for community exercises allows you to create your own exercises to focus on some specific topic.
1615
You could also offer a translation of the original Rustlings exercises as community exercises.
1716

18-
## Getting started
17+
### Getting Started
1918

2019
To create community exercises, install Rustlings and run `rustlings dev new PROJECT_NAME`.
21-
This command will, similar to `cargo new PROJECT_NAME`, create a template directory called `PROJECT_NAME` with all what you need to get started.
20+
This command will, similar to `cargo new PROJECT_NAME`, create the template directory `PROJECT_NAME` with all what you need to get started.
2221

23-
Read the comments in the generated `info.toml` file to understand its format.
22+
_Read the comments_ in the generated `info.toml` file to understand its format.
2423
It allows you to set a custom welcome and final message and specify the metadata of every exercise.
2524

26-
## Create an exercise
25+
### Creating an Exercise
2726

28-
Here is an example of the metadata of one file:
27+
Here is an example of the metadata of one exercise:
2928

3029
```toml
3130
[[exercises]]
3231
name = "intro1"
3332
hint = """
3433
To finish this exercise, you need to …
35-
This link might help you …"""
34+
These links might help you …"""
3635
```
3736

3837
After entering this in `info.toml`, create the file `intro1.rs` in the `exercises/` directory.
@@ -51,15 +50,24 @@ For example, it will tell you to run `rustlings dev update` to update the `Cargo
5150
That's it!
5251
You finished your first exercise 🎉
5352

54-
## Publish
53+
### Cargo.toml
54+
55+
Except of the `bin` list, you can modify the `Cargo.toml` file as you want.
56+
57+
> The `bin` list is automatically updated by running `rustlings dev update`
58+
59+
- You can add dependencies in the `[dependencies]` table.
60+
- You might want to [configure some lints](https://doc.rust-lang.org/cargo/reference/manifest.html#the-lints-section) for all exercises. You can do so in the `[lints.rust]` and `[lints.clippy]` tables.
61+
62+
### Publishing
5563

5664
Now, add more exercises and publish them as a Git repository.
5765

58-
Users just have to clone that repository and run `rustlings` in it to start working on your set of exercises just like the official ones.
66+
Users just have to clone that repository and run `rustlings` in it to start working on your exercises (just like the official ones).
5967

6068
One difference to the official exercises is that the solution files will not be hidden until the user finishes an exercise.
61-
But you can trust the users to not look at the solution too early 😉
69+
But you can trust your users to not open the solution too early 😉
6270

63-
## Share
71+
### Sharing
6472

65-
After publishing your set of exercises, open an issue or a pull request in the official Rustlings repository to link to your project in the README 😃
73+
After publishing your community exercises, open an issue or a pull request in the [official Rustlings repository](https://github.com/rust-lang/rustlings) to add your project to the [list of community exercises](#list-of-community-exercises) 😃

0 commit comments

Comments
 (0)