diff --git a/assets/images/docs-2.png b/assets/images/docs-2.png index 0aa1a105..6ef8e809 100644 Binary files a/assets/images/docs-2.png and b/assets/images/docs-2.png differ diff --git a/assets/images/docs-2@2x.png b/assets/images/docs-2@2x.png index e6e018aa..e79cbd68 100644 Binary files a/assets/images/docs-2@2x.png and b/assets/images/docs-2@2x.png differ diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index dd82e94b..17376fc0 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,5 +1,8 @@ [ [ + "2017-11-26", + "New documentation: Bluebird" + ], [ "2017-11-18", "Added print & PDF stylesheet.\nFeedback welcome on Twitter and GitHub." ], [ diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 40b96136..85cc62ea 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -112,6 +112,11 @@ credits = [ '2010-2016 Jeremy Ashkenas, DocumentCloud', 'MIT', 'https://raw.githubusercontent.com/jashkenas/backbone/master/LICENSE' + ], [ + 'Bluebird', + '2013-2017 Petka Antonov', + 'MIT', + 'https://raw.githubusercontent.com/petkaantonov/bluebird/master/LICENSE' ], [ 'Bootstrap', '2011-2017 Twitter, Inc.
2011-2017 The Bootstrap Authors', diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index fffc7e25..0f8c2aed 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -164,3 +164,4 @@ ._icon-nim:before { background-position: -5rem -2rem; @extend %doc-icon-2; @extend %darkIconFix !optional; } ._icon-vulkan:before { background-position: -6rem -2rem; @extend %doc-icon-2; @extend %darkIconFix !optional; } ._icon-d:before { background-position: -7rem -2rem; @extend %doc-icon-2; } +._icon-bluebird:before { background-position: -8rem -2rem; @extend %doc-icon-2; } diff --git a/lib/docs/filters/bluebird/clean_html.rb b/lib/docs/filters/bluebird/clean_html.rb index 92f10b41..6580a6aa 100644 --- a/lib/docs/filters/bluebird/clean_html.rb +++ b/lib/docs/filters/bluebird/clean_html.rb @@ -2,8 +2,33 @@ module Docs class Bluebird class CleanHtmlFilter < Filter def call - css('.post-content > p:first').remove - css('pre').attr('data-language', 'javascript') + @doc = at_css('.post') + + css('hr').remove + + css('.api-code-section').each do |node| + node.previous_element.remove + end + + css('.post-header', '.post-content', '.api-reference-menu', '.api-code-section', 'markdown', '.highlight', 'code code').each do |node| + node.before(node.children).remove + end + + at_css('> h2:first-child').name = 'h1' unless at_css('h1') + + css('.header-anchor[name]').each do |node| + node.parent['id'] = node['name'] + end + + css('pre').each do |node| + node.content = node.content + node['data-language'] = 'javascript' + end + + css('.info-box').each do |node| + node.name = 'blockquote' + end + doc end end diff --git a/lib/docs/filters/bluebird/entries.rb b/lib/docs/filters/bluebird/entries.rb index bebae289..522e4db4 100644 --- a/lib/docs/filters/bluebird/entries.rb +++ b/lib/docs/filters/bluebird/entries.rb @@ -26,41 +26,23 @@ module Docs done promise.config suppressunhandledrejections promise.onpossiblyunhandledrejection promise.bind promise.onunhandledrejectionhandled), - 'Progression migration': %(), - 'Deferred migration': %(), - 'Environment variables': %(), - "Beginner's Guide": %w(), - 'Error management configuration': %w(), - 'Anti-patterns': %w(), - 'Deprecated APIs': %w() } def get_name - name = at_css('h1.post-title') - if name.nil? - name = at_css('.post-content h2') - end - name.text + name = at_css('h1').content.strip + name << '()' if doc.to_html.include?("#{name}(") + name end def get_type - type = nil - TYPE_MAP.each do |k,v| - if k.to_s.casecmp(name.strip) == 0 - type = k - break - else - slug_end = slug.sub(%r(^docs/api/), '') - if v.include?(slug_end.downcase) - type = k - break - end + if slug.start_with?('api') + TYPE_MAP.each do |key, value| + return key.to_s if value.include?(slug.remove('api/')) end + else + 'Guides' end - - type.to_s end - end end end diff --git a/lib/docs/scrapers/bluebird.rb b/lib/docs/scrapers/bluebird.rb index bfa96a03..e5cd6b59 100644 --- a/lib/docs/scrapers/bluebird.rb +++ b/lib/docs/scrapers/bluebird.rb @@ -1,9 +1,10 @@ module Docs class Bluebird < UrlScraper - self.type = 'bluebird' - self.base_url = 'http://bluebirdjs.com' - self.root_path = '/docs/api-reference.html' - self.release = '3.5.0' + self.type = 'simple' + self.release = '3.5.1' + self.base_url = 'http://bluebirdjs.com/docs/' + self.root_path = 'api-reference.html' + self.force_gzip = true self.links = { home: 'http://bluebirdjs.com/', code: 'https://github.com/petkaantonov/bluebird/' @@ -11,10 +12,10 @@ module Docs html_filters.push 'bluebird/clean_html', 'bluebird/entries' - options[:container] = 'body .post' + options[:skip] = %w(support.html download-api-reference.html contribute.html) options[:attribution] = <<-HTML - © Petka Antonov
+ © 2013–2017 Petka Antonov
Licensed under the MIT License. HTML end diff --git a/public/icons/docs/bluebird/16.png b/public/icons/docs/bluebird/16.png index 5bbe4d72..cdbe752b 100644 Binary files a/public/icons/docs/bluebird/16.png and b/public/icons/docs/bluebird/16.png differ diff --git a/public/icons/docs/bluebird/16@2x.png b/public/icons/docs/bluebird/16@2x.png index cad3315b..9ffae075 100644 Binary files a/public/icons/docs/bluebird/16@2x.png and b/public/icons/docs/bluebird/16@2x.png differ