| @@ -71,19 +71,6 @@ module Docs · 70 unmodified lines |
| 71 | doc.first_element_child.name = 'h1' if doc.first_element_child.name = 'h2' | 71 | doc.first_element_child.name = 'h1' if doc.first_element_child.name = 'h2' |
| 72 | at_css('h1').content = 'Rust Documentation' if root_page? | 72 | at_css('h1').content = 'Rust Documentation' if root_page? |
| 73 | | 73 | |
| 74 | css('.table-display').each do |node| | | |
| 75 | node.css('td').each do |td| | | |
| 76 | node.before(td.children) | | |
| 77 | end | | |
| 78 | node.remove | | |
| 79 | end | | |
| 80 | | | |
| 81 | css('.important-traits').to_a.each_with_index do |node, index| | | |
| 82 | content = node.at_css('.content.hidden .content') | | |
| 83 | node.at_css('.content.hidden').replace(content) if content | | |
| 84 | node.parent.after(node) if node.parent.name.in?(%(h2 h3 h4)) | | |
| 85 | end | | |
| 86 | | | |
| 87 | css('code.content').each do |node| | 74 | css('code.content').each do |node| |
| 88 | node.name = 'pre' | 75 | node.name = 'pre' |
| 89 | node.css('.fmt-newline').each do |line| | 76 | node.css('.fmt-newline').each do |line| |
| @@ -97,6 +84,24 @@ module Docs · 7 unmodified lines |
| 97 | node.previous_element.before(node) | 84 | node.previous_element.before(node) |
| 98 | end | 85 | end |
| 99 | | 86 | |
| | 87 | css('.sidebar').remove |
| | 88 | |
| | 89 | css('.collapse-toggle').remove |
| | 90 | |
| | 91 | # Fix how notable-traits sections are shown |
| | 92 | |
| | 93 | css('.method').each do |node| |
| | 94 | traitSection = node.at_css('.notable-traits') |
| | 95 | |
| | 96 | if traitSection |
| | 97 | traitSectionContent = traitSection.css('.notable-traits-tooltiptext') |
| | 98 | traitSection.css('.notable-traits-tooltip').remove |
| | 99 | traitSection.add_child(traitSectionContent) |
| | 100 | node.after(traitSection) |
| | 101 | end |
| | 102 | |
| | 103 | end |
| | 104 | |
| 100 | doc | 105 | doc |
| 101 | end | 106 | end |
| 102 | end | 107 | end |