Files
TinyTorch/site/build_pdf_simple.sh
Vijay Janapa Reddi a5679de141 Update documentation after module reordering
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
2025-11-10 19:37:41 -05:00

67 lines
1.9 KiB
Bash
Executable File
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/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