rust语言 https://wiki.yoqi.me/rust-note/

天问 21dbc1a50f Update 'README.md' 1 month ago
.vscode 7102d998c5 init 9 months ago
docs 3993d298d9 0 9 months ago
hello_world c2978fac59 0 9 months ago
rusty-book c4e8c096e1 0 9 months ago
.gitignore 3993d298d9 0 9 months ago
README.md 21dbc1a50f Update 'README.md' 1 month ago

README.md

Rust

rust 语言

可以开发命令行,web,嵌入式。文件 .rs 结尾

fn main() {
    println!("Hello World!");
}

编译运行:

rustc hello.rs 
./hello

# 或者 cargo 编译
cargo build 
cargo run 

Develop

rust,vs, vscode, 安装vs主要是安装C++编译工具(MSVC )。

https://static.rust-lang.org/rustup/dist/i686-pc-windows-gnu/rustup-init.exe

构建文档,采用 mdbook,类似gitbook主题,先安装rust:


# 启动rust环境
docker run --rm -it -w /app -v $(pwd)/docs:/app rust:latest

# 安装 mdbook
cargo install --git https://github.com/rust-lang/mdBook.git mdbook

mdbook init mybook

# 数学公式
cargo install mdbook-katex

# 代码块
cargo install mdbook-admonish
mdbook-admonish install

# 导出pdf,会安装 chromium
cargo install mdbook-pdf
cargo install mdbook-pdf --features fetch
pip install mdbook-pdf-outline

mdbook serve --open

mdbook build

Reference