Unified · Split
| @@ -655,7 +655,7 @@ credits = [ · 654 unmodified lines | ||
| 655 | 655 | 'Rust', |
| 656 | 656 | '2010 The Rust Project Developers', |
| 657 | 657 | 'MIT', |
| 658 | − 'https://raw.githubusercontent.com/rust-lang/rust/master/LICENSE-MIT' | |
| 658 | + 'https://raw.githubusercontent.com/rust-lang/book/master/LICENSE-MIT' | |
| 659 | 659 | ], [ |
| 660 | 660 | 'RxJS', |
| 661 | 661 | '2015-2018 Google, Inc., Netflix, Inc., Microsoft Corp. and contributors', |
| @@ -34,8 +34,10 @@ module Docs · 33 unmodified lines | ||
| 34 | 34 | end |
| 35 | 35 | |
| 36 | 36 | css('a.header').each do |node| |
| 37 | − node.first_element_child['id'] = node['name'] || node['id'] | |
| 38 | − node.before(node.children).remove | |
| 37 | + unless node.first_element_child.nil? | |
| 38 | + node.first_element_child['id'] = node['name'] || node['id'] | |
| 39 | + node.before(node.children).remove | |
| 40 | + end | |
| 39 | 41 | end |
| 40 | 42 | |
| 41 | 43 | css('.docblock > h1:not(.section-header)').each { |node| node.name = 'h4' } |
| @@ -53,7 +55,7 @@ module Docs · 11 unmodified lines | ||
| 53 | 55 | end |
| 54 | 56 | |
| 55 | 57 | css('h1 > a', 'h2 > a', 'h3 > a', 'h4 > a', 'h5 > a').each do |node| |
| 56 | − node.before(node.children).remove | |
| 58 | + node.before(node.children).remove if node.parent.at_css('.srclink').nil? | |
| 57 | 59 | end |
| 58 | 60 | |
| 59 | 61 | css('pre > code').each do |node| |
| @@ -17,9 +17,7 @@ module Docs · 16 unmodified lines | ||
| 17 | 17 | PRIMITIVE_SLUG = /\A(\w+)\/(primitive)\./ |
| 18 | 18 | |
| 19 | 19 | def get_type |
| 20 | − if slug.start_with?('book') | |
| 21 | − 'Guide' | |
| 22 | − elsif slug.start_with?('reference') | |
| 20 | + if slug.start_with?('reference') | |
| 23 | 21 | 'Reference' |
| 24 | 22 | elsif slug == 'error-index' |
| 25 | 23 | 'Compiler Errors' |
| @@ -3,9 +3,9 @@ · 2 unmodified lines | ||
| 3 | 3 | module Docs |
| 4 | 4 | class Rust < UrlScraper |
| 5 | 5 | self.type = 'rust' |
| 6 | − self.release = '1.30.1' | |
| 6 | + self.release = '1.37.0' | |
| 7 | 7 | self.base_url = 'https://doc.rust-lang.org/' |
| 8 | − self.root_path = 'book/second-edition/index.html' | |
| 8 | + self.root_path = 'book/index.html' | |
| 9 | 9 | self.initial_paths = %w( |
| 10 | 10 | reference/introduction.html |
| 11 | 11 | collections/index.html |
| @@ -19,12 +19,11 @@ module Docs · 7 unmodified lines | ||
| 19 | 19 | html_filters.push 'rust/entries', 'rust/clean_html' |
| 20 | 20 | |
| 21 | 21 | options[:only_patterns] = [ |
| 22 | − /\Abook\/second-edition\//, | |
| 23 | 22 | /\Areference\//, |
| 24 | 23 | /\Acollections\//, |
| 25 | 24 | /\Astd\// ] |
| 26 | 25 | |
| 27 | − options[:skip] = %w(book/second-edition/README.html) | |
| 26 | + options[:skip] = %w(book/README.html) | |
| 28 | 27 | options[:skip_patterns] = [/(?<!\.html)\z/, /\/print\.html/] |
| 29 | 28 | |
| 30 | 29 | options[:fix_urls] = ->(url) do |