diff --git a/assets/images/icons.png b/assets/images/icons.png index c3c1203b..2364ed92 100644 Binary files a/assets/images/icons.png and b/assets/images/icons.png differ diff --git a/assets/images/icons@2x.png b/assets/images/icons@2x.png index 8f0eec88..2847dbd1 100644 Binary files a/assets/images/icons@2x.png and b/assets/images/icons@2x.png differ diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index 3fd33883..17105ffe 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,6 +1,6 @@ [ [ "2014-12-21", - "New React, RethinkDB, Socket.IO and Modernizr documentations" + "New React, RethinkDB, Socket.IO, Modernizr and Bower documentations" ], [ "2014-11-30", "New PHPUnit and Nokogiri documentations" diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index f7b57839..a87a235f 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -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
C++', 'cppreference.com', diff --git a/assets/javascripts/views/pages/bower.coffee b/assets/javascripts/views/pages/bower.coffee new file mode 100644 index 00000000..fb411d66 --- /dev/null +++ b/assets/javascripts/views/pages/bower.coffee @@ -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 diff --git a/assets/stylesheets/application.css.scss b/assets/stylesheets/application.css.scss index efce2ff9..5f4f0d48 100644 --- a/assets/stylesheets/application.css.scss +++ b/assets/stylesheets/application.css.scss @@ -29,6 +29,7 @@ 'components/mobile'; @import 'pages/angular', + 'pages/bower', 'pages/c', 'pages/chai', 'pages/coffeescript', diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index e5558653..d3a28521 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -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; } diff --git a/assets/stylesheets/pages/_bower.scss b/assets/stylesheets/pages/_bower.scss new file mode 100644 index 00000000..538f093b --- /dev/null +++ b/assets/stylesheets/pages/_bower.scss @@ -0,0 +1,7 @@ +._bower { + h2 { @extend %block-heading; } + h3 { @extend %block-label, %label-blue; } + h4 { @extend %block-label; } + + code { @extend %label; } +} diff --git a/lib/docs/filters/bower/clean_html.rb b/lib/docs/filters/bower/clean_html.rb new file mode 100644 index 00000000..eda05f51 --- /dev/null +++ b/lib/docs/filters/bower/clean_html.rb @@ -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 diff --git a/lib/docs/filters/bower/entries.rb b/lib/docs/filters/bower/entries.rb new file mode 100644 index 00000000..9405df52 --- /dev/null +++ b/lib/docs/filters/bower/entries.rb @@ -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 diff --git a/lib/docs/scrapers/bower.rb b/lib/docs/scrapers/bower.rb new file mode 100644 index 00000000..f5452743 --- /dev/null +++ b/lib/docs/scrapers/bower.rb @@ -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
+ Licensed under the Creative Commons Attribution License. + HTML + end +end diff --git a/public/icons/docs/bower/16.png b/public/icons/docs/bower/16.png new file mode 100644 index 00000000..d6856e76 Binary files /dev/null and b/public/icons/docs/bower/16.png differ diff --git a/public/icons/docs/bower/16@2x.png b/public/icons/docs/bower/16@2x.png new file mode 100644 index 00000000..21c7a475 Binary files /dev/null and b/public/icons/docs/bower/16@2x.png differ diff --git a/public/icons/docs/bower/SOURCE b/public/icons/docs/bower/SOURCE new file mode 100644 index 00000000..aa2dee51 --- /dev/null +++ b/public/icons/docs/bower/SOURCE @@ -0,0 +1 @@ +http://bower.io/docs/about/#logo