This guide covers development tasks and maintenance procedures for ruskel.
- Rust stable toolchain
- Rust nightly toolchain with rust-docs-json component (for std library mapping generation)
Install the nightly toolchain and required component:
rustup toolchain install nightly
rustup component add --toolchain nightly rust-docs-jsonRuskel uses the xtask pattern for development tasks. All tasks are run through cargo xtask.
The standard library module mapping determines which modules come from core,
alloc, or std. This mapping needs to be regenerated when:
- The Rust standard library structure changes
- New modules are added to std/core/alloc
- Module locations change between crates
To regenerate the mapping:
# Preview the changes (outputs to stdout)
cargo xtask gen-std-mapping
# Write the changes to the source file
cargo xtask gen-std-mapping --writeThis will:
- Analyze the installed rust-docs-json to discover module locations
- Generate the
STD_MODULE_MAPPINGstatic incrates/libruskel/src/cargoutils.rs - Update the source file with the new mapping
After regenerating, run the tests to ensure everything still works:
cargo testRuskel supports accessing Rust standard library documentation through the
rust-docs-json component. The key components are:
- Module Mapping: The
STD_MODULE_MAPPINGincargoutils.rsmaps module names to their actual crate locations (core/alloc/std) - Re-export Handling: When users request
std::vec, ruskel knows to load it fromallocwhile still displaying it asstd::vec - Bare Module Protection: Common module names like
vecorrcare rejected with helpful error messages