Sha256: 52db6b93b7c4e25c46e06f05ec8b0a470078ad8c24c8ba0adbe983e1e64f4de8
Contents?: true
Size: 870 Bytes
Versions: 9
Compression:
Stored size: 870 Bytes
Contents
# frozen_string_literal: true module Kitchen::Directions::BakeNumberedTable # Difference from v1: only in the caption # V2 caption titles are nested within an .os-caption span class V2 def bake(table:, number:) Kitchen::Directions::BakeTableBody.v1(table: table, number: number) caption = '' if table&.caption&.first("span[data-type='title']") caption_el = table.caption caption_el.add_class('os-caption') caption_el.name = 'span' caption = caption_el.cut end table.append(sibling: <<~HTML <div class="os-caption-container"> <span class="os-title-label">#{I18n.t(:table_label)} </span> <span class="os-number">#{number}</span> <span class="os-divider"> </span> #{caption} </div> HTML ) end end end
Version data entries
9 entries across 9 versions & 1 rubygems