Commit Graph

90 Commits

Author SHA1 Message Date
Vijay Janapa Reddi
853eb03ee8 style: apply consistent whitespace and formatting across codebase 2025-12-13 14:05:34 -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
1dab161767 refactor(structure): rename book directory to quarto for consistency
- book/ → quarto/ (matches docker/ pattern)
- Update all workflow references to quarto/
- Update .gitignore patterns for quarto/
- Update documentation references
- Maintain consistent naming convention across project
2025-08-05 15:08:46 -04:00
Vijay Janapa Reddi
6e4351963c Enables all book content for PDF export
Uncomments all book content entries in `_quarto-pdf.yml` to include them in the PDF output.

This ensures that all chapters, sections, and labs are present when generating the PDF version of the book.
2025-08-04 19:24:23 -04:00
Vijay Janapa Reddi
a046738001 fix(margin-video): correct format detection and LaTeX link format
- Fix format detection to handle both 'pdf' and 'latex' formats
- Change markdown link [text](url) to LaTeX \href{url}{text} format
- This prevents Pandoc from converting the link to \href{} command
- Ensures proper QR code and margin note generation in PDF output

The issue was that the format was detected as 'latex' instead of 'pdf',
causing the filter to fall back to a simple link instead of generating
the proper QR code and margin note structure.
2025-08-04 18:12:31 -04:00
Vijay Janapa Reddi
b1b3f5a468 feat(margin-video): add comprehensive logging for debugging
- Add logging functions following the pattern from other filters
- Log URL, title, author, and configuration parameters
- Log video ID extraction process with success/error messages
- Log format detection and output generation
- Add detailed error messages for debugging
- Follow the same logging pattern as inject_parts.lua and inject_quizzes.lua

This will help debug issues with QR code generation and PDF output.
2025-08-04 18:07:05 -04:00
Vijay Janapa Reddi
fc3089b8ab refactor(extensions): reorganize icon management with filter-metadata
- Move icons from extension directory to organized assets location
- Create book/assets/images/icons/callouts/ for better asset management
- Use filter-metadata section for extension configuration instead of inline YAML
- Add icon-path and icon-format configuration in filter-metadata
- Update Lua filter to read from filter-metadata instead of direct YAML
- Make icon format configurable (PDF for LaTeX, PNG for HTML)
- Fix inconsistent icon filename capitalization
- Remove old icon directory from extension

This follows software engineering best practices:
- Separation of concerns (logic vs assets)
- Better maintainability and discoverability
- Consistent configuration pattern with other filters
- Future-proof asset management structure
2025-08-04 17:57:19 -04:00
Vijay Janapa Reddi
c11e220656 fix(extensions): make icon path configurable in foldbox.tex
- Add configurable icon path via YAML configuration
- Update foldbox.tex to use \fbxIconPath variable instead of hardcoded path
- Add icon-path configuration to both HTML and PDF config files
- Modify Lua filter to read icon-path from YAML and set LaTeX command
- Fixes PDF build error when building from root directory

This makes the extension more flexible and fixes the path issue when building from different directories.
2025-08-04 17:54:03 -04:00
Vijay Janapa Reddi
4aaaf0b05f feat(filters): add margin-video extension to HTML and PDF filter configurations
- Add mlsysbook-ext/margin-video to both _quarto-html.yml and _quarto-pdf.yml
- Ensures margin-video shortcode works in both HTML and PDF formats
- Extension properly integrated with existing custom-numbered-blocks filter
- Tested and working correctly
2025-08-04 17:46:14 -04:00
Vijay Janapa Reddi
525621a0ee refactor(extensions): rename mlsysbook to mlsysbook-ext for clearer naming
- Rename mlsysbook/ → mlsysbook-ext/ for explicit extension identification
- Update all Quarto configuration files to use new paths
- Update Lua filter references to new configuration keys
- Update documentation and protection script for new naming
- All extensions tested and working correctly

The -ext suffix makes it crystal clear these are extensions and prevents any confusion.
2025-08-04 17:43:42 -04:00
Vijay Janapa Reddi
c935a8cfa4 feat(extensions): reorganize custom extensions to mlsysbook namespace
- Move all custom extensions to clean mlsysbook/ directory structure:
  * ute/custom-numbered-blocks → mlsysbook/custom-numbered-blocks
  * nmfs-opensci/titlepage → mlsysbook/titlepage
  * margin-video → mlsysbook/margin-video

- Update all Quarto configuration files to use new extension paths
- Fix Lua filter references to new configuration keys
- Update extension protection script for new structure
- Clean namespace prevents accidental overwrites by quarto add commands
- Enhanced documentation with clear protection strategy

All extensions tested and working correctly.
2025-08-04 17:30:24 -04:00
Vijay Janapa Reddi
823613d900 feat(video): enhance video formatting with margin-video extension
- Convert all 16 videos from verbose callout blocks to clean shortcode syntax
- Create margin-video Quarto extension with comprehensive features
- Remove text dependencies on videos for self-contained content
- Implement auto-numbering for HTML and QR codes for PDF

Changes:
• New margin-video extension with robust YouTube support
• Clean {{< margin-video "URL" "Title" "Author" >}} syntax
• Enhanced error handling and URL validation
• Support for video options (aspect-ratio, start, autoplay)
• Complete documentation with README and CHANGELOG
• Convert videos in: ai_for_good, ops, dl_primer, privacy_security, introduction
• Remove @vid-* text dependencies to improve content accessibility
• Professional extension structure for maintainability

Technical improvements:
• YouTube URL validation with clear error messages
• Multiple URL format support (youtube.com, youtu.be, embed)
• Format-specific rendering (HTML iframe vs PDF QR codes)
• CSS auto-numbering integration
• Configurable video parameters via kwargs
2025-08-04 17:07:29 -04:00
Vijay Janapa Reddi
82d3131801 refactor(video): rename margin_video to insert_video and add to all Quarto configs 2025-08-04 15:54:49 -04:00
Vijay Janapa Reddi
8ef8315371 feat(video): implement single margin-video shortcode with auto HTML/PDF handling 2025-08-04 15:53:35 -04:00
Vijay Janapa Reddi
cf1f5bae2c fix(layout): add CSS override for slimcontent layout consistency 2025-08-04 14:54:41 -04:00
Vijay Janapa Reddi
ed39e99611 Refines visual styles and content layout
Improves the visual presentation and layout of the book by:

- Adjusting the slimcontent layout to match the standard floating layout on larger screens.
- Updating the color scheme for custom-numbered blocks to improve visual distinction and consistency, including updates to quiz questions, chapter connections, and code listings.
- Correcting minor typographical errors in the introduction.
2025-08-04 14:37:22 -04:00
Vijay Janapa Reddi
50297b874c feat(design): update quiz question color to darker purple for better visual distinction 2025-08-04 13:37:32 -04:00
Vijay Janapa Reddi
0ca6d8c7e3 feat(ui): unify callout styling and fix quiz padding issues
- Fix quiz wrapper div padding conflicts with CSS specificity
- Unify header heights to exactly 35px across all callout types
- Standardize shadow effects to subtle 0 2px 8px rgba(165, 28, 48, 0.1)
- Remove unused chapter connection CSS rules
- Ensure consistent header styling between native Quarto and foldbox callouts
- Apply UX expert recommendations for professional appearance
2025-08-04 12:32:47 -04:00
Vijay Janapa Reddi
65ab85048a Merge branch 'feature/custom-callout-code-listings' into dev 2025-08-04 03:17:17 -04:00
Vijay Janapa Reddi
36cfb3ef37 feat(listings): enhance code listings with improved styling and copy functionality
- Add callout-code configuration to _quarto-html.yml
- Enable code-copy and code-overflow features for better UX
- Update example listing format in introduction
- Provides enhanced visual styling for code listings
- Improves accessibility and usability of code examples
2025-08-04 03:15:39 -04:00
Vijay Janapa Reddi
f142835029 Enhances code listings and configures code display
Improves the appearance of code listings with enhanced styling, including borders, shadows, and captions.

Configures Quarto HTML output to enable code copying and wrapping for better readability and usability.

Updates callout blocks to use consistent labeling.
2025-08-04 03:11:49 -04:00
Vijay Janapa Reddi
236dded853 Removes hw_acceleration content and references
This commit removes the hardware acceleration chapter as the content is not yet ready.

The associated files and references in the config are also removed.
2025-08-04 01:07:35 -04:00
Vijay Janapa Reddi
b9ed34fefd feat(config): customize browser tab title to show only site name 2025-08-04 01:05:21 -04:00
Vijay Janapa Reddi
87337c3efb fix(quizzes): remove chapter numbering from HTML quiz callouts via JavaScript
- Add JavaScript function to transform 'Self-Check: Question 1.3' to 'Self-Check: Question 3'
- Uses regex to extract question number after dot, keeping the individual question count
- Runs with multiple timing strategies and MutationObserver for robustness
- HTML-only solution: PDF retains chapter numbering, no quiz system changes
- Added to existing sidebar-auto-collapse.js to avoid additional script files
2025-08-04 00:27:06 -04:00
Vijay Janapa Reddi
a8d8f4ccc4 fix(quizzes): remove chapter numbering from HTML quiz callouts
- Add numbered: false to quiz-question and quiz-answer groups in HTML config
- HTML now shows 'Self-Check: Question 3' instead of 'Self-Check: Question 1.3'
- PDF retains chapter numbering as configured in _quarto-pdf.yml
- Simple solution without changing quiz system or class names
2025-08-04 00:24:11 -04:00
Vijay Janapa Reddi
9a2d006520 feat(pdf): achieve HTML-PDF callout design consistency
- Update PDF color palette in _quarto-pdf.yml to match refined HTML colors:
  * Quiz questions: teal (#119EC7) - distinct from notes
  * Quiz answers: muted forest green (#4a7c59)
  * Chapter connections: crimson (#A51C30) - brand color
  * Resources: muted golden amber (#b8860b)

- Minimal LaTeX adjustments in foldbox.tex:
  * Optimize header padding for ~40px equivalent height
  * Remove bold font weight for visual consistency
  * Use auto-generated colors from YAML config
  * Keep all other styling handled by extension

- Clean separation: YAML controls colors/styling, LaTeX handles specific adjustments
- PDF output now visually matches HTML callout design
- Professional consistency across web and print formats
2025-08-04 00:11:40 -04:00
Vijay Janapa Reddi
ebe24c6976 feat(branding): use full 'Machine Learning Systems' title with responsive sizing
- Change from 'ML Systems' to full 'Machine Learning Systems' as default
- Use progressive sizing: smaller fonts on smaller screens but keep full title
- Better branding: descriptive name when space allows, not always abbreviated
- Responsive approach: 1rem desktop → 0.95rem tablet → 0.9rem mobile
- More professional and SEO-friendly than permanent abbreviation
2025-08-03 22:36:55 -04:00
Vijay Janapa Reddi
39852d3f55 feat(navbar): open external links in new tabs
- Add target: _blank to Star (GitHub repo) and Support (OpenCollective) links
- Add target: _blank to all GitHub dropdown menu items
- Preserve user's place in book when clicking external links
- Internal links (Labs, Kits) still navigate in same tab
- Improves user experience by preventing accidental navigation away
2025-08-03 22:34:09 -04:00
Vijay Janapa Reddi
8458ebd22a feat(ui): improve mobile navbar responsiveness and cleanup
- Fix mobile navbar collapse behavior and layout
- Resolve GitHub dropdown highlighting issue in hamburger menu
- Position search bar properly on mobile without white space
- Clean up TOC by disabling duplicate repo-actions
- Ensure all navigation items collapse into hamburger menu appropriately
- Style secondary tools (Star, Support, GitHub, PDF) in subdued grey
- Improve overall mobile user experience and visual consistency
2025-08-03 22:20:22 -04:00
Vijay Janapa Reddi
d5a875f87c style(navbar): shorten secondary nav labels for better readability
Streamline navbar text for better UX:
- 'Star on GitHub' → 'Star' (context clear from icon)
- 'Donate & Support' → 'Support' (broader, more concise)

Benefits:
 More space for content navigation
 Cleaner visual appearance
 Faster cognitive processing
 Context preserved through icons and positioning

Reader-focused design: detailed explanations belong on homepage,
not in navigation labels.
2025-08-03 22:05:37 -04:00
Vijay Janapa Reddi
aacf0ad5b3 fix(navbar): right-align navigation items on desktop
Change navbar configuration from 'left:' to 'right:' to properly
right-align all navigation items (Labs, Kits, PDF, etc.) on desktop view.

Desktop layout now follows standard pattern:
🏫 ML Systems                    Labs Kits PDF ❤️🔧 🔍

Better visual balance and follows conventional navbar patterns.
2025-08-03 22:04:53 -04:00
Vijay Janapa Reddi
51a505e279 style(ui): replace emoji icons with professional Bootstrap icons
- Replace ✏️ with pencil icon for 'Edit this page'
- Replace 🐛 with bug icon for 'Report an issue'
- Replace 💬 with chat icon for 'Discussions'
- Replace 🔍 with code icon for 'View source'
- More professional and consistent visual design
2025-08-03 20:58:34 -04:00
Vijay Janapa Reddi
ee6c914387 style(ui): simplify secondary tools with grey styling
- Remove colorful emojis from Star/Donate text (❤️)
- Simplify 'GitHub Tools' to just 'GitHub'
- Style secondary tools with subdued grey color (#6c757d)
- Smaller font size (0.9rem) to de-emphasize vs main navigation
- Grey hover effects instead of brand colors
- Main nav (Labs/Kits/PDF) remains prominent, tools are understated
2025-08-03 20:54:32 -04:00
Vijay Janapa Reddi
38cd471786 feat(ui): implement proper responsive navbar behavior
- Move all nav items to collapse into hamburger menu on mobile (≤767px)
- Change collapse-below to 'md' for better mobile experience
- Add text labels for better hamburger menu UX ( Star on GitHub, etc.)
- Style hamburger menu with proper spacing, borders, and hover effects
- Desktop shows icons only, mobile shows descriptive text in menu
- Remove all hiding CSS - now uses proper Bootstrap collapse behavior
2025-08-03 20:53:30 -04:00
Vijay Janapa Reddi
d949c585c3 feat(ui): improve mobile navbar responsiveness
- Hide title text on mobile (≤768px), show logo only
- Hide secondary tools (star, heart, GitHub) on mobile for cleaner header
- Maintain full desktop experience with all icons
- Optimize navbar spacing and touch targets for mobile
- Add responsive breakpoints for different screen sizes
2025-08-03 20:47:51 -04:00
Vijay Janapa Reddi
df57bab123 fix(config): temporarily disable crossrefs filter
Disable inject_crossrefs.lua filter due to current issues.
This filter handles cross-references and must be resolved before re-enabling.
2025-08-03 18:06:19 -04:00
Vijay Janapa Reddi
b33329a4a2 feat(navbar): implement active state detection for navbar navigation
- Simplify navbar to textbook-focused design: Labs, Kits, PDF + GitHub tools
- Move 'Edit this page', 'Report issue' from buried TOC to accessible GitHub dropdown
- Add CSS styling for navbar active states with crimson highlighting
- Implement JavaScript active state detection handling .qmd→.html URL conversion
- Fix URL matching for localhost development environment
- Ensure proper visual feedback when navigating between Labs/Kits sections
- Maintain clean, academic navbar design appropriate for textbook format
2025-08-03 16:35:46 -04:00
Vijay Janapa Reddi
797891e5c2 feat(ui): polish homepage callouts and improve sidebar auto-collapse
- Redesign Support Our Mission and Podcast sections with clean, consistent styling
- Replace heavy crimson bars with subtle borders for better visual balance
- Add graduation cap and headphone emojis via CSS for personality
- Fix color consistency throughout - ensure all crimson uses theme color
- Improve GitHub star button styling with proper color enforcement
- Enhance sidebar auto-collapse reliability with multiple retry attempts
- Add robust text-based section targeting for auto-collapse functionality
- Clean up all inline styles in favor of proper CSS classes
- Improve mobile responsiveness for callout sections
- Create cohesive visual language across homepage elements
2025-08-03 14:47:13 -04:00
Vijay Janapa Reddi
f3d4854338 feat(ui): enhance table styling and add H3 header accents
- Add enhanced table styling with lighter cell text and improved readability
- Add H3 headers with thinner crimson accent bars for better hierarchy
- Improve table captions with left-alignment and better typography
- Add special styling for comparison table headers with subtle crimson background
- Refine hover effects for better user interaction
- Update HTML configuration to include additional frontmatter pages
2025-08-03 14:30:31 -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
1926563393 📝 Update changelog and config files 2025-08-01 15:00:20 -04:00
Vijay Janapa Reddi
f300d253e1 🔗 Update PDF link to external URL and sync config 2025-08-01 14:29:02 -04:00
Vijay Janapa Reddi
d218276294 Fixes typo in Lua filter file name
Corrects a typo in the `inject_parts.lua` filter reference within the Quarto configuration file.

This ensures the correct Lua filter is loaded and applied during document processing.
2025-08-01 12:00:14 -04:00
Vijay Janapa Reddi
0caff62008 Enables cross-reference injection in PDF output
Uncomments the `inject_crossrefs.lua` filter in the PDF configuration.

This allows cross-references to be properly injected into the PDF output, which is essential for the `custom-numbered-blocks` filter to function correctly.
2025-08-01 10:17:54 -04:00
Vijay Janapa Reddi
57ddf72a8f Re-enables Lua script injection
Re-enables the injection of parts via Lua script, likely to restore functionality that depends on it.

Also disables the cross-reference injection Lua script, potentially due to compatibility issues or to prevent conflicts with other scripts.
2025-08-01 10:16:38 -04:00
Vijay Janapa Reddi
cb862d29dc Temporarily disables parts injection
Disables the parts injection filter in the PDF build process.

This is a temporary measure, likely for debugging or testing purposes,
and the filter may be re-enabled later.
2025-08-01 10:14:14 -04:00
Vijay Janapa Reddi
225467e31d Enables cross-reference injection in PDF output
The `inject_crossrefs.lua` filter is now enabled for PDF builds. This filter is necessary for creating functional cross-references within the PDF document, particularly for elements that rely on LaTeX's `\ref{...}` mechanism, such as custom-numbered blocks. The filter's position in the filter chain is crucial, as it must precede the `custom-numbered-blocks` filter to ensure proper referencing.
2025-08-01 10:02:36 -04:00
Vijay Janapa Reddi
44b97aa1ee Fixes PDF build and removes unused script
Corrects a filename mismatch in the PDF build configuration, ensuring proper injection of part summaries.

Removes an obsolete asset copying script and a redundant changelog file.
2025-08-01 09:30:53 -04:00
Vijay Janapa Reddi
5906740e3c Removes unused fig-format option
The `fig-format` option for HTML output is no longer needed and is removed to simplify the configuration.
2025-07-31 23:49:39 -04:00
Vijay Janapa Reddi
d1c586df64 Sets SVG as default figure format
Specifies SVG as the default figure format in the HTML output configuration.

This ensures that figures are rendered as vector graphics, which provides better scalability and visual quality, especially when zooming or viewing on high-resolution displays.
2025-07-31 23:21:46 -04:00