Sha256: 42890e480bf4b43b547b88665ad58e5e145f8b2f82ed43acfeba958262fbbb36
Contents?: true
Size: 860 Bytes
Versions: 23
Compression:
Stored size: 860 Bytes
Contents
# frozen_string_literal: true module Kitchen::Directions::BakeChapterSectionExercises class V1 def bake(chapter:, trash_title:) chapter.pages.each do |page| page.search('section.section-exercises').each do |section| section.first('h3[data-type="title"]')&.trash if trash_title section.wrap( %(<div class="os-eos os-section-exercises-container" data-uuid-key=".section-exercises">) ) section_title = I18n.t( :section_exercises, number: "#{chapter.count_in(:book)}.#{section.count_in(:chapter)}") section.prepend(sibling: <<~HTML <h3 data-type="document-title"> <span class="os-text">#{section_title}</span> </h3> HTML ) end end end end end
Version data entries
23 entries across 23 versions & 1 rubygems