Sha256: 4557669a6af328277f1cb65ea4183b36adf181a81dc9aa45f92e12536374eac2

Contents?: true

Size: 544 Bytes

Versions: 14

Compression:

Stored size: 544 Bytes

Contents

# frozen_string_literal: true

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

        return unless title

        # Store label information
        note_label = title.children
        note.pantry(name: :link_text).store note_label, label: note.id

        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

14 entries across 14 versions & 1 rubygems

Version Path
openstax_kitchen-11.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-10.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-9.2.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-9.1.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-9.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-8.0.1 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-8.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-7.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-6.1.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-6.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-5.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-4.1.1 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-4.1.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb
openstax_kitchen-4.0.0 lib/kitchen/directions/bake_notes/bake_note_subtitle.rb