mirror of https://github.com/freeCodeCamp/devdocs
parent
0379d4910a
commit
9fdaf078bd
@ -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
|
@ -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
|
@ -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/<br>
|
||||
Licensed under the MIT License.
|
||||
HTML
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 505 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
Loading…
Reference in new issue