From fb386ada880bb283373ceb9f1998c66fcc0d0216 Mon Sep 17 00:00:00 2001 From: Tyler Nullmeier Date: Tue, 14 Jan 2025 15:06:57 -0600 Subject: [PATCH 1/3] Update recipe for additive manufacturing Side quest: remove empty answer key sections from data-science (requested in slack thread) --- CHANGELOG.md | 6 +- .../additive-manufacturing/locales/en.yml | 3 +- lib/recipes/additive-manufacturing/recipe.rb | 42 +++- lib/recipes/data-science/recipe.rb | 1 + .../expected_output.xhtml | 133 +++++++++--- .../books/data-science/expected_output.xhtml | 197 +----------------- 6 files changed, 146 insertions(+), 236 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0086f5114..652fe1db7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - +* Bake `glossary` in `additive-manufacturing` +* Do not bake `chapter solutions` in `additive-manufacturing` +* Bake `answer key` in `additive-manufacturing` +* Add section title links to `key terms` in `additive-manufacturing` +* Remove empty `answer key` sections in `data-science` ## [v2.24.0] - 2024-10-24 diff --git a/lib/recipes/additive-manufacturing/locales/en.yml b/lib/recipes/additive-manufacturing/locales/en.yml index 44a71a347..b8e4c1ab2 100644 --- a/lib/recipes/additive-manufacturing/locales/en.yml +++ b/lib/recipes/additive-manufacturing/locales/en.yml @@ -1,7 +1,8 @@ en: eoc: review-questions: Review Questions - case-questions: Case Questions + practice: Case Questions free-response: Discussion Questions + key-terms: Key Terms exercises: exercise: Exercise diff --git a/lib/recipes/additive-manufacturing/recipe.rb b/lib/recipes/additive-manufacturing/recipe.rb index 41460ac68..3055756b9 100755 --- a/lib/recipes/additive-manufacturing/recipe.rb +++ b/lib/recipes/additive-manufacturing/recipe.rb @@ -24,6 +24,8 @@ AddInjectedExerciseId.v1(book: book) + answer_key = BookAnswerKeyContainer.v1(book: book) + book.chapters.each do |chapter| BakeNonIntroductionPages.v1(chapter: chapter) @@ -37,10 +39,13 @@ number: "#{chapter.count_in(:book)}.#{table.count_in(:chapter)}") end - BakeChapterGlossary.v1(chapter: chapter, metadata_source: metadata) + BakeChapterGlossary.v2(chapter: chapter) - eoc_with_exercise = %w[review-questions case-questions free-response] - eoc_with_exercise.each do |section_key| + eoc_sections = %w[summary + review-questions + free-response + practice] + eoc_sections.each do |section_key| MoveCustomSectionToEocContainer.v1( chapter: chapter, metadata_source: metadata, @@ -52,19 +57,40 @@ end end - selectors = 'section.review-questions, section.case-questions, section.free-response' + sections_with_module_links = %w[key-terms] + sections_with_module_links.each do |eoc_section| + MoveCustomSectionToEocContainer.v1( + chapter: chapter, + metadata_source: metadata, + container_key: eoc_section, + uuid_key: ".#{eoc_section}", + section_selector: "section.#{eoc_section}" + ) do |section| + RemoveSectionTitle.v1(section: section) + title = EocSectionTitleLinkSnippet.v1(page: section.ancestor(:page)) + section.prepend(child: title) + end + end + + selectors = 'section.review-questions, section.practice, section.free-response' chapter.composite_pages.search(selectors).injected_questions.each do |question| BakeInjectedExerciseQuestion.v1(question: question, number: question.count_in(:chapter)) end - BakeAllChapterSolutionsTypes.v1( - chapter: chapter, - within: chapter.search(selectors), - metadata_source: metadata + answer_key_inner_container = AnswerKeyInnerContainer.v1( + chapter: chapter, metadata_source: metadata, append_to: answer_key ) + + exercises = %w[review-questions practice free-response] + exercises.each do |klass| + Kitchen::Directions::MoveSolutionsFromExerciseSection.v1( + within: chapter, append_to: answer_key_inner_container, section_class: klass + ) + end end + AnswerKeyCleaner.v1(book: book) BakeFootnotes.v1(book: book) BakeIndex.v1(book: book) BakeCompositePages.v1(book: book) diff --git a/lib/recipes/data-science/recipe.rb b/lib/recipes/data-science/recipe.rb index 118ad6330..0426b50bd 100644 --- a/lib/recipes/data-science/recipe.rb +++ b/lib/recipes/data-science/recipe.rb @@ -141,6 +141,7 @@ BakeAppendix.v1(page: page, number: appendix_letter) end + AnswerKeyCleaner.v1(book: book) BakeTableColumns.v1(book: book) BakeEquations.v1(book: book) BakeIndex.v1(book: book) diff --git a/spec/recipes_spec/books/additive-manufacturing/expected_output.xhtml b/spec/recipes_spec/books/additive-manufacturing/expected_output.xhtml index a43ff57e9..4b08f0588 100644 --- a/spec/recipes_spec/books/additive-manufacturing/expected_output.xhtml +++ b/spec/recipes_spec/books/additive-manufacturing/expected_output.xhtml @@ -112,18 +112,31 @@ Introduction to Additive Manufacturing
  • - Solutions + Summary + +
  • +
  • + + Key Terms
  • -
  • - +
  • + Index
  • -
  • - +
  • + + Answer Key + +
      + +
    +
  • +
  • + Index
  • @@ -520,12 +533,6 @@ Introduction to Additive Manufacturing

    Post Processing refers to a host of manufacturing processes employed after the 3D printing step. These processes serve to finish an AM part by improving the appearance or material properties after it has been printed. These processes could be, but are not limited to, material removal, thermal processing, and surface treatments. The printed shape can be dimensionally measured to ensure consistency to the original drawing or source file.

    -
    - -

    Review Questions

    @@ -714,18 +721,6 @@ Layer – The layer is made by selectively and precisely depositing the mat
  • Energy – Focused energy in the form of a laser or focused light.
  • Material – Polymers, composites, and metals in photo curable polymers
  • -
    -
      -
    • Binder Jetting
    • -
    • Material Extrusion
    • -
    • Directed Energy Deposition
    • -
    • Material Jetting
    • -
    • Powder Bed Fusion
    • -
    • Sheet Lamination
    • -
    • Vat Photopolymerization -
    • -
    -

    Review Questions

    @@ -1052,11 +1047,6 @@ Layer – The layer is made by selectively and precisely depositing the mat Industries using Additive Manufacturing
    -
    -

    - In chapter 1 we introduced the building block of Additive manufacturing, namely machines, materials, digital and people that are necessary to successfully manufacture using AM. The core concept of building material up layer by layer to make a shape vs legacy process that deform or remove material in order to make a shape. We then introduced the 7 standard AM processes, and a maturity model for developing AM competency within an organization. Finally, we touched on how to select an AM process to make a particular part. -

    -

    Review Questions

    @@ -1330,12 +1320,12 @@ Layer – The layer is made by selectively and precisely depositing the mat
    -
    +

    - Solutions + Summary

    -

    Solutions

    +

    Summary

    @@ -1345,9 +1335,70 @@ Layer – The layer is made by selectively and precisely depositing the mat

    +
    +

    + In chapter 1 we introduced the building block of Additive manufacturing, namely machines, materials, digital and people that are necessary to successfully manufacture using AM. The core concept of building material up layer by layer to make a shape vs legacy process that deform or remove material in order to make a shape. We then introduced the 7 standard AM processes, and a maturity model for developing AM competency within an organization. Finally, we touched on how to select an AM process to make a particular part. +

    +
    +
    +
    +

    + Key Terms +

    +
    +

    Key Terms

    + + + +
    +
    + +

    + 1.2 + + + 1.2 + + Core AM Concepts + +

    +
    +
      +
    • STL
    • +
    • Build file
    • +
    +
    +
    + +

    + 1.3 + + + 1.3 + + Additive Manufacturing Processes + +

    +
    +
      +
    • Binder Jetting
    • +
    • Material Extrusion
    • +
    • Directed Energy Deposition
    • +
    • Material Jetting
    • +
    • Powder Bed Fusion
    • +
    • Sheet Lamination
    • +
    • Vat Photopolymerization +
    • +
    +
    -
    +

    Index

    @@ -1445,7 +1496,23 @@ Layer – The layer is made by selectively and precisely depositing the mat
    -
    +
    +

    + Answer Key +

    +
    +

    Answer Key

    + + + +
    +
    +

    Index

    diff --git a/spec/recipes_spec/books/data-science/expected_output.xhtml b/spec/recipes_spec/books/data-science/expected_output.xhtml index 550c82f91..c2cd3833c 100644 --- a/spec/recipes_spec/books/data-science/expected_output.xhtml +++ b/spec/recipes_spec/books/data-science/expected_output.xhtml @@ -546,58 +546,13 @@
    1. - Chapter 1 - -
    2. -
    3. - - Chapter 2 - -
    4. -
    5. - Chapter 3
    6. -
    7. - - Chapter 4 - -
    8. -
    9. - - Chapter 5 - -
    10. -
    11. - - Chapter 6 - -
    12. -
    13. - - Chapter 7 - -
    14. -
    15. - - Chapter 8 - -
    16. -
    17. - - Chapter 9 - -
    18. -
    19. - - Chapter 10 - -
    -
  • - +
  • + Index
  • @@ -8948,39 +8903,7 @@ Fell back to HTML parsing for the following content

    -
    -

    - Chapter 1 -

    -
    -

    Chapter 1

    - - - -
    -
    -
    -

    - Chapter 2 -

    -
    -

    Chapter 2

    - - - -
    -
    -
    +

    Chapter 3

    @@ -9173,120 +9096,8 @@ b) 0.691
    -
    -

    - Chapter 4 -

    -
    -

    Chapter 4

    - - - -
    -
    -
    -

    - Chapter 5 -

    -
    -

    Chapter 5

    - - - -
    -
    -
    -

    - Chapter 6 -

    -
    -

    Chapter 6

    - - - -
    -
    -
    -

    - Chapter 7 -

    -
    -

    Chapter 7

    - - - -
    -
    -
    -

    - Chapter 8 -

    -
    -

    Chapter 8

    - - - -
    -
    -
    -

    - Chapter 9 -

    -
    -

    Chapter 9

    - - - -
    -
    -
    -

    - Chapter 10 -

    -
    -

    Chapter 10

    - - - -
    -
    -
    +

    Index

    From 6aa0728485d6855dcc0dd1a018220f4b43d1f5e3 Mon Sep 17 00:00:00 2001 From: Tyler Nullmeier Date: Tue, 14 Jan 2025 15:24:31 -0600 Subject: [PATCH 2/3] Update input/output for additive-manufacturing To be more like real content --- .../expected_output.xhtml | 36 ++++++++++--------- .../books/additive-manufacturing/input.xhtml | 30 ++++++++-------- 2 files changed, 34 insertions(+), 32 deletions(-) diff --git a/spec/recipes_spec/books/additive-manufacturing/expected_output.xhtml b/spec/recipes_spec/books/additive-manufacturing/expected_output.xhtml index 4b08f0588..1d7d02963 100644 --- a/spec/recipes_spec/books/additive-manufacturing/expected_output.xhtml +++ b/spec/recipes_spec/books/additive-manufacturing/expected_output.xhtml @@ -1356,7 +1356,7 @@ Layer – The layer is made by selectively and precisely depositing the mat

    -
    +

    1.2 @@ -1368,12 +1368,11 @@ Layer – The layer is made by selectively and precisely depositing the mat

    -
      -
    • STL
    • -
    • Build file
    • -
    + + STL +
    -
    +

    1.3 @@ -1385,16 +1384,21 @@ Layer – The layer is made by selectively and precisely depositing the mat

    -
      -
    • Binder Jetting
    • -
    • Material Extrusion
    • -
    • Directed Energy Deposition
    • -
    • Material Jetting
    • -
    • Powder Bed Fusion
    • -
    • Sheet Lamination
    • -
    • Vat Photopolymerization -
    • -
    + + Binder Jetting + , + Material Extrusion + , + Directed Energy Deposition + , + Material Jetting + , + Powder Bed Fusion + , + Sheet Lamination + , + Vat Photopolymerization +
    diff --git a/spec/recipes_spec/books/additive-manufacturing/input.xhtml b/spec/recipes_spec/books/additive-manufacturing/input.xhtml index a4434a375..2573992f8 100644 --- a/spec/recipes_spec/books/additive-manufacturing/input.xhtml +++ b/spec/recipes_spec/books/additive-manufacturing/input.xhtml @@ -425,10 +425,9 @@

    Post Processing refers to a host of manufacturing processes employed after the 3D printing step. These processes serve to finish an AM part by improving the appearance or material properties after it has been printed. These processes could be, but are not limited to, material removal, thermal processing, and surface treatments. The printed shape can be dimensionally measured to ensure consistency to the original drawing or source file.

    -
    -
    • STL
    • -
    • Build file
    • -
    +

    Key Terms

    + STL +

    Review Questions

    @@ -645,18 +644,17 @@ Layer – The layer is made by selectively and precisely depositing the material -
    -
      -
    • Binder Jetting
    • -
    • Material Extrusion
    • -
    • Directed Energy Deposition
    • -
    • Material Jetting
    • -
    • Powder Bed Fusion
    • -
    • Sheet Lamination
    • -
    • Vat Photopolymerization -
    • -
    -
    +

    Key Terms

    + +Binder Jetting +Material Extrusion +Directed Energy Deposition +Material Jetting +Powder Bed Fusion +Sheet Lamination +Vat Photopolymerization + +

    Review Questions

    From db33900b4c9b7d167f6eeda20124a3e2e0a7d0aa Mon Sep 17 00:00:00 2001 From: Tyler Nullmeier Date: Thu, 16 Jan 2025 11:10:00 -0600 Subject: [PATCH 3/3] Update changelog for 2.25.0 release --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 652fe1db7..587aad8be 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [v2.25.0] - 2025-01-16 + * Bake `glossary` in `additive-manufacturing` * Do not bake `chapter solutions` in `additive-manufacturing` * Bake `answer key` in `additive-manufacturing`