Sha256: 45724f5c2e416b1ccf9c971c88607352321104ce43f146767582091693469206

Contents?: true

Size: 685 Bytes

Versions: 13

Compression:

Stored size: 685 Bytes

Contents

# frozen_string_literal: true

module Kitchen
  module Directions
    module BakeNoteSubtitle
      def self.v1(note:, cases: false)
        title = note.title&.cut

        return unless title

        # Store label information
        note_label = title.children
        if cases
          note.target_label(label_text: 'note', custom_content: note_label.to_s, cases: cases)
        else
          note.target_label(custom_content: note_label.to_s)
        end

        title.name = 'h4'
        title.add_class('os-subtitle')
        title.wrap_children('span', class: 'os-subtitle-label')
        note.first!('.os-note-body').prepend(child: title.to_s)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
openstax_kitchen-19.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-18.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-17.1.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-17.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-16.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-15.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-14.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-13.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-12.2.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-12.1.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-12.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-11.2.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-11.1.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb