Files
cs249r_book/book/quarto/_extensions
Vijay Janapa Reddi 516c0122b7 fix(callouts): normalize Learning Objectives geometry to match foldbox
Native Quarto callouts (.callout-tip used for Learning Objectives,
.callout-note, etc.) have three sources of visible blank space that
make them look inconsistent with custom foldbox callouts (Napkin Math,
War Story, Example, etc.) across the book:

1. Bootstrap's '.callout-body > :first-child { padding-top: .5rem }'
   stacks on top of the body container's own padding-top, producing a
   visible gap when the body starts with a <ul>.

2. '.callout-icon-container' and '.callout-title-container' carry
   'padding-bottom: 1em' from Quarto's own stylesheet, making the
   header 17px taller than a foldbox <summary>.

3. '.callout .callout-body' in _base-styles.scss sets padding-top to
   0.75rem; foldbox.css sets its body padding-top to 0.5rem.

Fix, all in foldbox.css (the canonical home for callout geometry):
- Add a :first-child rule symmetric to the existing :last-child rule,
  zeroing margin-top and padding-top.
- Zero padding-bottom on .callout-header > .callout-icon-container and
  .callout-title-container for native callouts.

In _base-styles.scss:
- Reduce .callout .callout-body padding-top from 0.75rem to 0.5rem to
  match foldbox's body padding.

Verified via Playwright measurement: Learning Objectives header height
now 37.17px (was 54.17px), body padding-top 8.5px (was 12.75px), exactly
matching Napkin Math foldbox summary (36.88px / 8.5px).
2026-04-24 12:30:37 -04:00
..

MLSysBook Extensions

This directory contains Quarto extensions used by the MLSysBook project.

⚠️ CRITICAL WARNING - READ BEFORE MAKING CHANGES

Some extensions in this directory are HEAVILY CUSTOMIZED and should NEVER be reinstalled using quarto add.

🔍 Quick Safety Check

Before installing or updating any extension, ALWAYS check for:

  1. .CUSTOM_LOCK files in extension directories
  2. Version numbers ending in -mlsysbook-custom
  3. Warnings in extension _extension.yml files

📋 Extension Inventory

Extension Status Safe to Update?
`margin-video`🚫 **100% Custom**Never (MLSysBook only)
`ute/custom-numbered-blocks`🚫 **Heavy Customization**Never
`nmfs-opensci/titlepage`🚫 **Customized**Never
`pandoc-ext/diagram` StandardYes
`quarto-ext/lightbox` StandardYes

🚨 Emergency Recovery

If you accidentally overwrote a custom extension:

# Check what changed
git status

# Restore from git if needed
git checkout HEAD -- book/_extensions/EXTENSION_NAME/

# Run protection check
python tools/scripts/check_custom_extensions.py

📚 Full Documentation

For complete details, see: CUSTOM_EXTENSIONS.md


When in doubt, DON'T reinstall - ask the team first!