refactor: switch from profiles to symlink config approach for PDF builds

- Move _quarto.yml to config/_quarto-html.yml
- Move profile PDF config to config/_quarto-pdf.yml
- Create symlink _quarto.yml -> config/_quarto-html.yml
- Update Makefile to switch configs via symlink (matches book approach)
- This fixes the per-file PDF rendering issue caused by profile merging
This commit is contained in:
Vijay Janapa Reddi
2025-12-28 11:17:30 -05:00
parent 4509f1142a
commit f87c88f699
4 changed files with 198 additions and 191 deletions

View File

@@ -2,6 +2,7 @@
# Hardware Kits Build System
# =============================================================================
# Part of the MLSysBook ecosystem
# Uses symlink switching between HTML and PDF configs (like the book)
# =============================================================================
.PHONY: all build html pdf preview clean help
@@ -13,18 +14,22 @@ all: html
html: build
build:
@echo "🔧 Building Hardware Kits HTML site..."
ln -sf config/_quarto-html.yml _quarto.yml
quarto render
@echo "✅ Build complete: _build/"
# Build PDF with cover page
pdf:
@echo "📄 Building Hardware Kits PDF..."
quarto render --profile pdf
ln -sf config/_quarto-pdf.yml _quarto.yml
quarto render --to titlepage-pdf
ln -sf config/_quarto-html.yml _quarto.yml
@echo "✅ PDF build complete: _build/pdf/"
# Preview the site locally
preview:
@echo "👀 Starting preview server..."
ln -sf config/_quarto-html.yml _quarto.yml
quarto preview
# Clean build artifacts

View File

@@ -1,186 +0,0 @@
# =============================================================================
# HARDWARE KITS WEBSITE CONFIGURATION
# =============================================================================
# Standalone Quarto project for hardware labs and kits
# Part of the MLSysBook ecosystem: mlsysbook.ai/kits/
# =============================================================================
project:
type: website
output-dir: _build
website:
title: "Hardware Kits"
page-navigation: true
reader-mode: false
back-to-top-navigation: true
bread-crumbs: true
search:
keyboard-shortcut: ["/"]
# Navbar matches Book exactly (same structure, same order)
navbar:
background: light
logo: "assets/images/favicon.png"
search: true
pinned: true
collapse: true
collapse-below: "md"
title: "Machine Learning Systems"
left:
- text: "Hardware Kits"
menu:
- icon: book-half
text: "Textbook"
href: https://mlsysbook.ai
- icon: fire
text: "TinyTorch"
href: https://mlsysbook.ai/tinytorch
- icon: cpu
text: "Hardware Kits"
href: https://mlsysbook.ai/kits
- text: "---"
- icon: lightbulb
text: "Co-Labs (Coming 2026)"
href: https://mlsysbook.ai
right:
- icon: download
text: "Downloads"
menu:
- icon: file-pdf
text: "Textbook PDF"
href: https://mlsysbook.ai/assets/downloads/Machine-Learning-Systems.pdf
target: _blank
- icon: journal-text
text: "Textbook EPUB"
href: https://mlsysbook.ai/assets/downloads/Machine-Learning-Systems.epub
target: _blank
- icon: star
text: "Star"
href: https://github.com/harvard-edge/cs249r_book#support-this-work
target: _blank
- icon: heart
text: "Support"
href: https://opencollective.com/mlsysbook
target: _blank
- icon: envelope
text: "Subscribe"
href: https://mlsysbook.ai#subscribe
- icon: github
text: "GitHub"
menu:
- icon: pencil
text: "Edit this page"
href: https://github.com/harvard-edge/cs249r_book
target: _blank
- icon: bug
text: "Report an issue"
href: https://github.com/harvard-edge/cs249r_book/issues/new
target: _blank
- icon: chat
text: "Discussions"
href: https://github.com/harvard-edge/cs249r_book/discussions
target: _blank
- icon: code
text: "View source"
href: https://github.com/harvard-edge/cs249r_book
target: _blank
sidebar:
- id: main
style: "floating"
background: light
collapse-level: 2
contents:
- text: "Overview"
href: index.qmd
- text: "Getting Started"
href: contents/getting-started.qmd
- text: "Platforms"
href: contents/platforms.qmd
- text: "IDE Setup"
href: contents/ide-setup.qmd
- text: "---"
- section: "Arduino Nicla Vision"
id: arduino
contents:
- href: contents/arduino/nicla_vision/nicla_vision.qmd
- href: contents/arduino/nicla_vision/setup/setup.qmd
- href: contents/arduino/nicla_vision/image_classification/image_classification.qmd
- href: contents/arduino/nicla_vision/object_detection/object_detection.qmd
- href: contents/arduino/nicla_vision/kws/kws.qmd
- href: contents/arduino/nicla_vision/motion_classification/motion_classification.qmd
- section: "Seeed XIAO ESP32S3"
id: seeed-xiao
contents:
- href: contents/seeed/xiao_esp32s3/xiao_esp32s3.qmd
- href: contents/seeed/xiao_esp32s3/setup/setup.qmd
- href: contents/seeed/xiao_esp32s3/image_classification/image_classification.qmd
- href: contents/seeed/xiao_esp32s3/object_detection/object_detection.qmd
- href: contents/seeed/xiao_esp32s3/kws/kws.qmd
- href: contents/seeed/xiao_esp32s3/motion_classification/motion_classification.qmd
- section: "Grove Vision AI V2"
id: grove-vision
contents:
- href: contents/seeed/grove_vision_ai_v2/grove_vision_ai_v2.qmd
- href: contents/seeed/grove_vision_ai_v2/setup_and_no_code_apps/setup_and_no_code_apps.qmd
- href: contents/seeed/grove_vision_ai_v2/image_classification/image_classification.qmd
- href: contents/seeed/grove_vision_ai_v2/object_detection/object_detection.qmd
- section: "Raspberry Pi"
id: raspberry-pi
contents:
- href: contents/raspi/raspi.qmd
- href: contents/raspi/setup/setup.qmd
- href: contents/raspi/image_classification/image_classification.qmd
- href: contents/raspi/object_detection/object_detection.qmd
- href: contents/raspi/llm/llm.qmd
- href: contents/raspi/vlm/vlm.qmd
- section: "Shared Resources"
id: shared
contents:
- href: contents/shared/shared.qmd
- href: contents/shared/kws_feature_eng/kws_feature_eng.qmd
- href: contents/shared/dsp_spectral_features_block/dsp_spectral_features_block.qmd
page-footer:
left: |
© 2024-2025 Harvard University. Licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC-BY-NC-SA 4.0</a>
center: |
Part of the <a href="https://mlsysbook.ai">Machine Learning Systems</a> textbook
right:
- icon: github
href: https://github.com/harvard-edge/cs249r_book
aria-label: "View source on GitHub"
- icon: star
href: https://github.com/harvard-edge/cs249r_book
aria-label: "Star this repository"
background: light
border: true
format:
html:
theme:
light:
- default
- assets/styles/style.scss
dark:
- default
- assets/styles/style.scss
- assets/styles/dark-mode.scss
respect-user-color-scheme: true
toc: true
toc-depth: 3
number-sections: false
code-copy: true
code-overflow: wrap
highlight-style: github
link-external-icon: false
link-external-newwindow: true
anchor-sections: true

1
kits/_quarto.yml Symbolic link
View File

@@ -0,0 +1 @@
config/_quarto-pdf.yml

View File

@@ -0,0 +1,186 @@
# =============================================================================
# HARDWARE KITS WEBSITE CONFIGURATION
# =============================================================================
# Standalone Quarto project for hardware labs and kits
# Part of the MLSysBook ecosystem: mlsysbook.ai/kits/
# =============================================================================
project:
type: website
output-dir: _build
website:
title: "Hardware Kits"
page-navigation: true
reader-mode: false
back-to-top-navigation: true
bread-crumbs: true
search:
keyboard-shortcut: ["/"]
# Navbar matches Book exactly (same structure, same order)
navbar:
background: light
logo: "assets/images/favicon.png"
search: true
pinned: true
collapse: true
collapse-below: "md"
title: "Machine Learning Systems"
left:
- text: "Hardware Kits"
menu:
- icon: book-half
text: "Textbook"
href: https://mlsysbook.ai
- icon: fire
text: "TinyTorch"
href: https://mlsysbook.ai/tinytorch
- icon: cpu
text: "Hardware Kits"
href: https://mlsysbook.ai/kits
- text: "---"
- icon: lightbulb
text: "Co-Labs (Coming 2026)"
href: https://mlsysbook.ai
right:
- icon: download
text: "Downloads"
menu:
- icon: file-pdf
text: "Textbook PDF"
href: https://mlsysbook.ai/assets/downloads/Machine-Learning-Systems.pdf
target: _blank
- icon: journal-text
text: "Textbook EPUB"
href: https://mlsysbook.ai/assets/downloads/Machine-Learning-Systems.epub
target: _blank
- icon: star
text: "Star"
href: https://github.com/harvard-edge/cs249r_book#support-this-work
target: _blank
- icon: heart
text: "Support"
href: https://opencollective.com/mlsysbook
target: _blank
- icon: envelope
text: "Subscribe"
href: https://mlsysbook.ai#subscribe
- icon: github
text: "GitHub"
menu:
- icon: pencil
text: "Edit this page"
href: https://github.com/harvard-edge/cs249r_book
target: _blank
- icon: bug
text: "Report an issue"
href: https://github.com/harvard-edge/cs249r_book/issues/new
target: _blank
- icon: chat
text: "Discussions"
href: https://github.com/harvard-edge/cs249r_book/discussions
target: _blank
- icon: code
text: "View source"
href: https://github.com/harvard-edge/cs249r_book
target: _blank
sidebar:
- id: main
style: "floating"
background: light
collapse-level: 2
contents:
- text: "Overview"
href: index.qmd
- text: "Getting Started"
href: contents/getting-started.qmd
- text: "Platforms"
href: contents/platforms.qmd
- text: "IDE Setup"
href: contents/ide-setup.qmd
- text: "---"
- section: "Arduino Nicla Vision"
id: arduino
contents:
- href: contents/arduino/nicla_vision/nicla_vision.qmd
- href: contents/arduino/nicla_vision/setup/setup.qmd
- href: contents/arduino/nicla_vision/image_classification/image_classification.qmd
- href: contents/arduino/nicla_vision/object_detection/object_detection.qmd
- href: contents/arduino/nicla_vision/kws/kws.qmd
- href: contents/arduino/nicla_vision/motion_classification/motion_classification.qmd
- section: "Seeed XIAO ESP32S3"
id: seeed-xiao
contents:
- href: contents/seeed/xiao_esp32s3/xiao_esp32s3.qmd
- href: contents/seeed/xiao_esp32s3/setup/setup.qmd
- href: contents/seeed/xiao_esp32s3/image_classification/image_classification.qmd
- href: contents/seeed/xiao_esp32s3/object_detection/object_detection.qmd
- href: contents/seeed/xiao_esp32s3/kws/kws.qmd
- href: contents/seeed/xiao_esp32s3/motion_classification/motion_classification.qmd
- section: "Grove Vision AI V2"
id: grove-vision
contents:
- href: contents/seeed/grove_vision_ai_v2/grove_vision_ai_v2.qmd
- href: contents/seeed/grove_vision_ai_v2/setup_and_no_code_apps/setup_and_no_code_apps.qmd
- href: contents/seeed/grove_vision_ai_v2/image_classification/image_classification.qmd
- href: contents/seeed/grove_vision_ai_v2/object_detection/object_detection.qmd
- section: "Raspberry Pi"
id: raspberry-pi
contents:
- href: contents/raspi/raspi.qmd
- href: contents/raspi/setup/setup.qmd
- href: contents/raspi/image_classification/image_classification.qmd
- href: contents/raspi/object_detection/object_detection.qmd
- href: contents/raspi/llm/llm.qmd
- href: contents/raspi/vlm/vlm.qmd
- section: "Shared Resources"
id: shared
contents:
- href: contents/shared/shared.qmd
- href: contents/shared/kws_feature_eng/kws_feature_eng.qmd
- href: contents/shared/dsp_spectral_features_block/dsp_spectral_features_block.qmd
page-footer:
left: |
© 2024-2025 Harvard University. Licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/">CC-BY-NC-SA 4.0</a>
center: |
Part of the <a href="https://mlsysbook.ai">Machine Learning Systems</a> textbook
right:
- icon: github
href: https://github.com/harvard-edge/cs249r_book
aria-label: "View source on GitHub"
- icon: star
href: https://github.com/harvard-edge/cs249r_book
aria-label: "Star this repository"
background: light
border: true
format:
html:
theme:
light:
- default
- assets/styles/style.scss
dark:
- default
- assets/styles/style.scss
- assets/styles/dark-mode.scss
respect-user-color-scheme: true
toc: true
toc-depth: 3
number-sections: false
code-copy: true
code-overflow: wrap
highlight-style: github
link-external-icon: false
link-external-newwindow: true
anchor-sections: true

View File

@@ -1,8 +1,9 @@
# =============================================================================
# HARDWARE KITS PDF PROFILE
# HARDWARE KITS PDF CONFIGURATION
# =============================================================================
# This profile builds the Hardware Kits labs as a standalone PDF with cover.
# Usage: quarto render --profile pdf
# Standalone PDF book configuration with custom cover page.
# Usage: ln -sf config/_quarto-pdf.yml _quarto.yml && quarto render --to titlepage-pdf
# Or: make pdf
# =============================================================================
project:
@@ -68,7 +69,7 @@ book:
- contents/shared/dsp_spectral_features_block/dsp_spectral_features_block.qmd
format:
pdf:
titlepage-pdf:
pdf-engine: lualatex
use-rsvg-convert: true
documentclass: scrbook