Skip to content

Commit 2089901

Browse files
committed
docs: Move content from Readme to Contributing
1 parent 635e506 commit 2089901

File tree

2 files changed

+31
-25
lines changed

2 files changed

+31
-25
lines changed

CONTRIBUTING.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ First off, thanks for taking the time to contribute!! ❤️
66

77
I want to...
88

9+
_add an exercise! ➡️ [read this](#addex) and then [open a Pull Request](#prs)_
10+
911
_update an outdated exercise! ➡️ [open a Pull Request](#prs)_
1012

1113
_report a bug! ➡️ [open an Issue](#issues)_
@@ -14,6 +16,34 @@ _fix a bug! ➡️ [open a Pull Request](#prs)_
1416

1517
_implement a new feature! ➡️ [open an Issue to discuss it first, then a Pull Request](#issues)_
1618

19+
<a name="#src"></a>
20+
### Working on the source code
21+
22+
`rustlings` is basically a glorified `rustc` wrapper. Therefore the source code
23+
isn't really that complicated since the bulk of the work is done by `rustc`.
24+
`src/main.rs` contains a simple `clap` CLI that loads from `src/verify.rs` and `src/run.rs`.
25+
26+
<a name="addex"></a>
27+
### Adding an exercise
28+
29+
First step is to add the exercise! Call it `exercises/yourTopic/yourTopicN.rs`, make sure to
30+
put in some helpful links, and link to sections of the book in `exercises/yourTopic/README.md`.
31+
32+
Next you want to make sure it runs when using `rustlings`. All exercises are stored in `info.toml`, under the `exercises` array. They're ordered by the order they're ran when using `rustlings verify`.
33+
34+
You want to make sure where in the file you add your exercise. If you're not sure, add it at the bottom and ask in your pull request. To add an exercise, edit the file like this:
35+
```diff
36+
...
37+
+ [[exercises]]
38+
+ path = "exercises/yourTopic/yourTopicN.rs"
39+
+ mode = "compile"
40+
...
41+
```
42+
43+
The `mode` attribute decides whether Rustlings will only compile your exercise, or compile and test it. If you have tests to verify in your exercise, choose `test`, otherwise `compile`.
44+
45+
That's all! Feel free to put up a pull request.
46+
1747
<a name="issues"></a>
1848
### Issues
1949

README.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -94,31 +94,7 @@ If you are interested in improving or adding new ones, please feel free to contr
9494

9595
## Contributing
9696

97-
### Adding an exercise
98-
99-
First step is to add the exercise! Call it `exercises/yourTopic/yourTopicN.rs`, make sure to
100-
put in some helpful links, and link to sections of the book in `exercises/yourTopic/README.md`.
101-
102-
Next you want to make sure it runs when using `rustlings`. All exercises are stored in `info.toml`, under the `exercises` array. They're ordered by the order they're ran when using `rustlings verify`.
103-
104-
You want to make sure where in the file you add your exercise. If you're not sure, add it at the bottom and ask in your pull request. To add an exercise, edit the file like this:
105-
```diff
106-
...
107-
+ [[exercises]]
108-
+ path = "exercises/yourTopic/yourTopicN.rs"
109-
+ mode = "compile"
110-
...
111-
```
112-
113-
The `mode` attribute decides whether Rustlings will only compile your exercise, or compile and test it. If you have tests to verify in your exercise, choose `test`, otherwise `compile`.
114-
115-
That's all! Feel free to put up a pull request.
116-
117-
### Working on the source code
118-
119-
`rustlings` is basically a glorified `rustc` wrapper. Therefore the source code
120-
isn't really that complicated since the bulk of the work is done by `rustc`.
121-
`src/main.rs` contains a simple `clap` CLI that loads from `src/verify.rs` and `src/run.rs`.
97+
See [CONTRIBUTING.md](./CONTRIBUTING.md).
12298

12399
## Credits
124100

0 commit comments

Comments
 (0)