Class: Kitchen::Directions::BakeChapterKeyConcepts::V1

Inherits:
Object
  • Object
show all
Defined in:
lib/kitchen/directions/bake_chapter_key_concepts/v1.rb

Instance Method Summary collapse

Instance Method Details

#bake(chapter:, metadata_source:, append_to:, uuid_prefix:) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/kitchen/directions/bake_chapter_key_concepts/v1.rb', line 5

def bake(chapter:, metadata_source:, append_to:, uuid_prefix:)
  Kitchen::Directions::MoveCustomSectionToEocContainer.v1(
    chapter: chapter,
    metadata_source: ,
    container_key: 'key-concepts',
    uuid_key: "#{uuid_prefix}key-concepts",
    section_selector: 'section.key-concepts',
    append_to: append_to || chapter,
    wrap_section: true, wrap_content: true
  ) do |section|
    Kitchen::Directions::RemoveSectionTitle.v1(section: section)
    title = Kitchen::Directions::EocSectionTitleLinkSnippet.v1(page: section.ancestor(:page))
    section.prepend(child: title)
  end
end