diff --git a/lib/docs/filters/brew/clean_html.rb b/lib/docs/filters/brew/clean_html.rb new file mode 100644 index 00000000..59b893d7 --- /dev/null +++ b/lib/docs/filters/brew/clean_html.rb @@ -0,0 +1,9 @@ +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 new file mode 100644 index 00000000..fdfdfd2b --- /dev/null +++ b/lib/docs/filters/brew/entries.rb @@ -0,0 +1,14 @@ +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/scrapers/brew.rb b/lib/docs/scrapers/brew.rb new file mode 100644 index 00000000..ac3cc3e5 --- /dev/null +++ b/lib/docs/scrapers/brew.rb @@ -0,0 +1,22 @@ +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/public/icons/docs/brew/16.png b/public/icons/docs/brew/16.png new file mode 100644 index 00000000..0f58b0a1 Binary files /dev/null and b/public/icons/docs/brew/16.png differ diff --git a/public/icons/docs/brew/16@2x.png b/public/icons/docs/brew/16@2x.png new file mode 100644 index 00000000..e70d82b9 Binary files /dev/null and b/public/icons/docs/brew/16@2x.png differ diff --git a/public/icons/docs/brew/SOURCE b/public/icons/docs/brew/SOURCE new file mode 100644 index 00000000..85aa2a14 Binary files /dev/null and b/public/icons/docs/brew/SOURCE differ