Module: Kitchen::Directions::BakeLOLinkLabels

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

Overview

Bake directions for LO link labels

Class Method Summary collapse

Class Method Details

.v1(book:) ⇒ Object



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

def self.v1(book:)
  book.search('a.lo-reference').each do |anchor|
    anchor.wrap_children('span', class: 'label-counter')
    anchor.prepend(child:
      <<~HTML
        <span class="label-text">#{I18n.t(:lo_label_text)}</span>
      HTML
    )
  end
end