Sha256: 33da70681adbb2b3c9ba9733b4560cf3ee57dd8e44b7159a425d9f445d839b12

Contents?: true

Size: 861 Bytes

Versions: 14

Compression:

Stored size: 861 Bytes

Contents

# frozen_string_literal: true

module Kitchen::Directions::MoveExercisesToEOC
  # Main difference from v1 is the presence of a section title
  # and some additional wrappers
  class V2
    def bake(chapter:, metadata_source:, klass:, append_to: nil, uuid_prefix: '.')
      Kitchen::Directions::MoveCustomSectionToEocContainer.v1(
        chapter: chapter,
        metadata_source: metadata_source,
        container_key: klass,
        uuid_key: "#{uuid_prefix}#{klass}",
        section_selector: "section.#{klass}",
        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
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
openstax_kitchen-19.0.0 lib/kitchen/directions/move_exercises_to_eoc/v2.rb
openstax_kitchen-18.0.0 lib/kitchen/directions/move_exercises_to_eoc/v2.rb
openstax_kitchen-17.1.0 lib/kitchen/directions/move_exercises_to_eoc/v2.rb
openstax_kitchen-17.0.0 lib/kitchen/directions/move_exercises_to_eoc/v2.rb
openstax_kitchen-16.0.0 lib/kitchen/directions/move_exercises_to_eoc/v2.rb
openstax_kitchen-15.0.0 lib/kitchen/directions/move_exercises_to_eoc/v2.rb
openstax_kitchen-14.0.0 lib/kitchen/directions/move_exercises_to_eoc/v2.rb
openstax_kitchen-13.0.0 lib/kitchen/directions/move_exercises_to_eoc/v2.rb
openstax_kitchen-12.2.0 lib/kitchen/directions/move_exercises_to_eoc/v2.rb
openstax_kitchen-12.1.0 lib/kitchen/directions/move_exercises_to_eoc/v2.rb
openstax_kitchen-12.0.0 lib/kitchen/directions/move_exercises_to_eoc/v2.rb
openstax_kitchen-11.2.0 lib/kitchen/directions/move_exercises_to_eoc/v2.rb
openstax_kitchen-11.1.0 lib/kitchen/directions/move_exercises_to_eoc/v2.rb
openstax_kitchen-11.0.0 lib/kitchen/directions/move_exercises_to_eoc/v2.rb