Skip to content

Commit

Permalink
update original
Browse files Browse the repository at this point in the history
  • Loading branch information
funkill committed Dec 6, 2024
1 parent 269031f commit 4fa9bda
Show file tree
Hide file tree
Showing 30 changed files with 1,549 additions and 2,022 deletions.
14 changes: 4 additions & 10 deletions rustbook-en/.github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,8 @@ jobs:
- name: Run `tools` package tests
run: |
cargo test
- name: Run `mdbook-trpl-note` package tests
working-directory: packages/mdbook-trpl-note
run: |
cargo test
- name: Run `mdbook-trpl-listing` package tests
working-directory: packages/mdbook-trpl-listing
- name: Run `mdbook-trpl` package tests
working-directory: packages/mdbook-trpl
run: |
cargo test
lint:
Expand All @@ -77,10 +73,8 @@ jobs:
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.21/mdbook-v0.4.21-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
echo "$(pwd)/bin" >> "${GITHUB_PATH}"
- name: Install mdbook-trpl-note
run: cargo install --path packages/mdbook-trpl-note
- name: Install mdbook-trpl-listing
run: cargo install --path packages/mdbook-trpl-listing
- name: Install mdbook-trpl binaries
run: cargo install --path packages/mdbook-trpl
- name: Install aspell
run: sudo apt-get install aspell
- name: Install shellcheck
Expand Down
29 changes: 29 additions & 0 deletions rustbook-en/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,35 @@ of the print version. The snapshot files reflect what has been sent or not, so
they only get updated when edits are sent to No Starch. **Do not submit pull
requests changing files in the `nostarch` directory, they will be closed.**

We use [`rustfmt`][rustfmt] to apply standard formatting to Rust code in the
repo and [`dprint`][dprint] to apply standing formatting to the Markdown source
and the non-Rust code in the project.

[rustfmt]: https://github.com/rust-lang/rustfmt
[dprint]: https://dprint.dev

You will normally have `rustfmt` installed if you have a Rust toolchain
installed; if for some reason you do not have a copy of `rustfmt`, you can add
it by running the following command:

```sh
rustup component add rustfmt
```

To install `dprint`, you can run the following command:

```sh
cargo install dprint
```

Or follow the [instructions][install-dprint] on the `dprint` website.

[install-dprint]: https://dprint.dev/install/

To format Rust code, you can run `rustfmt <path to file>`, and to format other
files, you can pass `dprint <path to file>`. Many text editors also have native
support or extensions for both `rustfmt` and `dprint`.

## Checking for Fixes

The book rides the Rust release trains. Therefore, if you see a problem on
Expand Down
3 changes: 1 addition & 2 deletions rustbook-en/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@ look right, but you _will_ still be able to build the book. To use the plugins,
you should run:

```bash
$ cargo install --locked --path packages/mdbook-trpl-listing
$ cargo install --locked --path packages/mdbook-trpl-note
$ cargo install --locked --path packages/mdbook_trpl
```

## Building
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ fn main() {
// ANCHOR: here
fn calculate_length(s: &String) -> usize { // s is a reference to a String
s.len()
} // Here, s goes out of scope. But because it does not have ownership of what
// it refers to, it is not dropped.
} // Here, s goes out of scope. But because s does not have ownership of what
// it refers to, the value is not dropped.
// ANCHOR_END: here
5 changes: 5 additions & 0 deletions rustbook-en/nostarch/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,10 @@ build-dir = "../tmp"
[preprocessor.trpl-listing]
output-mode = "simple"

# Only used in this version, *not* in the root `book.toml`, because its job is
# to remove `<figure>` and `<figcaption>` markup from the version we send them.
[preprocessor.trpl-figure]
output-mode = "simple"

[rust]
edition = "2021"
Loading

0 comments on commit 4fa9bda

Please sign in to comment.