### Bash Commands for Building and Serving Rust Coding Guidelines Locally Source: https://context7.com/rust-coding-guidelines/rust-coding-guidelines-zh/llms.txt These bash commands provide instructions for setting up and running the Rust coding guidelines documentation locally. They cover installing necessary tools like mdBook and its preprocessors, building the documentation, serving it with live reload, and deploying it to GitHub Pages. ```bash # Install mdBook and required preprocessors car go install mdbook car go install mdbook-toc car go install mdbook-mermaid # Build the book mdbook build # Serve locally with live reload mdbook serve --open # Deploy to GitHub Pages make deploy ``` -------------------------------- ### Makefile for Deploying Rust Coding Guidelines Source: https://context7.com/rust-coding-guidelines/rust-coding-guidelines-zh/llms.txt This Makefile defines commands to initialize a Git worktree, build the mdBook documentation, copy the built files, commit changes, and push to the gh-pages branch on GitHub. It automates the deployment process for the Rust coding guidelines. ```makefile .PHONY: deploy init: git worktree add -f /tmp/rustguidebook gh-pages git worktree remove -f /tmp/rustguidebook git worktree add -f /tmp/rustguidebook gh-pages deploy: init @echo "====> deploying to github" mdbook build rm -rf /tmp/rustguidebook/* cp -rp book/ /tmp/rustguidebook/ cd /tmp/rustguidebook && \ git add -A && \ git commit -m "deployed on $(shell date) by ${USER}" && \ git push origin gh-pages ``` -------------------------------- ### mdBook Configuration for Rust Coding Guidelines Source: https://context7.com/rust-coding-guidelines/rust-coding-guidelines-zh/llms.txt This TOML file configures the mdBook for building the Rust coding guidelines documentation. It sets project authors, language, source directory, and title. It also configures preprocessors like toc and mermaid, and specifies HTML output settings including the Git repository URL and additional JavaScript files. ```toml [book] authors = ["blackanger"] language = "zh" multilingual = false src = "src" title = "Rust 编码规范 V 1.0 beta" [build] create-missing = true [preprocessor.toc] command = "mdbook-toc" renderer = ["html"] max-level = 2 [preprocessor.mermaid] command = "mdbook-mermaid" [output.html] git-repository-url = "https://github.com/Rust-Coding-Guidelines/rust-coding-guidelines-zh" additional-js = ["mermaid.min.js", "mermaid-init.js"] [output.html.fold] enable = true level = 0 ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.