rust: proper and working update to 1.37.0

pull/1069/head
Jasper van Merle 6 years ago
parent c6481f4587
commit 212f7ee118

@ -655,7 +655,7 @@ credits = [
'Rust',
'2010 The Rust Project Developers',
'MIT',
'https://raw.githubusercontent.com/rust-lang/rust/master/LICENSE-MIT'
'https://raw.githubusercontent.com/rust-lang/book/master/LICENSE-MIT'
], [
'RxJS',
'2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors',

@ -34,8 +34,10 @@ module Docs
end
css('a.header').each do |node|
node.first_element_child['id'] = node['name'] || node['id']
node.before(node.children).remove
unless node.first_element_child.nil?
node.first_element_child['id'] = node['name'] || node['id']
node.before(node.children).remove
end
end
css('.docblock > h1:not(.section-header)').each { |node| node.name = 'h4' }
@ -53,7 +55,7 @@ module Docs
end
css('h1 > a', 'h2 > a', 'h3 > a', 'h4 > a', 'h5 > a').each do |node|
node.before(node.children).remove
node.before(node.children).remove if node.parent.at_css('.srclink').nil?
end
css('pre > code').each do |node|

@ -17,9 +17,7 @@ module Docs
PRIMITIVE_SLUG = /\A(\w+)\/(primitive)\./
def get_type
if slug.start_with?('book')
'Guide'
elsif slug.start_with?('reference')
if slug.start_with?('reference')
'Reference'
elsif slug == 'error-index'
'Compiler Errors'

@ -5,7 +5,7 @@ module Docs
self.type = 'rust'
self.release = '1.37.0'
self.base_url = 'https://doc.rust-lang.org/'
self.root_path = 'book/second-edition/index.html'
self.root_path = 'book/index.html'
self.initial_paths = %w(
reference/introduction.html
collections/index.html
@ -19,12 +19,11 @@ module Docs
html_filters.push 'rust/entries', 'rust/clean_html'
options[:only_patterns] = [
/\Abook\/second-edition\//,
/\Areference\//,
/\Acollections\//,
/\Astd\// ]
options[:skip] = %w(book/second-edition/README.html)
options[:skip] = %w(book/README.html)
options[:skip_patterns] = [/(?<!\.html)\z/, /\/print\.html/]
options[:fix_urls] = ->(url) do

Loading…
Cancel
Save