Unified · Split
| @@ -16,12 +16,9 @@ module Docs · 15 unmodified lines | |||
| 16 | @doc = at_css('#main, #main-content') | 16 | @doc = at_css('#main, #main-content') |
| 17 | 17 | ||
| 18 | css('.toggle-wrapper').remove | 18 | css('.toggle-wrapper').remove |
| 19 | css('.anchor').remove | ||
| 19 | 20 | ||
| 20 | css('h1.fqn').each do |node| | 21 | css('.main-heading > h1').each do |node| |
| 21 | node.content = node.at_css('.in-band').content | ||
| 22 | end | ||
| 23 | |||
| 24 | css('.main-heading > h1.fqn').each do |node| | ||
| 25 | node.parent.name = 'h1' | 22 | node.parent.name = 'h1' |
| 26 | node.parent.content = node.content | 23 | node.parent.content = node.content |
| 27 | end | 24 | end |
| @@ -107,6 +104,12 @@ module Docs · 79 unmodified lines | |||
| 107 | node.content = node.content | 104 | node.content = node.content |
| 108 | end | 105 | end |
| 109 | 106 | ||
| 107 | css('.rightside').each do |node| | ||
| 108 | node.children.each do |child| | ||
| 109 | child.remove if child.text?() and child.text() == " · " | ||
| 110 | end | ||
| 111 | end | ||
| 112 | |||
| 110 | css('.since + .srclink').each do |node| | 113 | css('.since + .srclink').each do |node| |
| 111 | node.previous_element.before(node) | 114 | node.previous_element.before(node) |
| 112 | end | 115 | end |
| @@ -9,7 +9,7 @@ module Docs · 8 unmodified lines | |||
| 9 | elsif slug == 'error-index' | 9 | elsif slug == 'error-index' |
| 10 | 'Compiler Errors' | 10 | 'Compiler Errors' |
| 11 | else | 11 | else |
| 12 | name = at_css('h1.fqn .in-band').content.remove(/\A.+\s/).remove('⎘') | 12 | name = at_css('main h1').content.remove(/\A.+\s/).remove('⎘') |
| 13 | mod = slug.split('/').first | 13 | mod = slug.split('/').first |
| 14 | name.prepend("#{mod}::") unless name.start_with?(mod) | 14 | name.prepend("#{mod}::") unless name.start_with?(mod) |
| 15 | name | 15 | name |
| @@ -27,7 +27,7 @@ module Docs · 11 unmodified lines | |||
| 27 | 'Compiler Errors' | 27 | 'Compiler Errors' |
| 28 | else | 28 | else |
| 29 | path = name.split('::') | 29 | path = name.split('::') |
| 30 | heading = at_css('h1.fqn .in-band').content.strip | 30 | heading = at_css('main h1').content.strip |
| 31 | if path.length > 2 || (path.length == 2 && (heading.start_with?('Module') || heading.start_with?('Primitive'))) | 31 | if path.length > 2 || (path.length == 2 && (heading.start_with?('Module') || heading.start_with?('Primitive'))) |
| 32 | path[0..1].join('::') | 32 | path[0..1].join('::') |
| 33 | else | 33 | else |
| @@ -46,7 +46,7 @@ module Docs · 12 unmodified lines | |||
| 46 | else | 46 | else |
| 47 | css('.method') | 47 | css('.method') |
| 48 | .each_with_object({}) { |node, entries| | 48 | .each_with_object({}) { |node, entries| |
| 49 | name = node.at_css('.fnname').try(:content) | 49 | name = node.at_css('a.fn').try(:content) |
| 50 | next unless name | 50 | next unless name |
| 51 | name.prepend "#{self.name}::" | 51 | name.prepend "#{self.name}::" |
| 52 | entries[name] ||= [name, node['id']] | 52 | entries[name] ||= [name, node['id']] |
| @@ -3,7 +3,7 @@ · 2 unmodified lines | |||
| 3 | module Docs | 3 | module Docs |
| 4 | class Rust < UrlScraper | 4 | class Rust < UrlScraper |
| 5 | self.type = 'rust' | 5 | self.type = 'rust' |
| 6 | self.release = '1.70.0' | 6 | self.release = '1.71.0' |
| 7 | self.base_url = 'https://doc.rust-lang.org/' | 7 | self.base_url = 'https://doc.rust-lang.org/' |
| 8 | self.root_path = 'book/index.html' | 8 | self.root_path = 'book/index.html' |
| 9 | self.initial_paths = %w( | 9 | self.initial_paths = %w( |