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
18 end18 end
19 end19 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 node27 node.parent.replace node
lib/docs/filters/jquery_core/entries.rb+2−1
@@ -8,12 +8,13 @@ module Docs · 7 unmodified lines
8 8
9 def get_name9 def get_name
10 name = at_css('h1').content.strip10 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 name13 name
14 end14 end
15 15
16 def get_type16 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 }
lib/docs/scrapers/jquery/jquery.rb+1−1
@@ -8,7 +8,7 @@ module Docs · 7 unmodified lines
8 options[:title] = false8 options[:title] = false
9 options[:container] = '#content'9 options[:container] = '#content'
10 options[:trailing_slash] = false10 options[:trailing_slash] = false
11 options[:skip_patterns] = [/category/]11 options[:skip_patterns] = [/deprecated/, /category\/version/]
12 12
13 options[:attribution] = <<-HTML13 options[:attribution] = <<-HTML
14 &copy; The jQuery Foundation and other contributors<br>14 &copy; The jQuery Foundation and other contributors<br>
lib/docs/scrapers/jquery/jquery_core.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class JqueryCore < Jquery2 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
lib/docs/scrapers/jquery/jquery_mobile.rb+1−1
@@ -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) do16 options[:fix_urls] = ->(url) do