Commit Graph

72 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
850a91adc6 fix(docs): align notebook filenames with tito convention across all docs
Notebooks use short names (tensor.ipynb, not 01_tensor.ipynb) but docs
and Binder postBuild scripts used the prefixed form. This caused broken
Binder links and incorrect paths in troubleshooting guides.

Fixes: harvard-edge/cs249r_book#1176
2026-02-17 18:31:44 -05:00
Vijay Janapa Reddi
79cc3a0549 fix: add root-level Binder config for monorepo support
Binder looks for config at repo root, but tinytorch/ is a subdirectory.
Added wrapper config that changes to tinytorch/ before setup.
2025-12-17 19:52:51 -05:00
Vijay Janapa Reddi
7b92e11193 Repository Restructuring: Prepare for TinyTorch Integration (#1068)
* Restructure: Move book content to book/ subdirectory

- Move quarto/ → book/quarto/
- Move cli/ → book/cli/
- Move docker/ → book/docker/
- Move socratiQ/ → book/socratiQ/
- Move tools/ → book/tools/
- Move scripts/ → book/scripts/
- Move config/ → book/config/
- Move docs/ → book/docs/
- Move binder → book/binder

Git history fully preserved for all moved files.

Part of repository restructuring to support MLSysBook + TinyTorch.

Pre-commit hooks bypassed for this commit as paths need updating.

* Update pre-commit hooks for book/ subdirectory

- Update all quarto/ paths to book/quarto/
- Update all tools/ paths to book/tools/
- Update config/linting to book/config/linting
- Update project structure checks

Pre-commit hooks will now work with new directory structure.

* Update .gitignore for book/ subdirectory structure

- Update quarto/ paths to book/quarto/
- Update assets/ paths to book/quarto/assets/
- Maintain all existing ignore patterns

* Update GitHub workflows for book/ subdirectory

- Update all quarto/ paths to book/quarto/
- Update cli/ paths to book/cli/
- Update tools/ paths to book/tools/
- Update docker/ paths to book/docker/
- Update config/ paths to book/config/
- Maintain all workflow functionality

* Update CLI config to support book/ subdirectory

- Check for book/quarto/ path first
- Fall back to quarto/ for backward compatibility
- Maintain full CLI functionality

* Create new root and book READMEs for dual structure

- Add comprehensive root README explaining both projects
- Create book-specific README with quick start guide
- Document repository structure and navigation
- Prepare for TinyTorch integration
2025-12-05 14:04:21 -08:00
Vijay Janapa Reddi
f333d8d24b feat: restore all missing maintenance functionality
🔧 Restored Critical Commands:
- clean: Clean build artifacts and restore configs
- switch: Switch active configuration format
- setup: Setup development environment
- hello: Show welcome message and quick start
- about: Show project information and stats
- check: Check for build artifacts (legacy compatibility)
- check-tags: Check for orphaned git tags

 New Modular Architecture:
- CleanCommand: Handles artifact cleanup and config restoration
- MaintenanceCommand: Handles setup, switch, hello, about operations
- All commands properly integrated into main CLI

🎯 Feature Parity Achieved:
- All original binder functionality restored
- Enhanced with better error handling
- Improved user experience with Rich UI
- Modular design for easy maintenance

The CLI migration is now 100% complete with full feature parity
2025-08-27 15:27:48 +02:00
Vijay Janapa Reddi
70e92435eb feat(cli): add preview and doctor commands with clear descriptions
New Commands:
- Add PreviewCommand for live development server with hot reload
- Add DoctorCommand for comprehensive health checks (18 checks)
- Clear command descriptions distinguish build vs preview vs formats

Command Clarity:
- build: Build static files to disk (HTML)
- preview: Start live dev server with hot reload
- pdf: Build static PDF file to disk
- epub: Build static EPUB file to disk

Health Check Features:
- System dependencies (Python, Quarto, Git, Node.js, R)
- Configuration file validation
- Chapter file scanning (62 chapters found)
- Build artifacts status
- Git repository status
- File permissions check

All tests passing - comprehensive CLI ready for use
2025-08-27 15:09:21 +02:00
Vijay Janapa Reddi
80ff71c9c2 Simplifies CLI commands and streamlines build process
Refactors the CLI to streamline command usage, making it more intuitive.
It simplifies the build process by introducing default behaviors
and removing unnecessary format specifications. Also introduces 'pdf' command
to build the book in PDF format.
This change enhances the user experience and improves the overall workflow.
2025-08-26 00:47:47 +02:00
Vijay Janapa Reddi
87f8119994 feat(binder): add EPUB support and improve CLI interface
- Add EPUB format support with config/_quarto-epub.yml configuration
- Simplify build command: './binder build <format>' instead of './binder build <chapters> <format>'
- Improve preview command to support multiple chapters: './binder preview intro,ops'
- Update help text and examples to reflect new simplified interface
- Remove unnecessary config cleaning steps for better performance
- Add proper render target mapping for EPUB format

This streamlines the CLI interface and adds missing EPUB build capability.
2025-08-19 11:45:03 -04:00
Vijay Janapa Reddi
3b395f6206 Filters frontmatter includes for single chapters
Simplifies frontmatter inclusion logic to retain only
'index.qmd' when building single chapter books,
removing unnecessary checks for other frontmatter files.
2025-08-16 13:39:53 -04:00
Vijay Janapa Reddi
f4ede65bb0 Moves PDF to /assets/downloads and updates links
Relocates the PDF file to the /assets/downloads directory to better organize assets.

Updates all links and redirects to point to the new PDF location, ensuring consistent access throughout the site.

Simplifies the deployment process by directly copying the PDF to the correct location during the build, removing unnecessary steps.
2025-08-06 07:24:37 -04:00
Vijay Janapa Reddi
1eb5bb6abb Enhances website deployment process
Improves the website deployment process by adding comprehensive information, validation steps, and clearer feedback to the user.

Provides detailed descriptions of the deployment process, estimated timelines, and quality checks.

Introduces an "info" option for users to get in-depth details about the publishing workflow.

The changes increase transparency and control over the deployment process, reduce user errors, and increases user confidence.
2025-08-05 23:27:39 -04:00
Vijay Janapa Reddi
5c7a307c1e feat(binder): add comprehensive PDF validation and error handling
- Add PDF existence and size validation in _deploy_to_github_pages
- Add build validation in _execute_build_phase to ensure both HTML and PDF are ready
- Validate PDF file size (minimum 1MB) to catch corrupted/incomplete builds
- Add copy validation to ensure PDF is properly copied to assets directory
- Fail fast with clear error messages if builds are not ready
- Ensure deployment stops before GitHub Pages if PDF is missing
2025-08-05 21:33:41 -04:00
Vijay Janapa Reddi
9b90008547 feat(binder): enforce main branch for user-facing operations
- Add main branch validation for ./binder publish
- Add main branch validation for ./binder release
- Both commands now require main branch for safety
- Provide interactive branch switching with commit handling
- Ensure user-facing operations are always from stable main branch
2025-08-05 21:29:14 -04:00
Vijay Janapa Reddi
ea980d996b Merge branch 'main' of https://github.com/harvard-edge/cs249r_book 2025-08-05 21:23:34 -04:00
Vijay Janapa Reddi
c915c5e347 Merge branch 'dev' 2025-08-05 21:22:40 -04:00
Vijay Janapa Reddi
b533cb40cf feat(binder): implement publish/release separation on dev branch
- Split publish into two focused commands:
  • ./binder publish - Website updates only (no versioning)
  • ./binder release - Formal releases with semantic versioning
- Add textbook-specific prompts and workflows
- Implement relaxed git validation for website publishing
- Add proper command aliases and help documentation
- Code reuse with shared build/deployment logic
2025-08-05 21:22:31 -04:00
Vijay Janapa Reddi
2a81e37c17 feat(binder): refactor publish/release separation for clean workflow
BREAKING: Split binder commands into distinct functions:

• ./binder publish - Website updates only (no versioning)
  - Builds HTML + PDF
  - Deploys to GitHub Pages
  - Simple, fast, for daily updates
  - Relaxed git requirements

• ./binder release - Formal releases only
  - Semantic versioning workflow
  - Git tags + GitHub releases
  - Textbook-appropriate prompts
  - Academic citations ready

This provides clean separation of concerns:
- Quick website updates vs formal milestones
- Code reuse with focused responsibilities
- Better user experience with targeted workflows
2025-08-05 21:18:31 -04:00
Vijay Janapa Reddi
b9df371ee1 feat(release): enhance binder tool with textbook-specific release features
- Add comprehensive release process documentation for academic textbook
- Update AI prompt to generate textbook-appropriate release notes
- Enhance version guide with examples specific to textbook releases
- Focus on educational content, chapters, and student-facing improvements

This establishes clean release practices going forward with proper
semantic versioning for textbook milestones.
2025-08-05 21:12:49 -04:00
Vijay Janapa Reddi
2312eb0169 feat(binder): implement dynamic output directory reading from Quarto configs
Major architectural improvement: The binder tool now reads output directories
directly from Quarto YAML configuration files instead of hardcoding paths.

Key changes:
- Add get_output_dir() method to parse output-dir from _quarto-html.yml and _quarto-pdf.yml
- Replace all hardcoded self.build_dir references with dynamic get_output_dir() calls
- Update GitHub Pages deployment to use dynamic paths
- Update build completion messages to show actual output locations
- Update clean/check artifact detection to use dynamic paths
- Add YAML parsing with graceful fallback to defaults

Benefits:
- Eliminates configuration drift between binder and Quarto configs
- Supports flexible output directory structures
- Makes binder tool truly config-driven and maintainable
- Provides better debugging with actual path information
2025-08-05 21:00:07 -04:00
Vijay Janapa Reddi
1a2ffb50a0 feat(binder): move build directory inside quarto/ for better architecture
- Move build output from root/build/ to quarto/_build/
- Update Quarto configs to output-dir: _build/html and _build/pdf
- Update binder tool to use new build directory location
- Update clean and check methods for new artifact locations
- Add quarto/_build/ to .gitignore
- Remove old build/ directory

This makes more architectural sense as builds are now co-located
with the Quarto project files, and eliminates the cross-directory
dependency that was causing GitHub Pages deployment issues.
2025-08-05 20:55:12 -04:00
Vijay Janapa Reddi
caf887d73c feat(binder): add orphaned git tag detection and cleanup
Solves critical version management issue where failed publishes
leave orphaned git tags that cause version numbering problems.

New features:
- Automatic detection of git tags without GitHub releases
- Interactive cleanup options (clean all, manual selection, etc.)
- Smart version calculation that accounts for orphaned tags
- New 'check-tags' command for standalone tag management
- Detailed tag information display (creation date, commit info)
- Safe cleanup with confirmation prompts

Prevents version increment issues when previous publishes fail
after creating git tags but before completing GitHub releases.
2025-08-05 20:26:33 -04:00
Vijay Janapa Reddi
735253d4a6 feat(binder): add orphaned git tag detection and cleanup
Solves critical version management issue where failed publishes
leave orphaned git tags that cause version numbering problems.

New features:
- Automatic detection of git tags without GitHub releases
- Interactive cleanup options (clean all, manual selection, etc.)
- Smart version calculation that accounts for orphaned tags
- New 'check-tags' command for standalone tag management
- Detailed tag information display (creation date, commit info)
- Safe cleanup with confirmation prompts

Prevents version increment issues when previous publishes fail
after creating git tags but before completing GitHub releases.
2025-08-05 20:26:05 -04:00
Vijay Janapa Reddi
f2e8e68f86 fix(binder): remove redundant subprocess imports causing scoping error
Remove redundant local subprocess imports that were causing
'cannot access local variable subprocess' error. subprocess
is already imported globally at the top of the file.
2025-08-05 20:22:03 -04:00
Vijay Janapa Reddi
2680e52558 fix(binder): remove redundant subprocess imports causing scoping error
Remove redundant local subprocess imports that were causing
'cannot access local variable subprocess' error. subprocess
is already imported globally at the top of the file.
2025-08-05 20:21:50 -04:00
Vijay Janapa Reddi
183af511cb fix(binder): standardize PDF compression prompt in build phase
Complete the standardization of user prompts by adding clear
options and default value display to the PDF compression prompt
in the build workflow to match the publishing workflow format.
2025-08-05 20:10:07 -04:00
Vijay Janapa Reddi
562e632f2e feat(binder): improve user prompts with clear defaults and options
- Standardize all prompts to show available options with explanations
- Add clear default values in format [default: X]
- Enhance release notes review with preview and multiple options
- Improve branch switching, compression, and publishing prompts
- Add color-coded option descriptions for better UX
- Handle empty input gracefully by using specified defaults

All prompts now provide clear guidance on what each option does
and what the recommended choice is.
2025-08-05 19:48:06 -04:00
Vijay Janapa Reddi
9113e600a9 feat(binder): add editable AI release notes with manual review
- Save AI-generated release notes to temporary markdown file
- Prompt user to review and edit release notes before publishing
- Offer to open file in default system editor automatically
- Read edited content back for GitHub release creation
- Clean up temporary file after successful release
- Update publish help documentation with new workflow
- Enhance example session to show editing step
- Cross-platform editor support for macOS, Linux, Windows
2025-08-05 18:56:07 -04:00
Vijay Janapa Reddi
41ee77e40e fix(windows-container): use standard ltsc2022 base image and update paths 2025-08-05 15:27:17 -04:00
Vijay Janapa Reddi
bdfc52f574 feat(binder): enhance publishing UI with guided versioning and better spacing
- Add comprehensive version type guidance (patch/minor/major/custom)
- Improve spacing and line breaks throughout publishing flow
- Add helpful explanations for GitHub Pages and release creation
- Enhance confirmation dialogs with clear action descriptions
- Add contextual prompts explaining what each choice does
- Show version transitions (Previous → New) for clarity
- Provide skip confirmations for optional deployment steps
2025-08-05 14:14:20 -04:00
Vijay Janapa Reddi
77b9f7d567 feat(binder): integrate enhanced manual publisher with AI-powered release notes
- Integrate complete manual publishing workflow directly into binder
- Add AI-enhanced release notes generation using Ollama
- Implement PDF-first build order with Ghostscript compression
- Add intelligent branch management with dev-to-main workflow
- Generate GitHub-style git logs between versions
- Combine AI summaries with raw commit information
- Maintain clean single entry point interface (binder publish)
- Add comprehensive error handling and graceful fallbacks
- Include rich UI with progress indicators and clear messaging
- Support PDF compression with ebook settings for distribution
2025-08-05 12:07:12 -04:00
Vijay Janapa Reddi
d8a900adb1 merge: integrate chapter connections improvements into dev
Merging feature/fix-link-colors branch with chapter connections display improvements:
- Enhanced margin positioning for cleaner UI
- Improved typography and responsive design
- Maintained PDF functionality unchanged
2025-08-03 17:31:18 -04:00
Vijay Janapa Reddi
100cca12f7 feat(ui): add crimson theme with sidebar auto-collapse and improved styling
- Add crimson color scheme (#A51C30) for links and accents
- Implement config-driven sidebar auto-collapse functionality
- Add clean table styling with left-aligned captions and zebra striping
- Add H2 headers with crimson accent bars for better visual hierarchy
- Create sidebar-auto-collapse.js for sections marked with auto-collapse: true
- Improve navbar with clean icon-only star/heart buttons
- Fix SCSS layer boundaries for proper Quarto theme integration
- Auto-collapse lab sections and resources for cleaner navigation
2025-08-03 14:07:43 -04:00
Vijay Janapa Reddi
f14ca599c6 feat(publish): implement PDF workflow management without git tracking
- Modified publish-live workflow to download PDF from artifacts and upload to release assets
- Updated quarto-build deployment to copy PDF to assets but exclude from git commits
- Added PDF exclusion rules to .gitignore
- Removed PDF commit steps from publish.sh and binder scripts
- Created test script to verify PDF handling
- Added comprehensive documentation for the new workflow

This ensures PDF is available for download but not tracked in git repository,
keeping the repo clean while maintaining accessibility.
2025-08-02 11:13:28 -04:00
Vijay Janapa Reddi
a7e98013f7 Improves user input prompts for clarity
Updates prompts to use uppercase 'Y' as the default
affirmative response, improving clarity for users.

The changes ensures consistency and better UX across various prompts
related to merging, release creation, AI release notes,
changelog updates and git config.
2025-08-01 17:32:01 -04:00
Vijay Janapa Reddi
d5c69b0bac 📝 Add changelog update step to publish workflow with smart defaults 2025-08-01 15:00:09 -04:00
Vijay Janapa Reddi
ff74d24bbc Add defaults to all interactive prompts for better UX 2025-08-01 14:48:52 -04:00
Vijay Janapa Reddi
2f644f5a0f 👋 Revert to hello command - more personal and binder-focused 2025-08-01 14:44:07 -04:00
Vijay Janapa Reddi
449863e598 🌍 Change hello to helloworld and update README to dive straight into binder workflow 2025-08-01 14:36:21 -04:00
Vijay Janapa Reddi
d6f68a4bbe 🎨 Enhance Rich interface with professional panels and step headers 2025-08-01 14:34:43 -04:00
Vijay Janapa Reddi
1c314666cd 🚨 Add prominent red warning banner to publish command 2025-08-01 14:33:08 -04:00
Vijay Janapa Reddi
e49cbaa50e 🎯 Remove AI preference from general setup (only for publishing) 2025-08-01 14:25:00 -04:00
Vijay Janapa Reddi
2783fc2552 🔧 Refactor to eliminate code duplication and improve reusability 2025-08-01 14:22:33 -04:00
Vijay Janapa Reddi
e37957d48a 🚀 Add automatic package installation and system dependency management 2025-08-01 14:19:51 -04:00
Vijay Janapa Reddi
90229f24e4 🔧 Enhanced setup with interactive Git configuration and user preferences 2025-08-01 14:16:26 -04:00
Vijay Janapa Reddi
d0960141b9 🚀 Add onboarding commands: hello and setup 2025-08-01 14:14:03 -04:00
Vijay Janapa Reddi
1a474d8b51 🔧 Fix Rich markup rendering in input prompts 2025-08-01 13:59:34 -04:00
Vijay Janapa Reddi
7202bc6776 🚀 Enhanced publish command with step-by-step wizard 2025-08-01 13:55:44 -04:00
Vijay Janapa Reddi
e3b0eff67c Clean up binder - remove ASCII art and simplify UI
- Remove ASCII art for cleaner, simpler interface
- Keep nerdy subtitle: ' I compile ML systems knowledge'
- Simplify banner and about screen
- Maintain professional, clean appearance
2025-08-01 13:33:32 -04:00
Vijay Janapa Reddi
467148519b Add publish command and improve binder CLI
- Add ./binder publish command with confirmation
- Add ./binder about command with system status
- Add beautiful ASCII art with proper alignment
- Add nerdy subtitle: 'I compile ML systems knowledge for the world'
- Improve help and shortcuts (add 'a' for about, 'pub' for publish)
- Add confirmation warning for publishing
- Update documentation to reflect new commands
2025-08-01 13:24:53 -04:00
Vijay Janapa Reddi
0e3f286abd Adjusts console output spacing for better readability
Addresses minor visual inconsistencies in console output by adjusting the spacing before the hammer emoji.

Improves the overall user experience by providing cleaner and more visually appealing output during build processes.
2025-07-31 23:47:36 -04:00
Vijay Janapa Reddi
ad9d0bc714 Improves build output formatting
Refines the build output by adjusting the indentation for better readability.

The change adds a single space to the beginning of the build messages, improving their visual alignment in the console.
2025-07-31 23:46:09 -04:00