mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-11-17 16:04:28 -06:00
- kits, labs, and the MLSys·im docs: _quarto.yml was a symlink to config/_quarto-html.yml. The website config now lives at _quarto.yml. The kits PDF build copies config/_quarto-pdf.yml over it for the render and restores it afterwards, and the CI PDF job copies instead of linking. - Book builds: the binder CLI wrote books/_quarto.yml and books/index.qmd as symlinks. ConfigManager.activate_config (formerly setup_symlink) now writes copies, and the first line of _quarto.yml names its source, which status, doctor, clean, and save_latex_log read. The mapped chapter harness snapshots and restores both files by content. The Linux container job copies index.qmd, as the Windows job already did. - StaffML: releases/latest was a symlink to the current release directory. releases/latest.txt now holds the version and is replaced atomically on publish; vault doctor, release publish, and the paper macro script read it. A worktree that still holds the old books/_quarto.yml or index.qmd symlink is safe: the next build removes the link before writing, so the source config and volume index are never overwritten through it.
53 lines
1.6 KiB
Makefile
53 lines
1.6 KiB
Makefile
# =============================================================================
|
|
# Hardware Kits Build System
|
|
# =============================================================================
|
|
# Part of the MLSysBook ecosystem
|
|
# _quarto.yml is the website config. The PDF build copies config/_quarto-pdf.yml
|
|
# over it for the render and restores the website config afterwards.
|
|
# =============================================================================
|
|
|
|
.PHONY: all build html pdf preview clean help
|
|
|
|
# Default target
|
|
all: html
|
|
|
|
# Build HTML site (default)
|
|
html: build
|
|
build:
|
|
@echo "🔧 Building Hardware Kits HTML site..."
|
|
quarto render
|
|
@echo "✅ Build complete: _build/"
|
|
|
|
# Build PDF with cover page
|
|
pdf:
|
|
@echo "📄 Building Hardware Kits PDF..."
|
|
@backup=$$(mktemp) && cp _quarto.yml "$$backup" && \
|
|
trap "mv -f '$$backup' _quarto.yml" EXIT && trap 'exit 130' INT TERM && \
|
|
cp config/_quarto-pdf.yml _quarto.yml && \
|
|
quarto render --to titlepage-pdf
|
|
@echo "✅ PDF build complete: _build/pdf/"
|
|
|
|
# Preview the site locally
|
|
preview:
|
|
@echo "👀 Starting preview server..."
|
|
quarto preview
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
@echo "🧹 Cleaning build artifacts..."
|
|
rm -rf _build
|
|
rm -rf .quarto
|
|
@echo "✅ Clean complete"
|
|
|
|
# Help
|
|
help:
|
|
@echo "Hardware Kits Build System"
|
|
@echo ""
|
|
@echo "Available targets:"
|
|
@echo " make build - Build HTML site to _build/"
|
|
@echo " make html - Build HTML site to _build/ (same as build)"
|
|
@echo " make pdf - Build PDF to _build/pdf/"
|
|
@echo " make preview - Start local preview server"
|
|
@echo " make clean - Remove build artifacts"
|
|
@echo " make help - Show this help message"
|