Development repository for the STLab Better Code course.
Read the book: https://stlab.github.io/better-code/
Install Rust and Cargo.
Linux/macOS:
./scripts/install-tools.shWindows (PowerShell):
.\scripts\install-tools.ps1These scripts install mdBook and all required plugins using versions from versions.txt.
mdbook serve ./better-codeOpen http://localhost:3000 in your browser.
- Edit markdown files in
better-code/src/ - Add new chapters by creating
.mdfiles and updatingbetter-code/src/SUMMARY.md - Changes automatically rebuild when you push to the main branch
- Use Markdown formatting; avoid unnecessary HTML
- Wrap lines at 80 columns for diff-friendly change tracking
- Start each chapter with a level-2 heading (
## Chapter Name) - Use level-3+ headings within chapters
- Keep file names and heading titles stable for linkability
Pull Requests:
- Validates build on Ubuntu and Windows
- No deployment; PR check shows build status
Main Branch:
- Builds book using mdBook with versions from
versions.txt - Deploys to GitHub Pages
- Available at https://stlab.github.io/better-code/
All tool versions are centrally managed in versions.txt. To update:
- Edit version number in
versions.txt - Run the appropriate install script locally
- Test with
mdbook serve ./better-code - Commit - CI automatically uses the new version
better-code/ # mdBook source and configuration
├── src/ # Markdown chapter files
├── book.toml # mdBook configuration
└── book/ # Generated HTML (gitignored)
scripts/ # Installation scripts
├── install-tools.sh # Linux/macOS
└── install-tools.ps1 # Windows
versions.txt # Single source of truth for tool versions
archive/ # Legacy Jekyll site (for reference only)
mdbook build ./better-codeOutput will be in ./better-code/book/.
The archive/ directory contains the legacy Jekyll site for reference during migration.
You can safely ignore it unless working on migration tasks.
To run the Jekyll version (not recommended for regular development):
bundle exec jekyll serve -l # Starts server at http://localhost:4000Or with Docker:
docker-compose up