Update Rust documentation (1.28.0)

pull/856/merge
Thibaut Courouble 7 years ago
parent fff3bc2123
commit 73a41a1c99

@ -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

@ -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] = [/(?<!\.html)\z/]
options[:skip] = %w(book/second-edition/README.html)
options[:skip_patterns] = [/(?<!\.html)\z/, /\/print\.html/]
options[:fix_urls] = ->(url) do
url.sub! %r{(#{Rust.base_url}.+/)\z}, '\1index.html'

Loading…
Cancel
Save