Sha256: be0338edffda741f7d729b88bacac3af9141a6308c767f9e0b6ecf79ef986d8b

Contents?: true

Size: 1.05 KB

Versions: 9

Compression:

Stored size: 1.05 KB

Contents

# frozen_string_literal: true

module Kitchen
  module Directions
    module EocSectionTitleLinkSnippet
      def self.v1(page:)
        chapter = page.ancestor(:chapter)
        <<~HTML
          <a href="##{page.title.id}">
            <h3 data-type="document-title" id="#{page.title.copied_id}">
              <span class="os-number">#{chapter.count_in(:book)}.#{page.count_in(:chapter)}</span>
              <span class="os-divider"> </span>
              <span class="os-text" data-type="" itemprop="">#{page.title_text}</span>
            </h3>
          </a>
        HTML
      end

      def self.v2(page:)
        chapter = page.ancestor(:chapter)
        <<~HTML
          <div>
            <h3 data-type="document-title" id="#{page.title.copied_id}">
              <span class="os-number">#{chapter.count_in(:book)}.#{page.count_in(:chapter)}</span>
              <span class="os-divider"> </span>
              <span class="os-text" data-type="" itemprop="">#{page.title_text}</span>
            </h3>
          </div>
        HTML
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
openstax_kitchen-10.0.0 lib/kitchen/directions/eoc_section_title_link_snippet.rb
openstax_kitchen-9.2.0 lib/kitchen/directions/eoc_section_title_link_snippet.rb
openstax_kitchen-9.1.0 lib/kitchen/directions/eoc_section_title_link_snippet.rb
openstax_kitchen-9.0.0 lib/kitchen/directions/eoc_section_title_link_snippet.rb
openstax_kitchen-8.0.1 lib/kitchen/directions/eoc_section_title_link_snippet.rb
openstax_kitchen-8.0.0 lib/kitchen/directions/eoc_section_title_link_snippet.rb
openstax_kitchen-7.0.0 lib/kitchen/directions/eoc_section_title_link_snippet.rb
openstax_kitchen-6.1.0 lib/kitchen/directions/eoc_section_title_link_snippet.rb
openstax_kitchen-6.0.0 lib/kitchen/directions/eoc_section_title_link_snippet.rb