Class: Kitchen::Directions::BakeNumberedTable::V2
- Defined in:
- lib/kitchen/directions/bake_numbered_table/v2.rb
Overview
Difference from v1: only in the caption V2 caption titles are nested within an .os-caption span
Instance Method Summary collapse
Instance Method Details
#bake(table:, number:, cases: false) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/kitchen/directions/bake_numbered_table/v2.rb', line 8 def bake(table:, number:, cases: false) Kitchen::Directions::BakeTableBody::V1.new.bake(table: table, number: number, cases: cases) = '' if (table&.&.first("span[data-type='title']") || table&.) \ && !table. = table. .add_class('os-caption') .name = 'span' = .cut end table.append(sibling: <<~HTML <div class="os-caption-container"> <span class="os-title-label">#{I18n.t("table#{'.nominative' if cases}")} </span> <span class="os-number">#{number}</span> <span class="os-divider"> </span> #{} </div> HTML ) table.parent.add_class('os-timeline-table-container') if table.has_class?('timeline-table') end |