Skip to content

create pl-nursing recipe #402

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]


* Create recipe for Polish Nursing book

## [v2.24.0] - 2024-10-24

Expand Down
1 change: 1 addition & 0 deletions lib/recipes/bake
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ book_recipes = \
when 'philosophy' then [PHILOSOPHY_RECIPE]
when 'pl-economics' then [PL_ECONOMICS_RECIPE]
when 'pl-marketing' then [PL_MARKETING_RECIPE]
when 'pl-nursing' then [PL_NURSING_RECIPE]
when 'pl-psychology' then [PL_PSYCHOLOGY_RECIPE]
when 'pl-u-physics' then [PL_U_PHYSICS_RECIPE]
when 'political-science' then [POLITICAL_SCIENCE_RECIPE]
Expand Down
4 changes: 4 additions & 0 deletions lib/recipes/pl-nursing/locales/pl.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pl:
eoc:
chapter-summary: Podsumowanie rozdziału
review-questions: Sprawdź wiedzę
118 changes: 118 additions & 0 deletions lib/recipes/pl-nursing/recipe.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
# frozen_string_literal: true

PL_NURSING_RECIPE = Kitchen::BookRecipe.new(book_short_name: :plnursing) do |doc, _resources|
include Kitchen::Directions

doc.selectors.override(
reference: 'section.references'
)
book = doc.book
metadata = book.metadata

book.search('cnx-pi').trash

BakeListsWithPara.v1(book: book)
BakeUnnumberedFigure.v1(book: book)
BakePreface.v1(book: book, cases: true)

BakeChapterIntroductions.v2(
book: book, options: {
strategy: :add_objectives, bake_chapter_outline: true, introduction_order: :v3, cases: true
}
)
BakeChapterTitle.v1(book: book, cases: true)

answer_key = BookAnswerKeyContainer.v1(book: book)

book.chapters.each do |chapter|
BakeNonIntroductionPages.v1(chapter: chapter, options: { cases: true })
BakeLearningObjectives.v2(chapter: chapter, add_title: false)

chapter.figures(only: :figure_to_number?).each do |figure|
BakeFigure.v1(figure: figure,
number: "#{chapter.count_in(:book)}.#{figure.count_in(:chapter)}",
cases: true)
end

chapter.tables('$:not(.unnumbered)').each do |table|
BakeNumberedTable.v1(table: table,
number: "#{chapter.count_in(:book)}.#{table.count_in(:chapter)}",
cases: true)
end

# EOC
MoveCustomSectionToEocContainer.v1(
chapter: chapter,
metadata_source: metadata,
container_key: 'chapter-summary',
uuid_key: '.chapter-summary',
section_selector: 'section.chapter-summary'
) do |section|
RemoveSectionTitle.v1(section: section)
end

BakeChapterGlossary.v1(chapter: chapter, metadata_source: metadata, has_para: true)

MoveCustomSectionToEocContainer.v1(
chapter: chapter,
metadata_source: metadata,
container_key: 'review-questions',
uuid_key: '.review-questions',
section_selector: 'section.review-questions'
) do |section|
RemoveSectionTitle.v1(section: section)
end

BakeAllNumberedExerciseTypes.v1(
within: chapter.search('section.review-questions'),
exercise_options: { cases: true }
)

BakeAllNumberedExerciseTypes.v1(
within: chapter.pages.notes('$.unfolding-casestudy'),
exercise_options: { cases: true }
)

BakeSortableSection.v1(
chapter: chapter,
metadata_source: metadata,
klass: 'suggested-reading'
)

answer_key_inner_container = AnswerKeyInnerContainer.v1(
chapter: chapter, metadata_source: metadata, append_to: answer_key, options: { cases: true }
)

Kitchen::Directions::MoveSolutionsFromNumberedNote.v1(
chapter: chapter, append_to: answer_key_inner_container, note_class: 'unfolding-casestudy'
)

Kitchen::Directions::MoveSolutionsFromExerciseSection.v1(
within: chapter, append_to: answer_key_inner_container, section_class: 'review-questions'
)

chapter.exercises.each do |exercise|
BakeFirstElements.v1(within: exercise)
end
end

note_classes = %w[special-considerations clinical-tip safety-alert
unfolding-casestudy trending-today]

BakeAutotitledNotes.v1(book: book, classes: note_classes, options: { cases: true })
BakeCustomTitledNotes.v1(book: book, classes: %w[media-feature])
BakeUnclassifiedNotes.v1(book: book)
BakeUnnumberedTables.v1(book: book)
BakeTableColumns.v1(book: book)
BakeIframes.v1(book: book)
BakeUnitTitle.v1(book: book)
BakeReferences.v4(book: book, metadata_source: metadata, cases: true)
BakeIndex.v1(book: book, types: %w[name term foreign], uuid_prefix: '.')
BakeCompositePages.v1(book: book)
BakeCompositeChapters.v1(book: book)
BakeToc.v1(book: book, options: { cases: true })
BakeFolio.v1(book: book)
BakeRexWrappers.v1(book: book)
BakeLinks.v1(book: book)
BakeLinkPlaceholders.v1(book: book, cases: true)
end
Loading
Loading