Build and Open Local Rust Documentation
cargo doc --open
Doctest
See: Doctest in Rust
Hot Reloading
Install two tools
cargo install --locked cargo-watch
npm i -g browser-sync
Then run the following commands in parallel
browser-sync ./target/doc -w
cargo watch -s 'cargo doc'
We can run the two commands in two separate terminals, or we can send one of then into background.
Reference: Hot reloading your cargo docs