Add Modernizr documentation

pull/165/head
Thibaut 10 years ago
parent 34934b27cb
commit b94113b80e

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 63 KiB

@ -1,6 +1,6 @@
[
[ "2014-12-21",
"New <a href=\"/react/\">React</a>, <a href=\"/rethinkdb/\">RethinkDB</a> and <a href=\"/socketio/\">Socket.IO</a> documentations"
"New <a href=\"/react/\">React</a>, <a href=\"/rethinkdb/\">RethinkDB</a>, <a href=\"/socketio/\">Socket.IO</a> and <a href=\"/modernizr/\">Modernizr</a> documentations"
], [
"2014-11-30",
"New <a href=\"/phpunit/\">PHPUnit</a> and <a href=\"/nokogiri/\">Nokogiri</a> documentations"

@ -208,6 +208,11 @@ credits = [
'2014 MaxCDN',
'MIT',
'https://raw.githubusercontent.com/MaxCDN/api-docs/master/LICENSE'
], [
'Modernizr',
'2009-2014 Modernizr',
'MIT',
'http://modernizr.com/license/'
], [
'Moment.js',
'2011-2014 Tim Wood, Iskren Chernev, Moment.js contributors',

@ -0,0 +1,4 @@
#= require views/pages/base
#= require views/pages/requirejs
app.views.ModernizrPage = app.views.RequirejsPage

@ -49,6 +49,7 @@
'pages/markdown',
'pages/maxcdn',
'pages/mdn',
'pages/modernizr',
'pages/moment',
'pages/mongoose',
'pages/nginx',

@ -147,6 +147,8 @@ td {
+ td { border-left: 1px solid $boxBorderLight; }
tr:last-child > & { border-bottom: 0; }
> pre:last-child, > p:last-child, > ul:last-child, > ol:last-child { margin-bottom: 0; }
}
input {

@ -75,3 +75,4 @@
._icon-rethinkdb:before { background-position: 0 -12rem; }
._icon-react:before { background-position: -1rem -12rem; }
._icon-socketio:before { background-position: -2rem -12rem; }
._icon-modernizr:before { background-position: -3rem -12rem; }

@ -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
&copy; 2009&ndash;2014 Modernizr<br>
Licensed under the MIT License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 118 B

@ -0,0 +1 @@
https://github.com/Modernizr/Modernizr/tree/master/media
Loading…
Cancel
Save