forked from google/comprehensive-rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Format files with
dprint
(google#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]: google/mdbook-i18n-helpers#19
- Loading branch information
1 parent
8611127
commit 074e21d
Showing
9 changed files
with
67 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,7 @@ trigger when going through the code samples. We hope to improve on this via | |
## Building | ||
|
||
The course is built using a few tools: | ||
|
||
- [mdbook](https://github.com/rust-lang/mdBook) | ||
- [mdbook-svgbob](https://github.com/boozook/mdbook-svgbob) | ||
- [mdbook-i18n-helpers](https://github.com/google/mdbook-i18n-helpers) | ||
|
@@ -64,9 +65,10 @@ and zip exercises and add them to `book/html`. To build any of the translated | |
versions of the course, run `MDBOOK_BOOK__LANGUAGE=xx mdbook build -d book/xx` | ||
where `xx` is the ISO 639 language code (e.g. `da` for the Danish translation). | ||
[TRANSLATIONS.md](TRANSLATIONS.md) contains further instructions. | ||
|
||
## Contact | ||
|
||
For questions or comments, please contact [Martin | ||
Geisler](mailto:[email protected]) or start a [discussion on | ||
GitHub](https://github.com/google/comprehensive-rust/discussions). We would love | ||
to hear from you. | ||
For questions or comments, please contact | ||
[Martin Geisler](mailto:[email protected]) or start a | ||
[discussion on GitHub](https://github.com/google/comprehensive-rust/discussions). | ||
We would love to hear from you. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
{ | ||
"lineWidth": 80, | ||
"json": {}, | ||
"markdown": { | ||
"textWrap": "always" | ||
}, | ||
"toml": {}, | ||
"exec": { | ||
"associations": "**/*.rs", | ||
"rustfmt": "rustfmt --edition 2021", | ||
"rustfmt.associations": "**/*.rs" | ||
}, | ||
"includes": [ | ||
"**/*.json", | ||
"**/*.md", | ||
"**/*.rs", | ||
"**/*.toml" | ||
], | ||
"excludes": [ | ||
"/src/", | ||
"/third_party/", | ||
"target/" | ||
], | ||
"plugins": [ | ||
"https://plugins.dprint.dev/exec-0.3.5.json@d687dda57be0fe9a0088ccdaefa5147649ff24127d8b3ea227536c68ee7abeab", | ||
"https://plugins.dprint.dev/json-0.17.2.wasm", | ||
"https://plugins.dprint.dev/markdown-0.15.2.wasm", | ||
"https://plugins.dprint.dev/toml-0.5.4.wasm" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
[package] | ||
name = "mdbook-exerciser" | ||
version = "0.1.0" | ||
authors = ["Andrew Walbran <[email protected]>"] | ||
edition = "2021" | ||
license = "Apache-2.0" | ||
authors = ["Andrew Walbran <[email protected]>"] | ||
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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
imports_granularity = "module" # Please use nightly for this setting. | ||
imports_granularity = "module" # Please use nightly for this setting. | ||
max_width = 90 |