Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

mdBook Rust Integration

This book uses mdBook’s Rust code execution to provide interactive nutritional calculators.

How It Works

Each recipe includes an editable Rust program that calculates the total nutritional values based on the ingredients. You can:

  1. Modify ingredient values if your specific products have different nutritional content (e.g., your yogurt brand has different protein/fat ratios)
  2. Adjust portion sizes to match what you actually use
  3. Change target values if your meal targets differ from the defaults
  4. Run the program to see if your modified recipe still hits the nutritional targets

This lets you quickly verify that substitutions or portion adjustments still fit within your macro goals without manual calculation.

Usage

  1. Look for the code block in a recipe
  2. Edit any values (ingredients, amounts, targets)
  3. Click “Run” to see the calculated totals and whether they match your targets