Commit Graph

52 Commits

Author SHA1 Message Date
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
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
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
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
Vijay Janapa Reddi
92400e83ad clean: simplify symlink display to reduce visual clutter
- Changed format from '🔗 _quarto.yml → target' to '→ _quarto.yml: target'
- Removed emoji clutter that was making it hard to see
- Added bold styling and blank line for better separation
- Now stands out clearly against busy build output
- Clean, readable format that's easy to spot at a glance
2025-07-31 23:43:35 -04:00
Vijay Janapa Reddi
a166aec3a3 enhance: make symlink display bright and visible
- Changed from dim grey [dim] to bright cyan [cyan] for symlink info
- Changed warning from dim grey to bright yellow [yellow]
- Important configuration info now stands out instead of fading
- Symlink display: '🔗 _quarto.yml → config/_quarto-html.yml' in cyan
- Warning display: '⚠️ _quarto.yml is NOT a symlink' in yellow
2025-07-31 23:41:43 -04:00
Vijay Janapa Reddi
29323f4695 enhance: make symlink display more visible with arrow
- Changed from: '🔗 _quarto.yml is symlink: config/_quarto-html.yml'
- Changed to:   '🔗 _quarto.yml → config/_quarto-html.yml'
- Arrow symbol makes the symlink relationship immediately clear
- More visual and concise display of what points to what
2025-07-31 23:40:15 -04:00
Vijay Janapa Reddi
68c24cea60 feature: show symlink status on every _quarto.yml command
- Added show_symlink_status() method for simple, consistent display
- Shows symlink info at start of: build, preview, switch, clean commands
- Format: '🔗 _quarto.yml is symlink: config/_quarto-html.yml'
- Commands not using _quarto.yml (list, help) don't show symlink info
- Removed redundant symlink displays from individual build methods
- Provides immediate visibility of configuration state for every operation
2025-07-31 23:38:44 -04:00
Vijay Janapa Reddi
fac2674ae0 simplify: streamline symlink display to show raw target
- Status shows: 'Symlink: config/_quarto-html.yml' or 'NOT a symlink'
- Build shows: '_quarto.yml is symlink: config/_quarto-html.yml'
- Provides direct answer to: is it a symlink + what's the raw target
- Removed decorative arrows for cleaner output
2025-07-31 23:36:20 -04:00
Vijay Janapa Reddi
490b5dcb21 enhance: add symlink display to binder build output
- Show '_quarto.yml → config/<target>' during all build operations
- Added symlink display to build_single, build_multiple_unified, and build_full methods
- Enhanced status command to show clearer symlink arrow format
- Updated BINDER.md documentation with symlink troubleshooting section
- Provides clear visibility of which configuration is active during builds
2025-07-31 23:34:58 -04:00
Vijay Janapa Reddi
243b14bc61 Remove EPUB functionality from pre-commit hooks and build system
- Remove EPUB from GitHub workflow valid formats and build steps
- Remove EPUB config references from binder script
- Remove EPUB rendering and compression functions from publish script
- Remove EPUB file patterns from .gitignore
- Update README.md to remove EPUB config reference
- Update help messages to only mention HTML and PDF formats
- Tested binder commands and status functionality
2025-07-31 00:57:47 -04:00
Vijay Janapa Reddi
163564ee21 Auto stash before checking out "HEAD" 2025-07-29 13:02:07 -04:00
Vijay Janapa Reddi
2aa4151741 Cleans Quarto-generated figure artifacts
Updates the binder to remove Quarto-generated figure-html
directories, preventing them from being included in the build.

This reduces the size of the final output and avoids including
unnecessary files.
2025-07-29 07:19:51 -04:00
Vijay Janapa Reddi
0dc86b5e2c Update binder CLI: Add EPUB support and shell-safe dash syntax
- Replace * with - for building all chapters (shell-safe)
- Add full EPUB format support throughout CLI
- Update all format validation to include epub
- Add epub config path and logic to all build functions
- Update status checking and cleanup to handle EPUB configs
- Fix build_full to run from book/ directory correctly
- Update help screens and examples to use - syntax
- Successfully tested: ./binder build - html, ./binder build - epub
2025-07-29 01:00:56 -04:00
Vijay Janapa Reddi
24a7a2ba8e Enhance binder CLI with explicit format requirements
 Improved binder command clarity and usability
• Build commands now require explicit format: 'binder build * html' or 'binder build intro pdf'
• Removes ambiguity between HTML/PDF builds - no more defaults
• Uses '*' for building all chapters, making intent clear
• Updated all documentation (README.md, BINDER.md) with new syntax examples
• Maintains backward compatibility by keeping build-full command internally
• Enhanced help text with clear usage examples and error messages

This change makes the CLI more explicit and reduces user confusion about output formats.
2025-07-28 23:26:37 -04:00
Vijay Janapa Reddi
c1c3b7c2c2 Working custom callouts with quiz icons
Question and answer icons work perfectly. Chapter-connection icon
needs to be updated with proper design.
2025-07-28 23:01:48 -04:00
Vijay Janapa Reddi
8b621b5845 Simplify binder code by removing RICH availability checks
Since RICH is now a required dependency, removed all conditional logic:
- Removed try/except import block for rich modules
- Removed RICH_AVAILABLE variable and all associated checks
- Removed fallback print statements for when RICH is unavailable
- Simplified console initialization to always use Console()
- Removed ~70 conditional if statements throughout the code

Result: Cleaner, more maintainable code with the same beautiful output.
 Verified: All functionality working correctly after simplification
2025-07-28 16:09:20 -04:00
Vijay Janapa Reddi
6cdd1f6bcd Implement unified build for multiple chapters in single Quarto render
Enhanced binder to support building multiple chapters together in one
unified Quarto render command instead of sequential separate builds.

Key changes:
- Modified build_multiple() to use unified approach instead of sequential
- Added build_multiple_unified() for single render command execution
- Added set_fast_build_mode_multiple() to configure project.render
  with all target chapters simultaneously
- Added open_browser_if_needed() helper method for consistent browser opening

Benefits:
- Faster builds: One Quarto process instead of multiple
- Shared context: Frontmatter and dependencies loaded once
- Unified processing: Quiz injection and cross-refs in single pass
- Better user experience: Single browser window opens with complete site

Usage:
  ./binder build intro,ml_systems html  # Builds both chapters together
  ./binder build intro html             # Single chapter still works

Maintains backward compatibility while significantly improving
multi-chapter build performance and efficiency.
2025-07-28 15:17:47 -04:00
Vijay Janapa Reddi
ed3a98ad51 Enhance binder fast build mode with format-specific optimizations
Improved fast build functionality to handle HTML and PDF builds differently:
- HTML builds use project.render configuration for selective rendering
- PDF builds comment out unwanted chapters in book.chapters list
- Added command visibility and better error handling
- Enhanced support for both website and book project types
2025-07-28 15:05:35 -04:00
Vijay Janapa Reddi
4136dbc051 Implement cleaner render-based fast builds from fix-quiz-callouts
Major improvement: Replace sidebar commenting with render configuration approach
- Much cleaner and more reliable than commenting/uncommenting sidebar entries
- Uses Quarto's project.render config to explicitly control which files get built
- Preserves full navigation while only building essential files + target chapter
- No more complex backup/restore of YAML modifications
- Eliminates race conditions and file corruption risks

Key changes:
- set_fast_build_mode(): Add render config instead of commenting sidebar
- ensure_clean_config(): Remove render restrictions cleanly
- restore_config(): Simple backup restoration
- Removed old comment_qmd_files() complexity
- Updated clean() to use new approach
- Simplified check_artifacts() for new workflow

Benefits:
- 83% faster builds (from fix-quiz-callouts research)
- More robust and maintainable code
- Cleaner separation of concerns (navigation vs build control)
- Better error handling and recovery

This brings the best improvements from the fix-quiz-callouts branch while
maintaining all our recent navigation and multiple chapter enhancements.
2025-07-28 13:02:38 -04:00
Vijay Janapa Reddi
37c6f755d3 Add multiple chapter build support to Book Binder
Enhanced binder to support building multiple chapters in a single command:
- New syntax: binder build intro,ml_systems,opt [format]
- Comma-separated chapter names automatically parsed and processed
- Sequential building with progress tracking and status reports
- Smart browser opening: only opens for the last chapter in HTML builds
- Comprehensive error handling and success reporting

Technical Implementation:
- Split build() into build(), build_multiple(), and build_single()
- Added chapter list parsing and validation
- Enhanced progress display with chapter counters
- Maintains all existing single-chapter functionality
- Updated help text and examples for new syntax

User Experience:
- Build multiple related chapters efficiently
- Clear progress indication: Chapter 1/3, Chapter 2/3, etc
- Summary reporting: successful vs failed builds
- Same robust config restoration and signal handling
- Backward compatible with existing single chapter commands

Examples:
- binder b intro,ml_systems,opt html
- binder build training,ops pdf
- ./binder b intro,dl_primer (defaults to HTML)

This enhancement significantly improves developer productivity when working
with multiple related chapters while maintaining the reliability and
user experience of single chapter builds.
2025-07-28 12:30:44 -04:00
Vijay Janapa Reddi
854a8b591d Add automatic browser opening for HTML builds
🌐 Perfect workflow enhancement for binder builds:
- Parse quarto output for Output created: lines
- Auto-open HTML files in browser after successful builds
- Fixed quarto path resolution (../../../../ → ../)
- Works with all shorthand commands: binder b intro html

🚀 Enhanced run_command method:
- Added capture_for_parsing parameter
- Captures output while still streaming to terminal
- Returns tuple (success, output) when capturing

🎯 Seamless developer experience:
- Build and immediately see results
- No manual file navigation needed
- Works consistently across all chapters
- Only opens browser for HTML builds (not PDF)

🔧 Smart path handling:
- Corrects quarto relative path calculation
- Resolves absolute paths from book directory
- Robust file existence checking
- Clear error messages if file not found

 Tested extensively:
- binder b intro html → works perfectly
- binder build ml_systems html → auto-opens
- All chapter variations working
- Path resolution verified correct
2025-07-28 12:11:18 -04:00
Vijay Janapa Reddi
6018830d4c 🔗 Complete pre-commit integration: Book Binder + TikZ cleanup
 Perfect pre-commit integration achieved:
- Added check-build-artifacts hook using ./binder check
- Fixed exit codes: returns 1 when artifacts found, 0 when clean
- Removed tracked TikZ diagram PDFs from git (build artifacts)
- Enhanced artifact detection and cleanup patterns

🧹 TikZ diagram management:
- Removed diagram-*.pdf files from git tracking
- Added cleanup patterns for generated diagrams
- Pre-commit now properly detects and blocks artifact commits

🚀 Complete workflow proven:
1. git commit → pre-commit runs binder check
2. If artifacts found → commit blocked with guidance
3. User runs ./binder clean → artifacts removed
4. Retry commit → pre-commit passes 

🎉 Book Binder: Complete MLSysBook development CLI
- Single tool for all development operations
- Perfect pre-commit integration
- Bulletproof artifact detection and cleanup
- Professional git workflow integration
2025-07-28 12:03:13 -04:00
Vijay Janapa Reddi
1e1930998a 🛡️ Add bulletproof Ctrl+C signal handling to Book Binder
 Complete protection against config corruption:
- Added SIGINT/SIGTERM handlers to both build() and preview()
- Robust backup creation with verification and error handling
- Enhanced restore_config() with multiple fallback strategies
- Bulletproof cleanup in try/finally blocks

🔒 Safety features:
- Backup files: .fast-build-backup with metadata preservation
- Signal detection: 'Ctrl+C detected - restoring config...'
- Multiple restoration paths: backup → uncomment → error handling
- No leftover files: Perfect cleanup every time

🎯 User safety guarantee:
- YAML files always restored to pristine state
- Interruption at any point → automatic restoration
- Visual confirmation of restoration success
- Zero risk of corrupted configurations

Perfect implementation of user requirement for bulletproof Ctrl+C handling
2025-07-28 11:37:45 -04:00