6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/kitchen/directions/bake_appendix.rb', line 6
def self.v1(page:, number:)
title = page.title
title.name = 'h1'
title.replace_children(with:
" <span class=\"os-part-text\">\#{I18n.t(:appendix)} </span>\n <span class=\"os-number\">\#{number}</span>\n <span class=\"os-divider\"> </span>\n <span data-type=\"\" itemprop=\"\" class=\"os-text\">\#{title.children}</span>\n HTML\n )\n\n # Make a section with data-depth of X have a header level of X+1\n page.search('section').each do |section|\n title = section.titles.first\n next unless title.present?\n\n title.name = \"h\#{section['data-depth'].to_i + 1}\"\n section.name = 'div' if section.has_class?('column-container')\n end\nend\n"
|