| @@ -7,13 +7,14 @@ module Docs · 6 unmodified lines |
| 7 | css('.rightsidebar', 'hr', '.sh_mark', '.fancy_toc > a', '.fancy_toc_mark', 'h[style*="none"]', | 7 | css('.rightsidebar', 'hr', '.sh_mark', '.fancy_toc > a', '.fancy_toc_mark', 'h[style*="none"]', |
| 8 | 'a[href$="intro.html"] > h2', 'a[href$="intro"] > h2', '#document_title + #toc_header', | 8 | 'a[href$="intro.html"] > h2', 'a[href$="intro"] > h2', '#document_title + #toc_header', |
| 9 | '#document_title ~ #toc').remove | 9 | '#document_title ~ #toc').remove |
| | 10 | css('a[href$="intro.html"]:empty', 'a[href$="intro"]:empty').remove |
| 10 | | 11 | |
| 11 | css('.fancy_title', '> h2[align=center]', '#document_title').each do |node| | 12 | css('.fancy_title', '> h2[align=center]', '#document_title').each do |node| |
| 12 | node.name = 'h1' | 13 | node.name = 'h1' |
| 13 | end | 14 | end |
| 14 | | 15 | |
| 15 | unless at_css('h1') | 16 | unless at_css('h1') |
| 16 | if at_css('h2').content == context[:html_title] | 17 | if at_css('h2') && at_css('h2').content == context[:html_title] |
| 17 | at_css('h2').name = 'h1' | 18 | at_css('h2').name = 'h1' |
| 18 | else | 19 | else |
| 19 | doc.child.before("<h1>#{context[:html_title]}</h1>") | 20 | doc.child.before("<h1>#{context[:html_title]}</h1>") |
| @@ -81,8 +82,26 @@ module Docs · 61 unmodified lines |
| 81 | node.remove_attribute('onclick') | 82 | node.remove_attribute('onclick') |
| 82 | end | 83 | end |
| 83 | | 84 | |
| 84 | css('*[align]').remove_attr('align') | 85 | css('svg *[style], svg *[fill]').each do |node| |
| | 86 | # transform style in SVG diagrams, e.g. on https://sqlite.org/lang_insert.html |
| | 87 | if node['style'] == 'fill:rgb(0,0,0)' or node['fill'] == 'rgb(0,0,0)' |
| | 88 | node.add_class('fill') |
| | 89 | node.remove_attribute('fill') |
| | 90 | elsif node['style'] == 'fill:none;stroke-width:2.16;stroke:rgb(0,0,0);' |
| | 91 | node.add_class('stroke') |
| | 92 | elsif node['style'] == 'fill:none;stroke-width:3.24;stroke:rgb(211,211,211);' |
| | 93 | node.add_class('stroke') |
| | 94 | elsif node['style'] |
| | 95 | raise NotImplementedError, "SVG style #{node['style']}" |
| | 96 | end |
| | 97 | node.remove_attribute('style') |
| | 98 | end |
| | 99 | |
| | 100 | css('.imgcontainer > div[style]').add_class('imgcontainer') |
| 85 | css('*[style]:not(.imgcontainer)').remove_attr('style') | 101 | css('*[style]:not(.imgcontainer)').remove_attr('style') |
| | 102 | css('.imgcontainer').remove_class('imgcontainer') |
| | 103 | |
| | 104 | css('*[align]').remove_attr('align') |
| 86 | css('table[border]').remove_attr('border') | 105 | css('table[border]').remove_attr('border') |
| 87 | | 106 | |
| 88 | doc | 107 | doc |