From 4bb01901449f57583c9878ea2bc3db762ff37fdc Mon Sep 17 00:00:00 2001 From: Vijay Janapa Reddi Date: Fri, 14 Nov 2025 18:27:20 -0500 Subject: [PATCH] Update build scripts and site configuration - Update PDF build scripts for site directory structure - Update Jupyter Book configuration files - Update site README with current build instructions --- site/README.md | 10 +++++----- site/_config.yml | 4 +++- site/build_pdf.sh | 8 ++++---- site/build_pdf_simple.sh | 8 ++++---- site/conf.py | 2 +- 5 files changed, 17 insertions(+), 15 deletions(-) diff --git a/site/README.md b/site/README.md index 814a1201..788c586f 100644 --- a/site/README.md +++ b/site/README.md @@ -11,7 +11,7 @@ This directory contains the TinyTorch course content built with [Jupyter Book](h ### Option 1: HTML (Default Website) ```bash -cd book +cd site jupyter-book build . ``` @@ -22,7 +22,7 @@ Output: `_build/html/index.html` No LaTeX installation required! ```bash -cd book +cd site make install-pdf # Install dependencies make pdf-simple # Build PDF ``` @@ -34,7 +34,7 @@ Output: `_build/tinytorch-course.pdf` Requires LaTeX installation (texlive, mactex, etc.) ```bash -cd book +cd site make pdf ``` @@ -71,7 +71,7 @@ See **[PDF_BUILD_GUIDE.md](PDF_BUILD_GUIDE.md)** for: ## 🏗️ Structure ``` -book/ +site/ ├── _config.yml # Jupyter Book configuration ├── _toc.yml # Table of contents ├── chapters/ # Course chapters (01-20) @@ -113,7 +113,7 @@ Visit: http://localhost:8000 ```bash pip install sphinx-autobuild -sphinx-autobuild book book/_build/html +sphinx-autobuild site site/_build/html ``` ## 🤝 Contributing diff --git a/site/_config.yml b/site/_config.yml index bc07ea74..3f27ca92 100644 --- a/site/_config.yml +++ b/site/_config.yml @@ -35,7 +35,7 @@ exclude_patterns: # GitHub repository configuration for GitHub Pages repository: url: https://github.com/mlsysbook/TinyTorch - path_to_book: book + path_to_book: site branch: main # HTML output configuration @@ -53,6 +53,8 @@ html: # Custom JavaScript extra_js: - _static/wip-banner.js + - _static/ml-timeline.js + - _static/hero-carousel.js # Favicon configuration favicon: "_static/favicon.svg" diff --git a/site/build_pdf.sh b/site/build_pdf.sh index a888b717..fd08e798 100755 --- a/site/build_pdf.sh +++ b/site/build_pdf.sh @@ -7,10 +7,10 @@ set -e # Exit on error echo "🔥 Building TinyTorch PDF..." echo "" -# Check if we're in the book directory +# Check if we're in the site directory if [ ! -f "_config.yml" ]; then - echo "❌ Error: Must run from book/ directory" - echo "Usage: cd book && ./build_pdf.sh" + echo "❌ Error: Must run from site/ directory" + echo "Usage: cd site && ./build_pdf.sh" exit 1 fi @@ -51,7 +51,7 @@ if [ -f "_build/latex/tinytorch-course.pdf" ]; then PDF_SIZE=$(du -h "_build/latex/tinytorch-course.pdf" | cut -f1) echo "" echo "✅ PDF build complete!" - echo "📄 Output: book/_build/latex/tinytorch-course.pdf" + echo "📄 Output: site/_build/latex/tinytorch-course.pdf" echo "📊 Size: ${PDF_SIZE}" echo "" echo "To view the PDF:" diff --git a/site/build_pdf_simple.sh b/site/build_pdf_simple.sh index 0b1b83fc..cc2319bd 100755 --- a/site/build_pdf_simple.sh +++ b/site/build_pdf_simple.sh @@ -7,10 +7,10 @@ set -e # Exit on error echo "🔥 Building TinyTorch PDF (Simple Method - No LaTeX Required)..." echo "" -# Check if we're in the book directory +# Check if we're in the site directory if [ ! -f "_config.yml" ]; then - echo "❌ Error: Must run from book/ directory" - echo "Usage: cd book && ./build_pdf_simple.sh" + echo "❌ Error: Must run from site/ directory" + echo "Usage: cd site && ./build_pdf_simple.sh" exit 1 fi @@ -51,7 +51,7 @@ if [ -f "_build/pdf/book.pdf" ]; then PDF_SIZE=$(du -h "_build/tinytorch-course.pdf" | cut -f1) echo "" echo "✅ PDF build complete!" - echo "📄 Output: book/_build/tinytorch-course.pdf" + echo "📄 Output: site/_build/tinytorch-course.pdf" echo "📊 Size: ${PDF_SIZE}" echo "" echo "To view the PDF:" diff --git a/site/conf.py b/site/conf.py index 9c735dce..c60a06af 100644 --- a/site/conf.py +++ b/site/conf.py @@ -19,7 +19,7 @@ html_logo = 'logo-tinytorch-white.png' html_sourcelink_suffix = '' html_static_path = ['_static'] html_theme = 'sphinx_book_theme' -html_theme_options = {'search_bar_text': 'Search this book...', 'launch_buttons': {'notebook_interface': 'classic', 'binderhub_url': '', 'jupyterhub_url': '', 'thebe': False, 'colab_url': '', 'deepnote_url': ''}, 'path_to_docs': 'book', 'repository_url': 'https://github.com/mlsysbook/TinyTorch', 'repository_branch': 'main', 'extra_footer': '', 'home_page_in_toc': True, 'announcement': '', 'analytics': {'google_analytics_id': '', 'plausible_analytics_domain': '', 'plausible_analytics_url': 'https://plausible.io/js/script.js'}, 'use_repository_button': True, 'use_edit_page_button': True, 'use_issues_button': True} +html_theme_options = {'search_bar_text': 'Search this book...', 'launch_buttons': {'notebook_interface': 'classic', 'binderhub_url': 'https://mybinder.org', 'jupyterhub_url': '', 'thebe': False, 'colab_url': 'https://colab.research.google.com', 'deepnote_url': ''}, 'path_to_docs': 'site', 'repository_url': 'https://github.com/mlsysbook/TinyTorch', 'repository_branch': 'main', 'extra_footer': '', 'home_page_in_toc': True, 'announcement': '', 'analytics': {'google_analytics_id': '', 'plausible_analytics_domain': '', 'plausible_analytics_url': 'https://plausible.io/js/script.js'}, 'use_repository_button': True, 'use_edit_page_button': True, 'use_issues_button': True} html_title = 'TinyTorch' latex_engine = 'pdflatex' mermaid_version = '10.6.1'