# frozen_string_literal: true module Kitchen::Directions::BakeTheorem class V1 def bake(theorem:, number:) theorem['use-subtitle'] = true new_subtitle = theorem.title.cut theorem.wrap_children(class: 'os-note-body') note_body = theorem.first('.os-note-body') note_body.prepend(sibling: <<~HTML
#{I18n.t(:theorem)} #{number}
HTML ) new_subtitle.name = 'h4' new_subtitle.add_class('os-subtitle') new_subtitle.children.wrap('') note_body.prepend(child: new_subtitle.paste) end end end