mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-04-29 19:22:33 -05:00
All module references updated to reflect new ordering: - Module 15: Quantization (was 16) - Module 16: Compression (was 17) - Module 17: Memoization (was 15) Updated by module-developer and website-manager agents: - Module ABOUT files with correct numbers and prerequisites - Cross-references and "What's Next" chains - Website navigation (_toc.yml) and content - Learning path progression in LEARNING_PATH.md - Profile milestone completion message (Module 17) Pedagogical flow now: Profile → Quantize → Prune → Cache → Accelerate
67 lines
1.9 KiB
Bash
Executable File
67 lines
1.9 KiB
Bash
Executable File
#!/bin/bash
|
||
# Build PDF version of TinyTorch book (Simple HTML-to-PDF method)
|
||
# This script builds PDF via HTML conversion - no LaTeX installation required
|
||
|
||
set -e # Exit on error
|
||
|
||
echo "🔥 Building TinyTorch PDF (Simple Method - No LaTeX Required)..."
|
||
echo ""
|
||
|
||
# Check if we're in the book directory
|
||
if [ ! -f "_config.yml" ]; then
|
||
echo "❌ Error: Must run from book/ directory"
|
||
echo "Usage: cd book && ./build_pdf_simple.sh"
|
||
exit 1
|
||
fi
|
||
|
||
# Check dependencies
|
||
echo "📋 Checking dependencies..."
|
||
if ! command -v jupyter-book &> /dev/null; then
|
||
echo "❌ Error: jupyter-book not installed"
|
||
echo "Install with: pip install jupyter-book pyppeteer"
|
||
exit 1
|
||
fi
|
||
|
||
# Check if pyppeteer is installed
|
||
python3 -c "import pyppeteer" 2>/dev/null || {
|
||
echo "❌ Error: pyppeteer not installed"
|
||
echo "Install with: pip install pyppeteer"
|
||
echo ""
|
||
echo "Note: First run will download Chromium (~170MB)"
|
||
exit 1
|
||
}
|
||
|
||
echo "✅ Dependencies OK"
|
||
echo ""
|
||
|
||
# Clean previous builds
|
||
echo "🧹 Cleaning previous builds..."
|
||
jupyter-book clean . --all || true
|
||
echo ""
|
||
|
||
# Build PDF via HTML
|
||
echo "📚 Building PDF from HTML (this may take a few minutes)..."
|
||
echo "ℹ️ First run will download Chromium browser (~170MB)"
|
||
jupyter-book build . --builder pdfhtml
|
||
|
||
# Check if build succeeded
|
||
if [ -f "_build/pdf/book.pdf" ]; then
|
||
# Copy to standard location with better name
|
||
cp "_build/pdf/book.pdf" "_build/tinytorch-course.pdf"
|
||
PDF_SIZE=$(du -h "_build/tinytorch-course.pdf" | cut -f1)
|
||
echo ""
|
||
echo "✅ PDF build complete!"
|
||
echo "📄 Output: book/_build/tinytorch-course.pdf"
|
||
echo "📊 Size: ${PDF_SIZE}"
|
||
echo ""
|
||
echo "To view the PDF:"
|
||
echo " open _build/tinytorch-course.pdf # macOS"
|
||
echo " xdg-open _build/tinytorch-course.pdf # Linux"
|
||
echo " start _build/tinytorch-course.pdf # Windows"
|
||
else
|
||
echo ""
|
||
echo "❌ PDF build failed - check errors above"
|
||
exit 1
|
||
fi
|
||
|