Closes #548.
Unified · Split
| @@ -18,6 +18,10 @@ module Docs · 17 unmodified lines | |||
| 18 | end | 18 | end |
| 19 | end | 19 | end |
| 20 | 20 | ||
| 21 | css('.page-header', 'h1 span').each do |node| | ||
| 22 | node.before(node.children).remove | ||
| 23 | end | ||
| 24 | |||
| 21 | # Remove useless <header> | 25 | # Remove useless <header> |
| 22 | css('.entry-header > .entry-title', 'header > .underline', 'header > h2:only-child').to_a.uniq.each do |node| | 26 | css('.entry-header > .entry-title', 'header > .underline', 'header > h2:only-child').to_a.uniq.each do |node| |
| 23 | node.parent.replace node | 27 | node.parent.replace node |
| @@ -8,12 +8,13 @@ module Docs · 7 unmodified lines | |||
| 8 | 8 | ||
| 9 | def get_name | 9 | def get_name |
| 10 | name = at_css('h1').content.strip | 10 | name = at_css('h1').content.strip |
| 11 | name.gsub!(/ [A-Z]/) { |str| str.downcase! } | 11 | name.gsub!(/ [A-Z]/) { |str| str.downcase! } unless name.start_with?('Category') |
| 12 | name.gsub! %r{[“”]}, '"' | 12 | name.gsub! %r{[“”]}, '"' |
| 13 | name | 13 | name |
| 14 | end | 14 | end |
| 15 | 15 | ||
| 16 | def get_type | 16 | def get_type |
| 17 | return 'Categories' if slug.start_with?('category') | ||
| 17 | return 'Ajax' if slug == 'Ajax_Events' | 18 | return 'Ajax' if slug == 'Ajax_Events' |
| 18 | categories = css 'span.category' | 19 | categories = css 'span.category' |
| 19 | types = categories.map { |node| node.at_css('a').content.strip } | 20 | types = categories.map { |node| node.at_css('a').content.strip } |
| @@ -8,7 +8,7 @@ module Docs · 7 unmodified lines | |||
| 8 | options[:title] = false | 8 | options[:title] = false |
| 9 | options[:container] = '#content' | 9 | options[:container] = '#content' |
| 10 | options[:trailing_slash] = false | 10 | options[:trailing_slash] = false |
| 11 | options[:skip_patterns] = [/category/] | 11 | options[:skip_patterns] = [/deprecated/, /category\/version/] |
| 12 | 12 | ||
| 13 | options[:attribution] = <<-HTML | 13 | options[:attribution] = <<-HTML |
| 14 | © The jQuery Foundation and other contributors<br> | 14 | © The jQuery Foundation and other contributors<br> |
| @@ -1,7 +1,7 @@ | |||
| 1 | module Docs | 1 | module Docs |
| 2 | class JqueryCore < Jquery | 2 | class JqueryCore < Jquery |
| 3 | self.name = 'jQuery' | 3 | self.name = 'jQuery' |
| 4 | self.release = 'up to 3.1.1' | 4 | self.release = 'up to 3.2.1' |
| 5 | self.base_url = 'https://api.jquery.com/' | 5 | self.base_url = 'https://api.jquery.com/' |
| 6 | self.initial_paths = %w(/index/index) | 6 | self.initial_paths = %w(/index/index) |
| 7 | 7 | ||
| @@ -10,7 +10,7 @@ module Docs · 9 unmodified lines | |||
| 10 | 10 | ||
| 11 | options[:root_title] = 'jQuery Mobile' | 11 | options[:root_title] = 'jQuery Mobile' |
| 12 | options[:skip] = %w(/tabs /theme) | 12 | options[:skip] = %w(/tabs /theme) |
| 13 | options[:skip_patterns].concat [/\A\/icons/, /cdn-cgi/i] | 13 | options[:skip_patterns] += [/\A\/icons/, /cdn-cgi/i] |
| 14 | options[:replace_paths] = { '/select/' => '/selectmenu' } | 14 | options[:replace_paths] = { '/select/' => '/selectmenu' } |
| 15 | 15 | ||
| 16 | options[:fix_urls] = ->(url) do | 16 | options[:fix_urls] = ->(url) do |