Sha256: 86abf1f5d20fbfdf137bf0cf5f3f5ddea7e29f527801461e3f8cf69f01eb618d
Contents?: true
Size: 711 Bytes
Versions: 30
Compression:
Stored size: 711 Bytes
Contents
# frozen_string_literal: true @solution1 = Kitchen::BookRecipe.new do |doc| book = doc.book book.tables.each do |table| table_name = "Table #{table.count_in(:book)}" table.prepend(child: "<div class='caption'>#{table_name}</div>") doc.pantry(name: :link_text).store table_name, label: table.id end book.figures.each do |figure| figure_name = "Figure #{figure.count_in(:book)}" figure.prepend(child: "<div class='caption'>#{figure_name}</div>") doc.pantry(name: :link_text).store figure_name, label: figure.id end book.search('a.needs-label').each do |anchor| id = anchor[:href][1..-1] anchor.replace_children(with: doc.pantry(name: :link_text).get(id)) end end
Version data entries
30 entries across 30 versions & 1 rubygems