Unified · Split
Binary file not shown.
Binary file not shown.
| @@ -1,5 +1,8 @@ | ||
| 1 | 1 | [ |
| 2 | 2 | [ |
| 3 | + "2017-11-26", | |
| 4 | + "New documentation: <a href=\"/bluebird/\">Bluebird</a>" | |
| 5 | + ], [ | |
| 3 | 6 | "2017-11-18", |
| 4 | 7 | "Added print & PDF stylesheet.\nFeedback welcome on <a href=\"https://twitter.com/DevDocs\" target=\"_blank\" rel=\"noopener\">Twitter</a> and <a href=\"https://github.com/Thibaut/devdocs\" target=\"_blank\" rel=\"noopener\">GitHub</a>." |
| 5 | 8 | ], [ |
| @@ -112,6 +112,11 @@ credits = [ · 111 unmodified lines | ||
| 112 | 112 | '2010-2016 Jeremy Ashkenas, DocumentCloud', |
| 113 | 113 | 'MIT', |
| 114 | 114 | 'https://raw.githubusercontent.com/jashkenas/backbone/master/LICENSE' |
| 115 | + ], [ | |
| 116 | + 'Bluebird', | |
| 117 | + '2013-2017 Petka Antonov', | |
| 118 | + 'MIT', | |
| 119 | + 'https://raw.githubusercontent.com/petkaantonov/bluebird/master/LICENSE' | |
| 115 | 120 | ], [ |
| 116 | 121 | 'Bootstrap', |
| 117 | 122 | '2011-2017 Twitter, Inc.<br>2011-2017 The Bootstrap Authors', |
| @@ -164,3 +164,4 @@ · 163 unmodified lines | ||
| 164 | 164 | ._icon-nim:before { background-position: -5rem -2rem; @extend %doc-icon-2; @extend %darkIconFix !optional; } |
| 165 | 165 | ._icon-vulkan:before { background-position: -6rem -2rem; @extend %doc-icon-2; @extend %darkIconFix !optional; } |
| 166 | 166 | ._icon-d:before { background-position: -7rem -2rem; @extend %doc-icon-2; } |
| 167 | +._icon-bluebird:before { background-position: -8rem -2rem; @extend %doc-icon-2; } | |
| @@ -2,8 +2,33 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Bluebird |
| 3 | 3 | class CleanHtmlFilter < Filter |
| 4 | 4 | def call |
| 5 | − css('.post-content > p:first').remove | |
| 6 | − css('pre').attr('data-language', 'javascript') | |
| 5 | + @doc = at_css('.post') | |
| 6 | + | |
| 7 | + css('hr').remove | |
| 8 | + | |
| 9 | + css('.api-code-section').each do |node| | |
| 10 | + node.previous_element.remove | |
| 11 | + end | |
| 12 | + | |
| 13 | + css('.post-header', '.post-content', '.api-reference-menu', '.api-code-section', 'markdown', '.highlight', 'code code').each do |node| | |
| 14 | + node.before(node.children).remove | |
| 15 | + end | |
| 16 | + | |
| 17 | + at_css('> h2:first-child').name = 'h1' unless at_css('h1') | |
| 18 | + | |
| 19 | + css('.header-anchor[name]').each do |node| | |
| 20 | + node.parent['id'] = node['name'] | |
| 21 | + end | |
| 22 | + | |
| 23 | + css('pre').each do |node| | |
| 24 | + node.content = node.content | |
| 25 | + node['data-language'] = 'javascript' | |
| 26 | + end | |
| 27 | + | |
| 28 | + css('.info-box').each do |node| | |
| 29 | + node.name = 'blockquote' | |
| 30 | + end | |
| 31 | + | |
| 7 | 32 | doc |
| 8 | 33 | end |
| 9 | 34 | end |
| @@ -26,41 +26,23 @@ module Docs · 25 unmodified lines | ||
| 26 | 26 | done promise.config suppressunhandledrejections |
| 27 | 27 | promise.onpossiblyunhandledrejection promise.bind |
| 28 | 28 | promise.onunhandledrejectionhandled), |
| 29 | − 'Progression migration': %(), | |
| 30 | − 'Deferred migration': %(), | |
| 31 | − 'Environment variables': %(), | |
| 32 | − "Beginner's Guide": %w(), | |
| 33 | − 'Error management configuration': %w(), | |
| 34 | − 'Anti-patterns': %w(), | |
| 35 | − 'Deprecated APIs': %w() | |
| 36 | 29 | } |
| 37 | 30 | |
| 38 | 31 | def get_name |
| 39 | − name = at_css('h1.post-title') | |
| 40 | − if name.nil? | |
| 41 | − name = at_css('.post-content h2') | |
| 42 | − end | |
| 43 | − name.text | |
| 32 | + name = at_css('h1').content.strip | |
| 33 | + name << '()' if doc.to_html.include?("#{name}(") | |
| 34 | + name | |
| 44 | 35 | end |
| 45 | 36 | |
| 46 | 37 | def get_type |
| 47 | − type = nil | |
| 48 | − TYPE_MAP.each do |k,v| | |
| 49 | − if k.to_s.casecmp(name.strip) == 0 | |
| 50 | − type = k | |
| 51 | − break | |
| 52 | − else | |
| 53 | − slug_end = slug.sub(%r(^docs/api/), '') | |
| 54 | − if v.include?(slug_end.downcase) | |
| 55 | − type = k | |
| 56 | − break | |
| 57 | − end | |
| 38 | + if slug.start_with?('api') | |
| 39 | + TYPE_MAP.each do |key, value| | |
| 40 | + return key.to_s if value.include?(slug.remove('api/')) | |
| 58 | 41 | end |
| 42 | + else | |
| 43 | + 'Guides' | |
| 59 | 44 | end |
| 60 | − | |
| 61 | − type.to_s | |
| 62 | 45 | end |
| 63 | − | |
| 64 | 46 | end |
| 65 | 47 | end |
| 66 | 48 | end |
| @@ -1,9 +1,10 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Bluebird < UrlScraper |
| 3 | − self.type = 'bluebird' | |
| 4 | − self.base_url = 'http://bluebirdjs.com' | |
| 5 | − self.root_path = '/docs/api-reference.html' | |
| 6 | − self.release = '3.5.0' | |
| 3 | + self.type = 'simple' | |
| 4 | + self.release = '3.5.1' | |
| 5 | + self.base_url = 'http://bluebirdjs.com/docs/' | |
| 6 | + self.root_path = 'api-reference.html' | |
| 7 | + self.force_gzip = true | |
| 7 | 8 | self.links = { |
| 8 | 9 | home: 'http://bluebirdjs.com/', |
| 9 | 10 | code: 'https://github.com/petkaantonov/bluebird/' |
| @@ -11,10 +12,10 @@ module Docs · 1 unmodified line | ||
| 11 | 12 | |
| 12 | 13 | html_filters.push 'bluebird/clean_html', 'bluebird/entries' |
| 13 | 14 | |
| 14 | − options[:container] = 'body .post' | |
| 15 | + options[:skip] = %w(support.html download-api-reference.html contribute.html) | |
| 15 | 16 | |
| 16 | 17 | options[:attribution] = <<-HTML |
| 17 | − © Petka Antonov<br/> | |
| 18 | + © 2013–2017 Petka Antonov<br> | |
| 18 | 19 | Licensed under the MIT License. |
| 19 | 20 | HTML |
| 20 | 21 | end |
Binary file not shown.
Binary file not shown.