You've already forked comprehensive-rust
mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-11-06 09:29:26 +02:00
Format files with dprint (#711)
The dprint formatter is a flexible system which will use sandboxed WebAssembly formatters to format our code (mostly: it calls out to `rustfmt` for Rust code). A particularly interesting feature is that dprint can format Rust code blocks in the Markdown files. However, before we turn that on, we need to have a way to normalize the Markdown text as it is extracted[1]. That is so that the word put into the translations is kept after the reformatting. [1]: https://github.com/google/mdbook-i18n-helpers/issues/19
This commit is contained in:
@@ -1,11 +1,11 @@
|
||||
[package]
|
||||
name = "mdbook-exerciser"
|
||||
version = "0.1.0"
|
||||
authors = ["Andrew Walbran <qwandor@google.com>"]
|
||||
edition = "2021"
|
||||
license = "Apache-2.0"
|
||||
authors = ["Andrew Walbran <qwandor@google.com>"]
|
||||
description = "A tool for extracting starter code for exercises from Markdown files."
|
||||
repository = "https://github.com/google/comprehensive-rust"
|
||||
description = "A tool for extracting starter code for exercises from Markdown files."
|
||||
|
||||
[dependencies]
|
||||
anyhow = "1.0.68"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# 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:
|
||||
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:
|
||||
|
||||
````markdown
|
||||
<!-- File src/main.rs -->
|
||||
@@ -22,5 +22,6 @@ and mdbook configuration in `book.toml` like:
|
||||
output-directory = "comprehensive-rust-exercises"
|
||||
```
|
||||
|
||||
It will create a file `book/exerciser/comprehensive-rust-exercises/example/src/main.rs` with the
|
||||
It will create a file
|
||||
`book/exerciser/comprehensive-rust-exercises/example/src/main.rs` with the
|
||||
appropriate contents.
|
||||
|
||||
Reference in New Issue
Block a user