History

Update jQuery documentation (3.2.1)

Closes #548.

Thibaut Courouble committed 9 years ago

Commit ad5b6db1 parent 2fe374a5 files · +9 −4Browse files

Unified · Split

5 files
  1. lib/docs/filters/jquery/clean_html.rb +4 −0
  2. lib/docs/filters/jquery_core/entries.rb +2 −1
  3. lib/docs/scrapers/jquery/jquery.rb +1 −1
  4. lib/docs/scrapers/jquery/jquery_core.rb +1 −1
  5. lib/docs/scrapers/jquery/jquery_mobile.rb +1 −1
lib/docs/filters/jquery/clean_html.rb+4−0
@@ -18,6 +18,10 @@ module Docs · 17 unmodified lines
1818 end
1919 end
2020
21+ css('.page-header', 'h1 span').each do |node|
22+ node.before(node.children).remove
23+ end
24+
2125 # Remove useless <header>
2226 css('.entry-header > .entry-title', 'header > .underline', 'header > h2:only-child').to_a.uniq.each do |node|
2327 node.parent.replace node
lib/docs/filters/jquery_core/entries.rb+2−1
@@ -8,12 +8,13 @@ module Docs · 7 unmodified lines
88
99 def get_name
1010 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')
1212 name.gsub! %r{[“”]}, '"'
1313 name
1414 end
1515
1616 def get_type
17+ return 'Categories' if slug.start_with?('category')
1718 return 'Ajax' if slug == 'Ajax_Events'
1819 categories = css 'span.category'
1920 types = categories.map { |node| node.at_css('a').content.strip }
lib/docs/scrapers/jquery/jquery.rb+1−1
@@ -8,7 +8,7 @@ module Docs · 7 unmodified lines
88 options[:title] = false
99 options[:container] = '#content'
1010 options[:trailing_slash] = false
11− options[:skip_patterns] = [/category/]
11+ options[:skip_patterns] = [/deprecated/, /category\/version/]
1212
1313 options[:attribution] = <<-HTML
1414 &copy; The jQuery Foundation and other contributors<br>
lib/docs/scrapers/jquery/jquery_core.rb+1−1
@@ -1,7 +1,7 @@
11 module Docs
22 class JqueryCore < Jquery
33 self.name = 'jQuery'
4− self.release = 'up to 3.1.1'
4+ self.release = 'up to 3.2.1'
55 self.base_url = 'https://api.jquery.com/'
66 self.initial_paths = %w(/index/index)
77
lib/docs/scrapers/jquery/jquery_mobile.rb+1−1
@@ -10,7 +10,7 @@ module Docs · 9 unmodified lines
1010
1111 options[:root_title] = 'jQuery Mobile'
1212 options[:skip] = %w(/tabs /theme)
13− options[:skip_patterns].concat [/\A\/icons/, /cdn-cgi/i]
13+ options[:skip_patterns] += [/\A\/icons/, /cdn-cgi/i]
1414 options[:replace_paths] = { '/select/' => '/selectmenu' }
1515
1616 options[:fix_urls] = ->(url) do