update workflows

main
kazeno 7 hours ago
parent ba725abaee
commit 1ee4427751

@ -25,8 +25,8 @@ jobs:
- name: Install mdbook & mdbook-typst-pdf
run: |
mkdir bin
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.49/mdbook-v0.4.49-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
curl -sSL https://github.com/KaiserY/mdbook-typst-pdf/releases/download/v0.6.3/mdbook-typst-pdf-x86_64-unknown-linux-musl.tar.xz | tar -xJ --directory=bin --strip-components 1
curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.5.2/mdbook-v0.5.2-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=bin
curl -sSL https://github.com/KaiserY/mdbook-typst-pdf/releases/download/v0.7.0/mdbook-typst-pdf-x86_64-unknown-linux-musl.tar.xz | tar -xJ --directory=bin --strip-components 1
echo "$(pwd)/bin" >> ${GITHUB_PATH}
- name: Install font
run: |

@ -16,7 +16,9 @@ additional-css = [
]
additional-js = ["ferris.js"]
git-repository-url = "https://github.com/KaiserY/trpl-zh-cn/tree/main"
edit-url-template = "https://github.com/KaiserY/trpl-zh-cn/edit/main/{path}"
[output.html.search]
use-boolean-and = true
[output.typst-pdf]
custom-template = "custom-template.typ"
@ -25,4 +27,4 @@ section-number = true
rust-book = true
[rust]
edition = "2021"
edition = "2024"

@ -5,7 +5,7 @@
`cargo install` 命令用于在本地安装和使用二进制 crate。它并不打算替换系统中的包它意在作为一个方便 Rust 开发者们安装其他人已经在 [crates.io](https://crates.io/)<!-- ignore --> 上共享的工具的手段。只有拥有二进制目标文件的包能够被安装。**二进制目标** 文件是在 crate 有 *src/main.rs* 或者其他指定为二进制文件时所创建的可执行程序,这不同于自身不能执行但适合包含在其他程序中的库目标文件。通常 crate 的 *README* 文件中有该 crate 是库、二进制目标还是两者兼有的信息。
所有来自 `cargo install` 的二进制文件都安装到 Rust 安装根目录的 *bin* 文件夹中。如果你是使用 *rustup.rs* 来安装 Rust 且没有自定义任何配置,这个目录将是 *$HOME/.cargo/bin*。确保将这个目录添加到 `$PATH` 环境变量中就能够运行通过 `cargo install` 安装的程序了。
所有来自 `cargo install` 的二进制文件都安装到 Rust 安装根目录的 *bin* 文件夹中。如果你是使用 *rustup.rs* 来安装 Rust 且没有自定义任何配置,这个目录将是 `$HOME/.cargo/bin`。确保将这个目录添加到 `$PATH` 环境变量中就能够运行通过 `cargo install` 安装的程序了。
例如,第十二章提到的叫做 `ripgrep` 的用于搜索文件的 `grep` 的 Rust 实现。为了安装 `ripgrep` 运行如下:

Loading…
Cancel
Save