diff --git a/lib/docs/filters/rust/clean_html.rb b/lib/docs/filters/rust/clean_html.rb
index 1550c89c..416e6e44 100644
--- a/lib/docs/filters/rust/clean_html.rb
+++ b/lib/docs/filters/rust/clean_html.rb
@@ -5,7 +5,7 @@ module Docs
puts subpath if at_css('#versioninfo')
if slug.start_with?('book') || slug.start_with?('reference')
- @doc = at_css('#content')
+ @doc = at_css('#content main')
elsif slug == 'error-index'
css('.error-undescribed').remove
@@ -30,7 +30,7 @@ module Docs
css('.rusttest', '.test-arrow', 'hr').remove
css('a.header').each do |node|
- node.first_element_child['id'] = node['name']
+ node.first_element_child['id'] = node['name'] || node['id']
node.before(node.children).remove
end
@@ -62,6 +62,9 @@ module Docs
node['data-language'] = 'rust' if node['class'] && node['class'].include?('rust')
end
+ doc.first_element_child.name = 'h1' if doc.first_element_child.name = 'h2'
+ at_css('h1').content = 'Rust Documentation' if root_page?
+
doc
end
end
diff --git a/lib/docs/scrapers/rust.rb b/lib/docs/scrapers/rust.rb
index e6019ac5..ba2f41ed 100644
--- a/lib/docs/scrapers/rust.rb
+++ b/lib/docs/scrapers/rust.rb
@@ -1,9 +1,9 @@
module Docs
class Rust < UrlScraper
self.type = 'rust'
- self.release = '1.26.0'
+ self.release = '1.28.0'
self.base_url = 'https://doc.rust-lang.org/'
- self.root_path = 'book/first-edition/index.html'
+ self.root_path = 'book/second-edition/index.html'
self.initial_paths = %w(
reference/introduction.html
collections/index.html
@@ -17,13 +17,13 @@ module Docs
html_filters.push 'rust/entries', 'rust/clean_html'
options[:only_patterns] = [
- /\Abook\/first-edition\//,
+ /\Abook\/second-edition\//,
/\Areference\//,
/\Acollections\//,
/\Astd\// ]
- options[:skip] = %w(book/first-edition/README.html)
- options[:skip_patterns] = [/(?(url) do
url.sub! %r{(#{Rust.base_url}.+/)\z}, '\1index.html'