| @@ -8,6 +8,36 @@ module Docs · 7 unmodified lines |
| 8 | 8 | # Remove breadcrumbs |
| 9 | 9 | css('.breadcrumb').remove |
| 10 | 10 | |
| 11 | + # Titleize title on Backpressure Operators page |
| 12 | + if subpath == 'documentation/operators/backpressure.html' |
| 13 | + title = at_css('h1') |
| 14 | + title.content = title.content.titleize |
| 15 | + end |
| 16 | + |
| 17 | + # Lower all h1 headers except the first one |
| 18 | + css('* + h1').each do |node| |
| 19 | + node.name = 'h2' |
| 20 | + end |
| 21 | + |
| 22 | + # Pull code blocks in links out of their <strong> parent (if possible) |
| 23 | + css('a > strong > code').each do |node| |
| 24 | + # Skip if the parent had multiple code nodes and node.parent.replace already ran for one |
| 25 | + next unless node.parent.name == 'strong' |
| 26 | + |
| 27 | + node.parent.replace node.parent.children |
| 28 | + end |
| 29 | + |
| 30 | + # Pull header out of trees |
| 31 | + tree = at_css('#tree') |
| 32 | + unless tree.nil? |
| 33 | + title = tree.at_css('h1') |
| 34 | + title.name = 'h2' |
| 35 | + tree.before(title) |
| 36 | + end |
| 37 | + |
| 38 | + # Beautify operator descriptions |
| 39 | + at_css('h3').name = 'blockquote' if subpath.include?('operators/') |
| 40 | + |
| 11 | 41 | # Replace interactive demo's with links to them |
| 12 | 42 | css('rx-marbles').each do |node| |
| 13 | 43 | node.name = 'a' |
| @@ -37,8 +67,9 @@ module Docs · 23 unmodified lines |
| 37 | 67 | |
| 38 | 68 | # Make language specific implementation titles prettier |
| 39 | 69 | css('.panel-title').each do |node| |
| 40 | | − # Remove the link, keep the text |
| 41 | | − node.content = node.content |
| 70 | + # Remove the link, keep the children |
| 71 | + link = node.at_css('a') |
| 72 | + link.replace(link.children) unless link.nil? |
| 42 | 73 | |
| 43 | 74 | # Transform it into a header for better styling |
| 44 | 75 | node.name = 'h3' |