mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-04-29 00:59:07 -05:00
Disables book chapters and renames quiz section
Disables most of the book's chapter entries in `_quarto.yml`. Renames "Quiz Answers" section to "Self-Check Answers" in the quiz generation script. This change improves code readability and maintainability by using a consistent naming convention. WIP on 874-part-title
This commit is contained in:
126
_quarto.yml
126
_quarto.yml
@@ -112,69 +112,69 @@ book:
|
||||
#- part: "MAIN"
|
||||
- part: contents/parts/foundations.qmd
|
||||
- contents/core/introduction/introduction.qmd
|
||||
- contents/core/ml_systems/ml_systems.qmd
|
||||
- contents/core/dl_primer/dl_primer.qmd
|
||||
- contents/core/dnn_architectures/dnn_architectures.qmd
|
||||
- part: contents/parts/design_principles.qmd
|
||||
- contents/core/workflow/workflow.qmd
|
||||
- contents/core/data_engineering/data_engineering.qmd
|
||||
- contents/core/frameworks/frameworks.qmd
|
||||
- contents/core/training/training.qmd
|
||||
- contents/core/efficient_ai/efficient_ai.qmd
|
||||
- contents/core/optimizations/optimizations.qmd
|
||||
- contents/core/hw_acceleration/hw_acceleration.qmd
|
||||
- contents/core/benchmarking/benchmarking.qmd
|
||||
- part: contents/parts/best_practices.qmd
|
||||
- contents/core/ops/ops.qmd
|
||||
- contents/core/ondevice_learning/ondevice_learning.qmd
|
||||
- contents/core/privacy_security/privacy_security.qmd
|
||||
- contents/core/responsible_ai/responsible_ai.qmd
|
||||
- contents/core/sustainable_ai/sustainable_ai.qmd
|
||||
- contents/core/robust_ai/robust_ai.qmd
|
||||
- part: contents/parts/impact_outlook.qmd
|
||||
- contents/core/ai_for_good/ai_for_good.qmd
|
||||
- contents/core/conclusion/conclusion.qmd
|
||||
- text: "---"
|
||||
- part: "LABS"
|
||||
- contents/labs/overview.qmd
|
||||
- contents/labs/getting_started.qmd
|
||||
- part: contents/labs/arduino/nicla_vision/nicla_vision.qmd
|
||||
chapters:
|
||||
- contents/labs/arduino/nicla_vision/setup/setup.qmd
|
||||
- contents/labs/arduino/nicla_vision/image_classification/image_classification.qmd
|
||||
- contents/labs/arduino/nicla_vision/object_detection/object_detection.qmd
|
||||
- contents/labs/arduino/nicla_vision/kws/kws.qmd
|
||||
- contents/labs/arduino/nicla_vision/motion_classification/motion_classification.qmd
|
||||
- part: contents/labs/seeed/xiao_esp32s3/xiao_esp32s3.qmd
|
||||
chapters:
|
||||
- contents/labs/seeed/xiao_esp32s3/setup/setup.qmd
|
||||
- contents/labs/seeed/xiao_esp32s3/image_classification/image_classification.qmd
|
||||
- contents/labs/seeed/xiao_esp32s3/object_detection/object_detection.qmd
|
||||
- contents/labs/seeed/xiao_esp32s3/kws/kws.qmd
|
||||
- contents/labs/seeed/xiao_esp32s3/motion_classification/motion_classification.qmd
|
||||
- part: contents/labs/seeed/grove_vision_ai_v2/grove_vision_ai_v2.qmd
|
||||
chapters:
|
||||
- contents/labs/seeed/grove_vision_ai_v2/setup_and_no_code_apps/setup_and_no_code_apps.qmd
|
||||
- contents/labs/seeed/grove_vision_ai_v2/image_classification/image_classification.qmd
|
||||
- contents/labs/seeed/grove_vision_ai_v2/object_detection/object_detection.qmd
|
||||
- part: contents/labs/raspi/raspi.qmd
|
||||
chapters:
|
||||
- contents/labs/raspi/setup/setup.qmd
|
||||
- contents/labs/raspi/image_classification/image_classification.qmd
|
||||
- contents/labs/raspi/object_detection/object_detection.qmd
|
||||
- contents/labs/raspi/llm/llm.qmd
|
||||
- contents/labs/raspi/vlm/vlm.qmd
|
||||
- part: contents/labs/shared/shared.qmd
|
||||
chapters:
|
||||
- contents/labs/shared/kws_feature_eng/kws_feature_eng.qmd
|
||||
- contents/labs/shared/dsp_spectral_features_block/dsp_spectral_features_block.qmd
|
||||
- text: "---"
|
||||
- part: "RESOURCES"
|
||||
chapters:
|
||||
- contents/backmatter/resources/phd_survival_guide.qmd
|
||||
- text: "---"
|
||||
- part: "REFERENCES"
|
||||
- contents/backmatter/references.qmd
|
||||
# - contents/core/ml_systems/ml_systems.qmd
|
||||
# - contents/core/dl_primer/dl_primer.qmd
|
||||
# - contents/core/dnn_architectures/dnn_architectures.qmd
|
||||
# - part: contents/parts/design_principles.qmd
|
||||
# - contents/core/workflow/workflow.qmd
|
||||
# - contents/core/data_engineering/data_engineering.qmd
|
||||
# - contents/core/frameworks/frameworks.qmd
|
||||
# - contents/core/training/training.qmd
|
||||
# - contents/core/efficient_ai/efficient_ai.qmd
|
||||
# - contents/core/optimizations/optimizations.qmd
|
||||
# - contents/core/hw_acceleration/hw_acceleration.qmd
|
||||
# - contents/core/benchmarking/benchmarking.qmd
|
||||
# - part: contents/parts/best_practices.qmd
|
||||
# - contents/core/ops/ops.qmd
|
||||
# - contents/core/ondevice_learning/ondevice_learning.qmd
|
||||
# - contents/core/privacy_security/privacy_security.qmd
|
||||
# - contents/core/responsible_ai/responsible_ai.qmd
|
||||
# - contents/core/sustainable_ai/sustainable_ai.qmd
|
||||
# - contents/core/robust_ai/robust_ai.qmd
|
||||
# - part: contents/parts/impact_outlook.qmd
|
||||
# - contents/core/ai_for_good/ai_for_good.qmd
|
||||
# - contents/core/conclusion/conclusion.qmd
|
||||
# - text: "---"
|
||||
# - part: "LABS"
|
||||
# - contents/labs/overview.qmd
|
||||
# - contents/labs/getting_started.qmd
|
||||
# - part: contents/labs/arduino/nicla_vision/nicla_vision.qmd
|
||||
# chapters:
|
||||
# - contents/labs/arduino/nicla_vision/setup/setup.qmd
|
||||
# - contents/labs/arduino/nicla_vision/image_classification/image_classification.qmd
|
||||
# - contents/labs/arduino/nicla_vision/object_detection/object_detection.qmd
|
||||
# - contents/labs/arduino/nicla_vision/kws/kws.qmd
|
||||
# - contents/labs/arduino/nicla_vision/motion_classification/motion_classification.qmd
|
||||
# - part: contents/labs/seeed/xiao_esp32s3/xiao_esp32s3.qmd
|
||||
# chapters:
|
||||
# - contents/labs/seeed/xiao_esp32s3/setup/setup.qmd
|
||||
# - contents/labs/seeed/xiao_esp32s3/image_classification/image_classification.qmd
|
||||
# - contents/labs/seeed/xiao_esp32s3/object_detection/object_detection.qmd
|
||||
# - contents/labs/seeed/xiao_esp32s3/kws/kws.qmd
|
||||
# - contents/labs/seeed/xiao_esp32s3/motion_classification/motion_classification.qmd
|
||||
# - part: contents/labs/seeed/grove_vision_ai_v2/grove_vision_ai_v2.qmd
|
||||
# chapters:
|
||||
# - contents/labs/seeed/grove_vision_ai_v2/setup_and_no_code_apps/setup_and_no_code_apps.qmd
|
||||
# - contents/labs/seeed/grove_vision_ai_v2/image_classification/image_classification.qmd
|
||||
# - contents/labs/seeed/grove_vision_ai_v2/object_detection/object_detection.qmd
|
||||
# - part: contents/labs/raspi/raspi.qmd
|
||||
# chapters:
|
||||
# - contents/labs/raspi/setup/setup.qmd
|
||||
# - contents/labs/raspi/image_classification/image_classification.qmd
|
||||
# - contents/labs/raspi/object_detection/object_detection.qmd
|
||||
# - contents/labs/raspi/llm/llm.qmd
|
||||
# - contents/labs/raspi/vlm/vlm.qmd
|
||||
# - part: contents/labs/shared/shared.qmd
|
||||
# chapters:
|
||||
# - contents/labs/shared/kws_feature_eng/kws_feature_eng.qmd
|
||||
# - contents/labs/shared/dsp_spectral_features_block/dsp_spectral_features_block.qmd
|
||||
# - text: "---"
|
||||
# - part: "RESOURCES"
|
||||
# chapters:
|
||||
# - contents/backmatter/resources/phd_survival_guide.qmd
|
||||
# - text: "---"
|
||||
# - part: "REFERENCES"
|
||||
# - contents/backmatter/references.qmd
|
||||
|
||||
bibliography:
|
||||
- contents/core/introduction/introduction.bib
|
||||
|
||||
@@ -135,8 +135,13 @@ ANSWER_ID_PREFIX = "quiz-answer-"
|
||||
REFERENCE_TEXT = "See Answer"
|
||||
|
||||
# Quiz section headers and patterns for easy maintenance
|
||||
QUIZ_ANSWERS_SECTION_HEADER = "## Quiz Answers"
|
||||
QUIZ_ANSWERS_SECTION_PATTERN = rf"^{re.escape(QUIZ_ANSWERS_SECTION_HEADER)}\s*{{#[^}}]*}}\s*\n.*?(?=\n##\s+|$)"
|
||||
SELF_CHECK_ANSWERS_HEADER = "Self-Check Answers"
|
||||
SELF_CHECK_ANSWERS_HEADER_LOWER = SELF_CHECK_ANSWERS_HEADER.lower()
|
||||
SELF_CHECK_ANSWERS_SECTION_HEADER = f"## {SELF_CHECK_ANSWERS_HEADER}"
|
||||
SELF_CHECK_ANSWERS_SECTION_PATTERN = rf"^##\s+{re.escape(SELF_CHECK_ANSWERS_HEADER)}[\s\S]*?(?=^##\s|\Z)"
|
||||
QUIZ_ANSWERS_SECTION_HEADER = SELF_CHECK_ANSWERS_SECTION_HEADER
|
||||
QUIZ_ANSWERS_SECTION_PATTERN = SELF_CHECK_ANSWERS_SECTION_PATTERN
|
||||
|
||||
# These will be constructed dynamically since they need re.escape
|
||||
QUIZ_QUESTION_CALLOUT_PATTERN = None # Constructed dynamically
|
||||
QUIZ_ANSWER_CALLOUT_PATTERN = None # Constructed dynamically
|
||||
@@ -2913,7 +2918,7 @@ def clean_existing_quiz_blocks(markdown_text):
|
||||
|
||||
# --- Remove the entire '## Quiz Answers' section (header + all content) ---
|
||||
quiz_answers_section_pattern = re.compile(
|
||||
r"(^##\s+" + re.escape("Quiz Answers") + r"[\s\S]*?)(?=^##\s|\Z)", re.MULTILINE
|
||||
r"(^##\s+" + re.escape(SELF_CHECK_ANSWERS_HEADER) + r"[\s\S]*?)(?=^##\s|\Z)", re.MULTILINE
|
||||
)
|
||||
cleaned, section_removed_count = quiz_answers_section_pattern.subn("", cleaned)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user