Module: Kitchen::Directions::BakeUnnumberedTables

Defined in:
lib/kitchen/directions/bake_unnumbered_tables.rb

Class Method Summary collapse

Class Method Details

.v1(book:) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/kitchen/directions/bake_unnumbered_tables.rb', line 6

def self.v1(book:)
  book.tables('$.unnumbered').each do |table|
    table.wrap(%(<div class="os-table">))
    table.remove_attribute('summary')
    table.parent.add_class('os-unstyled-container') if table.unstyled?
    table.parent.add_class('os-column-header-container') if table.column_header?
    table.parent.add_class('os-top-titled-container') if table.top_titled?

    table.search('th').each do |header|
      header[:scope] = 'col'
    end
  end
end