1
0
mirror of https://github.com/google/comprehensive-rust.git synced 2025-05-22 10:21:03 +02:00
comprehensive-rust/mdbook-exerciser
Martin Geisler 618d8fe4e9 Introduce a cargo clippy run
Personally, I don’t always agree with Clippy, but it a very widely
recommended tool for writing idiomatic Rust. So on balance, I think
it’s overall a good idea to enable it for both our exercises and our
tooling.
2024-07-22 15:02:35 +02:00
..
2024-07-22 15:02:35 +02:00
2023-05-30 17:04:19 +02:00

exerciser

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:

<!-- 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:

[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.