Add Bower documentation

This commit is contained in:
Thibaut 2014-12-21 16:26:33 -05:00
parent 0fc2aacb83
commit 9d47e02cf1
14 changed files with 88 additions and 1 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 65 KiB

View file

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

View file

@ -88,6 +88,11 @@ credits = [
'2010-2014 Jeremy Ashkenas, DocumentCloud',
'MIT',
'https://raw.github.com/jashkenas/backbone/master/LICENSE'
], [
'Bower',
'2014 Bower contributors',
'CC BY',
'https://github.com/bower/bower.github.io/blob/b7b94ad38b72e8fb5dafb20c8ce42835a49cc98f/package.json#L20'
], [
'C<br>C++',
'cppreference.com',

View file

@ -0,0 +1,6 @@
#= require views/pages/base
class app.views.BowerPage extends app.views.BasePage
afterRender: ->
@highlightCode @findAll('pre[data-lang="js"], pre[data-lang="json"]'), 'javascript'
return

View file

@ -29,6 +29,7 @@
'components/mobile';
@import 'pages/angular',
'pages/bower',
'pages/c',
'pages/chai',
'pages/coffeescript',

View file

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

View file

@ -0,0 +1,7 @@
._bower {
h2 { @extend %block-heading; }
h3 { @extend %block-label, %label-blue; }
h4 { @extend %block-label; }
code { @extend %label; }
}

View file

@ -0,0 +1,21 @@
module Docs
class Bower
class CleanHtmlFilter < Filter
def call
title = at_css('.page-title')
@doc = at_css('.main')
doc.child.before(title)
css('.site-footer').remove
css('.highlight').each do |node|
node.name = 'pre'
node['data-lang'] = node.at_css('[data-lang]')['data-lang']
node.content = node.content
end
doc
end
end
end
end

View file

@ -0,0 +1,26 @@
module Docs
class Bower
class EntriesFilter < Docs::EntriesFilter
ENTRIES_TYPE_BY_SLUG = {
'api' => 'Commands',
'config' => '.bowerrc'
}
def get_name
at_css('h1').content
end
def get_type
'Guides'
end
def additional_entries
return [] unless type = ENTRIES_TYPE_BY_SLUG[slug]
css('#bowerrc-specification + ul a', '#commands + p + ul a').map do |node|
[node.content, node['href'].remove('#'), type]
end
end
end
end
end

View file

@ -0,0 +1,19 @@
module Docs
class Bower < UrlScraper
self.name = 'Bower'
self.type = 'bower'
self.version = '1.3.12'
self.base_url = 'http://bower.io/docs/'
self.root_path = 'api'
html_filters.push 'bower/clean_html', 'bower/entries'
options[:trailing_slash] = false
options[:skip] = %w(tools about)
options[:attribution] = <<-HTML
&copy; 2014 Bower contributors<br>
Licensed under the Creative Commons Attribution License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 738 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -0,0 +1 @@
http://bower.io/docs/about/#logo