I’ve been playing with the `gemini` CLI tool recently (https://google-gemini.github.io/gemini-cli/) and learned that it will read instructions from it’s own kind of README. So I asked it to generate one and use it as a basis for this file. I took the liberty to expand the style guide a little at the same time to incorporate that instructions I gave Gemini while generating the [many language fixing PRs][1]. [1]: https://github.com/google/comprehensive-rust/pulls?q=author%3Amgeisler+%22improve+language%22 --------- Co-authored-by: Dmitri Gribenko <gribozavr@gmail.com>
2.6 KiB
Project Overview
This repository contains the source code for Comprehensive Rust, a family of
courses on Rust developed by Google, starting with Rust foundations, and
including deep dives into specialized topics like Android, Chromium, bare-metal
development, and concurrency. The project is a Rust workspace that leverages
mdbook to generate a course website.
Key Technologies
- Rust: The primary programming language for the course subject, custom tools, and examples.
- mdbook: A command-line tool to create books from Markdown files, used for generating the course website.
- Custom mdbook Preprocessors:
mdbook-courseandmdbook-exerciserare Rust binaries that extendmdbook's functionality, for example, to extract exercise starter code. cargo xtask: A custom binary within the workspace used for project automation, simplifying common development tasks.
Building and Running
The project uses cargo xtask for project-specific automation, like builds,
tests, and managing translations.
Setup
- Install Rust: Follow the instructions on https://rustup.rs/.
- Clone Repository:
git clone https://github.com/google/comprehensive-rust/ cd comprehensive-rust - Install Project Tools:
cargo xtask install-tools
Commands
All commands are run using cargo xtask. Run cargo xtask --help for a full
list of options.
-
Serve the Course Locally: Starts a web server to view the course content.
cargo xtask serve [--language <ISO_639_language_code>] [--output <output_directory>](e.g.,
cargo xtask serve -l dafor the Danish translation) -
Build the Course: Creates a static version of the course in the
book/directory.cargo xtask build [--language <ISO_639_language_code>] [--output <output_directory>] -
Run Rust Snippet Tests: Tests all Rust code snippets included in the course material.
cargo xtask rust-tests -
Run Web Driver Tests: Executes web driver tests located in the
tests/directory.cargo xtask web-tests [--dir <book_html_directory>]
Development Conventions
- Project Automation:
cargo xtaskis the primary interface for common development tasks. - Course Content: Markdown files in the
src/directory, structured according tosrc/SUMMARY.md. - Code Formatting:
dprint fmtis used to format all source files according torustfmt.tomlanddprint.json. - Contributions: Refer to
CONTRIBUTING.mdfor guidelines on contributing to the project. - Style: Refer to
STYLE.mdfor style guidelines.