Sha256: 38323c072ffcec0c7142ae24033ab96c6e8901a1a8f53ddd5b1a6fabc24b0984

Contents?: true

Size: 783 Bytes

Versions: 8

Compression:

Stored size: 783 Bytes

Contents

# frozen_string_literal: true

module Kitchen
  module Directions
    # Bake directions for table body
    #
    module BakeTableBody
      def self.v1(table:, number:)
        table.remove_attribute('summary')
        table.wrap(%(<div class="os-table">))

        table_label = "#{I18n.t(:table_label)} #{number}"
        table.pantry(name: :link_text).store table_label, label: table.id

        if table.top_titled?
          table.parent.add_class('os-top-titled-container')
          table.prepend(sibling:
            <<~HTML
              <div class="os-table-title">#{table.title}</div>
            HTML
          )
          table.title_row.trash
        end

        table.parent.add_class('os-column-header-container') if table.column_header?
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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