mirror of https://github.com/freeCodeCamp/devdocs
parent
34934b27cb
commit
b94113b80e
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 63 KiB |
@ -0,0 +1,4 @@
|
||||
#= require views/pages/base
|
||||
#= require views/pages/requirejs
|
||||
|
||||
app.views.ModernizrPage = app.views.RequirejsPage
|
@ -0,0 +1,8 @@
|
||||
._modernizr {
|
||||
h2 { @extend %block-heading; }
|
||||
h3 { @extend %block-label, %label-blue; }
|
||||
h4 { font-size: 1em; }
|
||||
|
||||
code { @extend %label; }
|
||||
blockquote { @extend %note; }
|
||||
}
|
@ -0,0 +1,21 @@
|
||||
module Docs
|
||||
class Modernizr
|
||||
class CleanHtmlFilter < Filter
|
||||
def call
|
||||
css('pre').each do |node|
|
||||
node.content = node.content
|
||||
end
|
||||
|
||||
css('> div', '> section').each do |node|
|
||||
node.before(node.children).remove
|
||||
end
|
||||
|
||||
css('h3, h4').each do |node|
|
||||
node.name = node.name.sub(/\d/) { |i| i.to_i - 1 }
|
||||
end
|
||||
|
||||
doc
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,36 @@
|
||||
module Docs
|
||||
class Modernizr
|
||||
class EntriesFilter < Docs::EntriesFilter
|
||||
def additional_entries
|
||||
entries = []
|
||||
|
||||
css('h3[id]').each do |node|
|
||||
next unless name = node.content.strip[/\AModernizr\.\w+\(\)/]
|
||||
entries << [name, node['id'], 'Modernizr']
|
||||
end
|
||||
|
||||
css('section[id]').each do |node|
|
||||
next unless heading = node.at_css('h3')
|
||||
next unless name = heading.content.strip[/\A(Modernizr\.)?\w+\(\)/]
|
||||
|
||||
heading['id'] = node['id']
|
||||
node.remove_attribute('id')
|
||||
|
||||
name.prepend('Modernizr.') unless name.start_with?('Modernizr')
|
||||
entries << [name, heading['id'], 'Modernizr']
|
||||
end
|
||||
|
||||
css('h4[id^="features-"] + table').each do |table|
|
||||
type = table.previous_element.content.strip
|
||||
type << ' features' unless type.end_with?('features')
|
||||
|
||||
table.css('tbody th[id]').each do |node|
|
||||
entries << [node.content, node['id'], type]
|
||||
end
|
||||
end
|
||||
|
||||
entries
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,19 @@
|
||||
module Docs
|
||||
class Modernizr < UrlScraper
|
||||
self.name = 'Modernizr'
|
||||
self.type = 'modernizr'
|
||||
self.version = '2.8.3'
|
||||
self.base_url = 'http://modernizr.com/docs/'
|
||||
|
||||
html_filters.push 'modernizr/entries', 'modernizr/clean_html', 'title'
|
||||
|
||||
options[:title] = 'Modernizr'
|
||||
options[:container] = '#documentation'
|
||||
options[:skip_links] = true
|
||||
|
||||
options[:attribution] = <<-HTML
|
||||
© 2009–2014 Modernizr<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 100 B |
After Width: | Height: | Size: 118 B |
@ -0,0 +1 @@
|
||||
https://github.com/Modernizr/Modernizr/tree/master/media
|
Loading…
Reference in new issue