[PR #1015] [MERGED] Simplifies MYCIN example in introduction #1065

Closed
opened 2026-03-22 15:59:24 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1015
Author: @profvjreddi
Created: 11/1/2025
Status: Merged
Merged: 11/1/2025
Merged by: @profvjreddi

Base: devHead: issue-1014-ebook-in-epub-format-fails-to-load-displays-errors


📝 Commits (2)

  • d4c717d fix(epub): enable custom callouts in ePub format
  • d366797 Simplifies MYCIN example callout

📊 Changes

4 files changed (+342 additions, -30 deletions)

View changed files

📝 quarto/_extensions/mlsysbook-ext/custom-numbered-blocks/custom-numbered-blocks.lua (+15 -2)
📝 quarto/_extensions/mlsysbook-ext/custom-numbered-blocks/style/foldbox.lua (+27 -9)
📝 quarto/assets/styles/epub.css (+300 -3)
📝 quarto/contents/core/introduction/introduction.qmd (+0 -16)

📄 Description

Removes format-specific callouts for the MYCIN example in the introduction. This simplifies the example and improves consistency across different output formats, addressing issues with ePub rendering.


Note

Treat ePub as HTML, skip the custom-numbered-blocks Lua filter for ePub, move callout styling into epub.css, and simplify the MYCIN example to a single cross-format callout.

  • Extension (quarto/_extensions/mlsysbook-ext/custom-numbered-blocks):
    • Treat ePub as HTML: set fmt="html" when is_format("epub"); add isepub checks.
    • Bypass processing for ePub: early return {} in custom-numbered-blocks.lua; skip metadata/init and cleanup for ePub builds.
    • Preamble/styling: allow insertPreamble for ePub but avoid injecting CSS or foldbox.css in ePub; rely on book CSS.
    • HTML rendering: for ePub use open="open" on <details> via foldbox.lua.
  • Styles (quarto/assets/styles/epub.css):
    • Add/expand callout styles to cover details.callout and custom callout types (e.g., callout-definition, callout-example, quiz, chapter, resource, code).
    • Ensure headers/body styling for callouts and hide default markers; unify borders/shadows.
  • Content (quarto/contents/.../introduction.qmd):
    • Simplify MYCIN example to a single callout-example, removing format-specific blocks for HTML/PDF.

Written by Cursor Bugbot for commit d366797f93. This will update automatically on new commits. Configure here.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1015 **Author:** [@profvjreddi](https://github.com/profvjreddi) **Created:** 11/1/2025 **Status:** ✅ Merged **Merged:** 11/1/2025 **Merged by:** [@profvjreddi](https://github.com/profvjreddi) **Base:** `dev` ← **Head:** `issue-1014-ebook-in-epub-format-fails-to-load-displays-errors` --- ### 📝 Commits (2) - [`d4c717d`](https://github.com/harvard-edge/cs249r_book/commit/d4c717dd722ad226927ccb0e2af38840dc2109a6) fix(epub): enable custom callouts in ePub format - [`d366797`](https://github.com/harvard-edge/cs249r_book/commit/d366797f9354f95cb90f11990214e4de203d3d6d) Simplifies MYCIN example callout ### 📊 Changes **4 files changed** (+342 additions, -30 deletions) <details> <summary>View changed files</summary> 📝 `quarto/_extensions/mlsysbook-ext/custom-numbered-blocks/custom-numbered-blocks.lua` (+15 -2) 📝 `quarto/_extensions/mlsysbook-ext/custom-numbered-blocks/style/foldbox.lua` (+27 -9) 📝 `quarto/assets/styles/epub.css` (+300 -3) 📝 `quarto/contents/core/introduction/introduction.qmd` (+0 -16) </details> ### 📄 Description Removes format-specific callouts for the MYCIN example in the introduction. This simplifies the example and improves consistency across different output formats, addressing issues with ePub rendering. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Treat ePub as HTML, skip the custom-numbered-blocks Lua filter for ePub, move callout styling into `epub.css`, and simplify the MYCIN example to a single cross-format callout. > > - **Extension (`quarto/_extensions/mlsysbook-ext/custom-numbered-blocks`)**: > - Treat ePub as HTML: set `fmt="html"` when `is_format("epub")`; add `isepub` checks. > - Bypass processing for ePub: early return `{}` in `custom-numbered-blocks.lua`; skip metadata/init and cleanup for ePub builds. > - Preamble/styling: allow `insertPreamble` for ePub but avoid injecting CSS or `foldbox.css` in ePub; rely on book CSS. > - HTML rendering: for ePub use `open="open"` on `<details>` via `foldbox.lua`. > - **Styles (`quarto/assets/styles/epub.css`)**: > - Add/expand callout styles to cover `details.callout` and custom callout types (e.g., `callout-definition`, `callout-example`, quiz, chapter, resource, code). > - Ensure headers/body styling for callouts and hide default markers; unify borders/shadows. > - **Content (`quarto/contents/.../introduction.qmd`)**: > - Simplify MYCIN example to a single `callout-example`, removing format-specific blocks for HTML/PDF. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit d366797f9354f95cb90f11990214e4de203d3d6d. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-03-22 15:59:24 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#1065