1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2024-12-14 22:15:54 +02:00
comprehensive-rust/mdbook-exerciser/README.md

27 lines
592 B
Markdown
Raw Normal View History

2023-04-03 15:39:17 +02:00
# exerciser
2023-04-03 16:01:13 +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.
}
```
````
and mdbook configuration in `book.toml` like:
```toml
[output.exerciser]
output-directory = "comprehensive-rust-exercises"
```
It will create a file `book/exerciser/comprehensive-rust-exercises/example/src/main.rs` with the
appropriate contents.