mirror of
https://github.com/freeCodeCamp/devdocs
synced 2024-11-16 19:48:10 +01:00
Add Bower documentation
This commit is contained in:
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 |
|
@ -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"
|
||||
|
|
|
@ -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',
|
||||
|
|
6
assets/javascripts/views/pages/bower.coffee
Normal file
6
assets/javascripts/views/pages/bower.coffee
Normal 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
|
|
@ -29,6 +29,7 @@
|
|||
'components/mobile';
|
||||
|
||||
@import 'pages/angular',
|
||||
'pages/bower',
|
||||
'pages/c',
|
||||
'pages/chai',
|
||||
'pages/coffeescript',
|
||||
|
|
|
@ -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; }
|
||||
|
|
7
assets/stylesheets/pages/_bower.scss
Normal file
7
assets/stylesheets/pages/_bower.scss
Normal file
|
@ -0,0 +1,7 @@
|
|||
._bower {
|
||||
h2 { @extend %block-heading; }
|
||||
h3 { @extend %block-label, %label-blue; }
|
||||
h4 { @extend %block-label; }
|
||||
|
||||
code { @extend %label; }
|
||||
}
|
21
lib/docs/filters/bower/clean_html.rb
Normal file
21
lib/docs/filters/bower/clean_html.rb
Normal 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
|
26
lib/docs/filters/bower/entries.rb
Normal file
26
lib/docs/filters/bower/entries.rb
Normal 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
|
19
lib/docs/scrapers/bower.rb
Normal file
19
lib/docs/scrapers/bower.rb
Normal 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
|
||||
© 2014 Bower contributors<br>
|
||||
Licensed under the Creative Commons Attribution License.
|
||||
HTML
|
||||
end
|
||||
end
|
BIN
public/icons/docs/bower/16.png
Normal file
BIN
public/icons/docs/bower/16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 738 B |
BIN
public/icons/docs/bower/16@2x.png
Normal file
BIN
public/icons/docs/bower/16@2x.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.9 KiB |
1
public/icons/docs/bower/SOURCE
Normal file
1
public/icons/docs/bower/SOURCE
Normal file
|
@ -0,0 +1 @@
|
|||
http://bower.io/docs/about/#logo
|
Loading…
Reference in a new issue