Repo Structure

  • The repo contains a book, which markdown sources are in the src folder.
  • After the book is built using mdbook⮳, the resulting HTML and Javascript are found in book/html.
  • The intermediate (processed) Markdown is in book/markdown. The mdbook⮳ configuration is in book.toml ; the templates and assets are in theme and static respectively.
  • The Rust code is organized as a cargo⮳ workspace:
    • Examples that are embedded in the book are found in crates below bk/crates, named after sections of the book or grouping multiple (crates.io) categories of examples. Each example is in a single, short .rs file. The Cargo.toml within these crates list the dependencies used by the embedded examples. Use cargo add <crate> -F <feature> while in the appropriate crate folder to add more as required.
    • Additional examples that are too long or complex to be inserted in the book itself can be added under crates/xmpl.
    • crates/tools contains utilities to build sections of the book, for example some indices.
  • The Dev Container and Docker (Compose) configuration files are found in .devcontainer .

All Examples are Fully and Continuously Tested

In order to make sure that all examples work, they are backed by tests, similar to the following:

#[test]
fn test() {
    main();
}

For the sake of readability, that boilerplate is hidden by default. In order to read the full contents, click on the "expand" () button located in the top right corner of the code snippets.