diff --git a/lib/docs/filters/eslint/clean_html.rb b/lib/docs/filters/eslint/clean_html.rb new file mode 100644 index 00000000..b5225038 --- /dev/null +++ b/lib/docs/filters/eslint/clean_html.rb @@ -0,0 +1,10 @@ +module Docs + class Eslint + class CleanHtmlFilter < Filter + def call + @doc = at_css('.doc') if at_css('.doc') + doc + end + end + end +end diff --git a/lib/docs/filters/eslint/entries.rb b/lib/docs/filters/eslint/entries.rb new file mode 100644 index 00000000..c8451bf2 --- /dev/null +++ b/lib/docs/filters/eslint/entries.rb @@ -0,0 +1,25 @@ +module Docs + class Eslint + class EntriesFilter < Docs::EntriesFilter + def get_name + at_css('h1').content + end + + def get_type + if subpath.start_with?('docs/developer-guide/') + type = 'Developer Guide' + elsif subpath.start_with?('docs/user-guide/') + type = 'User Guide' + elsif subpath.start_with?('docs/rules') + type = 'Rules' + elsif subpath.start_with?('docs/about') + type = 'User Guide' + else + type = nil + end + type + end + + end + end +end diff --git a/lib/docs/scrapers/eslint.rb b/lib/docs/scrapers/eslint.rb new file mode 100644 index 00000000..d0a3f636 --- /dev/null +++ b/lib/docs/scrapers/eslint.rb @@ -0,0 +1,25 @@ +module Docs + class Eslint < UrlScraper + self.name = 'ESLint' + self.type = 'eslint' + self.release = '4.9.0' + self.base_url = 'https://eslint.org/' + self.root_path = 'docs/user-guide/getting-started' + + self.links = { + home: 'https://eslint.org/', + code: 'https://github.com/eslint/eslint' + } + + html_filters.push 'eslint/entries', 'eslint/clean_html' + + options[:container] = 'body' + + options[:skip_patterns] = [/\Ablog/, /\Ademo/, /\Aparser/, /formatters\//] + + options[:attribution] = <<-HTML + © Copyright JS Foundation and other contributors, https://js.foundation/
+ Licensed under the MIT License. + HTML + end +end diff --git a/public/icons/docs/eslint/16.png b/public/icons/docs/eslint/16.png new file mode 100644 index 00000000..10e1edb0 Binary files /dev/null and b/public/icons/docs/eslint/16.png differ diff --git a/public/icons/docs/eslint/16@2x.png b/public/icons/docs/eslint/16@2x.png new file mode 100644 index 00000000..463fc610 Binary files /dev/null and b/public/icons/docs/eslint/16@2x.png differ diff --git a/public/icons/docs/eslint/SOURCE. b/public/icons/docs/eslint/SOURCE. new file mode 100644 index 00000000..dd535a89 --- /dev/null +++ b/public/icons/docs/eslint/SOURCE. @@ -0,0 +1,17 @@ + + + + + + + + +