Unified · Split
| @@ -6,12 +6,12 @@ module Docs · 5 unmodified lines | ||
| 6 | 6 | node.content = node.content |
| 7 | 7 | end |
| 8 | 8 | |
| 9 | − css('> div', '> section').each do |node| | |
| 9 | + css('sub').each do |node| | |
| 10 | 10 | node.before(node.children).remove |
| 11 | 11 | end |
| 12 | 12 | |
| 13 | − css('h3, h4').each do |node| | |
| 14 | − node.name = node.name.sub(/\d/) { |i| i.to_i - 1 } | |
| 13 | + css('td:nth-child(2)').each do |node| | |
| 14 | + node.name = node.previous_element.name = 'th' | |
| 15 | 15 | end |
| 16 | 16 | |
| 17 | 17 | doc |
| @@ -5,27 +5,14 @@ module Docs · 4 unmodified lines | ||
| 5 | 5 | entries = [] |
| 6 | 6 | |
| 7 | 7 | css('h3[id]').each do |node| |
| 8 | − next unless name = node.content.strip[/\AModernizr\.\w+\(\)/] | |
| 8 | + next unless name = node.content.strip[/\AModernizr\..+/] | |
| 9 | 9 | entries << [name, node['id'], 'Modernizr'] |
| 10 | 10 | end |
| 11 | 11 | |
| 12 | − css('section[id]').each do |node| | |
| 13 | − next unless heading = node.at_css('h3') | |
| 14 | − next unless name = heading.content.strip[/\A(Modernizr\.)?\w+\(\)/] | |
| 15 | − | |
| 16 | − heading['id'] = node['id'] | |
| 17 | − node.remove_attribute('id') | |
| 18 | − | |
| 19 | − name.prepend('Modernizr.') unless name.start_with?('Modernizr') | |
| 20 | − entries << [name, heading['id'], 'Modernizr'] | |
| 21 | − end | |
| 22 | − | |
| 23 | − css('h4[id^="features-"] + table').each do |table| | |
| 24 | − type = table.previous_element.content.strip | |
| 25 | − type << ' features' unless type.end_with?('features') | |
| 26 | − | |
| 27 | − table.css('tbody th[id]').each do |node| | |
| 28 | − entries << [node.content, node['id'], type] | |
| 12 | + css('h2[id="features"] + table td:nth-child(2) b').each do |node| | |
| 13 | + node['id'] = node.content.parameterize | |
| 14 | + node.content.split(',').each do |name| | |
| 15 | + entries << [name, node['id'], 'Features'] | |
| 29 | 16 | end |
| 30 | 17 | end |
| 31 | 18 | |
| @@ -2,17 +2,17 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Modernizr < UrlScraper |
| 3 | 3 | self.name = 'Modernizr' |
| 4 | 4 | self.type = 'modernizr' |
| 5 | − self.version = '2.8.3' | |
| 6 | − self.base_url = 'http://modernizr.com/docs/' | |
| 5 | + self.version = '3.1.0' | |
| 6 | + self.base_url = 'https://modernizr.com/docs/' | |
| 7 | 7 | |
| 8 | 8 | html_filters.push 'modernizr/entries', 'modernizr/clean_html', 'title' |
| 9 | 9 | |
| 10 | 10 | options[:title] = 'Modernizr' |
| 11 | − options[:container] = '#documentation' | |
| 11 | + options[:container] = '#main' | |
| 12 | 12 | options[:skip_links] = true |
| 13 | 13 | |
| 14 | 14 | options[:attribution] = <<-HTML |
| 15 | − © 2009–2014 Modernizr<br> | |
| 15 | + © 2009–2015 Modernizr<br> | |
| 16 | 16 | Licensed under the MIT License. |
| 17 | 17 | HTML |
| 18 | 18 | end |