diff --git a/assets/images/docs-2.png b/assets/images/docs-2.png index f60694b4..cee86d69 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 734e3147..e236cbdc 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 b99986f7..c93f8ed9 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,7 +1,7 @@ [ [ "2017-11-26", - "New documentations: Bluebird and ESLint" + "New documentations: Bluebird, ESLint and Homebrew" ], [ "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 9156cb82..8dfd77ef 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -302,6 +302,11 @@ credits = [ '2005-2016 Haxe Foundation', 'MIT', 'http://haxe.org/foundation/open-source.html' + ], [ + 'Homebrew', + '2009-present Homebrew contributors', + 'BSD', + 'https://raw.githubusercontent.com/Homebrew/brew/master/LICENSE.txt' ], [ 'Immutable.js', '2014-2016 Facebook, Inc.', diff --git a/assets/stylesheets/global/_icons.scss b/assets/stylesheets/global/_icons.scss index 26ed1cab..b4b433f1 100644 --- a/assets/stylesheets/global/_icons.scss +++ b/assets/stylesheets/global/_icons.scss @@ -166,3 +166,4 @@ ._icon-d:before { background-position: -7rem -2rem; @extend %doc-icon-2; } ._icon-bluebird:before { background-position: -8rem -2rem; @extend %doc-icon-2; } ._icon-eslint:before { background-position: -9rem -2rem; @extend %doc-icon-2; } +._icon-homebrew:before { background-position: 0 -3rem; @extend %doc-icon-2; } diff --git a/lib/docs/filters/brew/clean_html.rb b/lib/docs/filters/brew/clean_html.rb deleted file mode 100644 index 59b893d7..00000000 --- a/lib/docs/filters/brew/clean_html.rb +++ /dev/null @@ -1,9 +0,0 @@ -module Docs - class Brew - class CleanHtmlFilter < Filter - def call - doc - end - end - end -end diff --git a/lib/docs/filters/brew/entries.rb b/lib/docs/filters/brew/entries.rb deleted file mode 100644 index fdfdfd2b..00000000 --- a/lib/docs/filters/brew/entries.rb +++ /dev/null @@ -1,14 +0,0 @@ -module Docs - class Brew - class EntriesFilter < Docs::EntriesFilter - def get_name - at_css('h1').content - end - - def get_type - name - end - - end - end -end diff --git a/lib/docs/filters/homebrew/clean_html.rb b/lib/docs/filters/homebrew/clean_html.rb new file mode 100644 index 00000000..5bf6aa29 --- /dev/null +++ b/lib/docs/filters/homebrew/clean_html.rb @@ -0,0 +1,19 @@ +module Docs + class Homebrew + class CleanHtmlFilter < Filter + def call + css('hr') + + css('div.highlighter-rouge').each do |node| + lang = node['class'][/language-(\w+)/, 1] + node['data-language'] = lang if lang + node.content = node.content.strip + node.name = 'pre' + node.remove_attribute('class') + end + + doc + end + end + end +end diff --git a/lib/docs/filters/homebrew/entries.rb b/lib/docs/filters/homebrew/entries.rb new file mode 100644 index 00000000..03650ad9 --- /dev/null +++ b/lib/docs/filters/homebrew/entries.rb @@ -0,0 +1,32 @@ +module Docs + class Homebrew + class EntriesFilter < Docs::EntriesFilter + def get_name + name = at_css('h1').content.strip + name.remove! %r{\(.*} + name + end + + CONTRIBUTOR_SLUGS = %w( + How-To-Open-a-Homebrew-Pull-Request + Formula-Cookbook + Acceptable-Formulae + Versions + Node-for-Formula-Authors + Python-for-Formula-Authors + Migrating-A-Formula-To-A-Tap + Rename-A-Formula + How-to-Create-and-Maintain-a-Tap + Brew-Test-Bot + Prose-Style-Guidelines) + + def get_type + if CONTRIBUTOR_SLUGS.include?(slug) + 'Contributors' + else + 'Users' + end + end + end + end +end diff --git a/lib/docs/scrapers/brew.rb b/lib/docs/scrapers/brew.rb deleted file mode 100644 index ac3cc3e5..00000000 --- a/lib/docs/scrapers/brew.rb +++ /dev/null @@ -1,22 +0,0 @@ -module Docs - class Brew < UrlScraper - self.name = 'Homebrew' - self.type = 'brew' - self.release = '1.3.6' - self.base_url = 'https://docs.brew.sh' - self.root_path = '/' - self.links = { - home: 'https://brew.sh', - code: 'https://github.com/Homebrew/brew' - } - - options[:container] = ->(filter) { filter.root_page? ? '#home' : '#page' } - - html_filters.push 'brew/entries', 'brew/clean_html' - - options[:attribution] = <<-HTML - Homebrew was created by Max Howell.
- Licensed under the BSD 2-Clause License. - HTML - end -end diff --git a/lib/docs/scrapers/homebrew.rb b/lib/docs/scrapers/homebrew.rb new file mode 100644 index 00000000..0298dd9b --- /dev/null +++ b/lib/docs/scrapers/homebrew.rb @@ -0,0 +1,24 @@ +module Docs + class Homebrew < UrlScraper + self.name = 'Homebrew' + self.type = 'simple' + self.release = '1.3.6' + self.base_url = 'https://docs.brew.sh/' + self.links = { + home: 'https://brew.sh', + code: 'https://github.com/Homebrew/brew' + } + + html_filters.push 'homebrew/entries', 'homebrew/clean_html' + + options[:container] = ->(filter) { filter.root_page? ? '#home' : '#page' } + + options[:skip_patterns] = [/maintainer/i, /core\-contributor/i] + options[:skip] = %w(Kickstarter-Supporters.html) + + options[:attribution] = <<-HTML + © 2009–present Homebrew contributors
+ Licensed under the BSD 2-Clause License. + HTML + end +end diff --git a/public/icons/docs/brew/16.png b/public/icons/docs/brew/16.png deleted file mode 100644 index 0f58b0a1..00000000 Binary files a/public/icons/docs/brew/16.png and /dev/null differ diff --git a/public/icons/docs/brew/16@2x.png b/public/icons/docs/brew/16@2x.png deleted file mode 100644 index e70d82b9..00000000 Binary files a/public/icons/docs/brew/16@2x.png and /dev/null differ diff --git a/public/icons/docs/brew/SOURCE b/public/icons/docs/brew/SOURCE deleted file mode 100644 index 85aa2a14..00000000 Binary files a/public/icons/docs/brew/SOURCE and /dev/null differ diff --git a/public/icons/docs/homebrew/16.png b/public/icons/docs/homebrew/16.png new file mode 100644 index 00000000..833e457c Binary files /dev/null and b/public/icons/docs/homebrew/16.png differ diff --git a/public/icons/docs/homebrew/16@2x.png b/public/icons/docs/homebrew/16@2x.png new file mode 100644 index 00000000..3128178e Binary files /dev/null and b/public/icons/docs/homebrew/16@2x.png differ diff --git a/public/icons/docs/homebrew/SOURCE b/public/icons/docs/homebrew/SOURCE new file mode 100644 index 00000000..f7c36907 --- /dev/null +++ b/public/icons/docs/homebrew/SOURCE @@ -0,0 +1 @@ +https://github.com/Homebrew/brew/tree/master/docs/img \ No newline at end of file