Sha256: 48851f837e7d11533f1202e006d257514e79413d39d24a06737ca74ba75dacee

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

# frozen_string_literal: true

module Kitchen
  module Directions
    # Bake directions for further research
    #
    module BakeFurtherResearch
      def self.v1(chapter:, metadata_source:, uuid_prefix: '.')
        V1.new.bake(
          chapter: chapter,
          metadata_source: metadata_source,
          uuid_prefix: uuid_prefix)
      end

      class V1
        def bake(chapter:, metadata_source:, uuid_prefix: '.')
          MoveCustomSectionToEocContainer.v1(
            chapter: chapter,
            metadata_source: metadata_source,
            container_key: 'further-research',
            uuid_key: "#{uuid_prefix}further-research",
            section_selector: 'section.further-research',
            append_to: nil,
            include_intro_page: false
          ) do |further_research|
            RemoveSectionTitle.v1(section: further_research)
            title = EocSectionTitleLinkSnippet.v1(page: further_research.ancestor(:page))
            further_research.prepend(child: title)
            further_research.first('h3')[:itemprop] = 'name'
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
openstax_kitchen-9.2.0 lib/kitchen/directions/bake_further_research.rb
openstax_kitchen-9.1.0 lib/kitchen/directions/bake_further_research.rb
openstax_kitchen-9.0.0 lib/kitchen/directions/bake_further_research.rb