2023-04-03 15:39:17 +02:00
|
|
|
# exerciser
|
|
|
|
|
2023-05-30 17:04:19 +02:00
|
|
|
This is an mdBook renderer to generate templates for exercises from the Markdown
|
|
|
|
source. Given a Markdown file `example.md` with one or more sections like:
|
2023-04-03 15:39:17 +02:00
|
|
|
|
|
|
|
````markdown
|
|
|
|
<!-- File src/main.rs -->
|
|
|
|
|
|
|
|
```rust,compile_fail
|
|
|
|
{{#include example/src/main.rs:main}}
|
|
|
|
|
|
|
|
fn some_more_code() {
|
|
|
|
// TODO: Write some Rust code here.
|
|
|
|
}
|
|
|
|
```
|
|
|
|
````
|
|
|
|
|
2023-04-05 17:15:42 +02:00
|
|
|
and mdbook configuration in `book.toml` like:
|
|
|
|
|
|
|
|
```toml
|
|
|
|
[output.exerciser]
|
|
|
|
output-directory = "comprehensive-rust-exercises"
|
|
|
|
```
|
|
|
|
|
2023-05-30 17:04:19 +02:00
|
|
|
It will create a file
|
|
|
|
`book/exerciser/comprehensive-rust-exercises/example/src/main.rs` with the
|
2023-04-05 17:15:42 +02:00
|
|
|
appropriate contents.
|