Sha256: e4d2e755b996e3566c917ac9c8782c65a9f0608e67a736ade2fa3d5f79207e20

Contents?: true

Size: 669 Bytes

Versions: 22

Compression:

Stored size: 669 Bytes

Contents

# frozen_string_literal: true

module Kitchen
  module Directions
    module BakeUnclassifiedNotes
      def self.v1(book:)
        book.notes.each do |note|
          next unless note.classes.empty?

          bake_note(note: note)
        end
      end

      def self.bake_note(note:)
        note.wrap_children(class: 'os-note-body')

        title = note.title&.cut
        return unless title

        note.prepend(child:
          <<~HTML
            <h3 class="os-title" data-type="title">
              <span class="os-title-label" data-type="" id="#{title[:id]}">#{title.children}</span>
            </h3>
          HTML
        )
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
openstax_kitchen-13.0.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-12.2.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-12.1.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-12.0.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-11.2.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-11.1.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-11.0.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-10.0.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-9.2.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-9.1.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-9.0.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-8.0.1 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-8.0.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-7.0.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-6.1.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-6.0.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-5.0.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-4.1.1 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-4.1.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb
openstax_kitchen-4.0.0 lib/kitchen/directions/bake_notes/bake_unclassified_notes.rb