add eslint doc (4.9.0)

This commit is contained in:
Cyril Lakech 2017-10-23 23:03:37 +02:00 committed by Thibaut Courouble
parent 0379d4910a
commit 9fdaf078bd
6 changed files with 77 additions and 0 deletions

View file

@ -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

View file

@ -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

View file

@ -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
&copy; Copyright JS Foundation and other contributors, https://js.foundation/<br>
Licensed under the MIT License.
HTML
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 505 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 15.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 294.825 258.982"
xml:space="preserve">
<g>
<path fill="#8080F2" d="M97.021,99.016l48.432-27.962c1.212-0.7,2.706-0.7,3.918,0l48.433,27.962
c1.211,0.7,1.959,1.993,1.959,3.393v55.924c0,1.399-0.748,2.693-1.959,3.394l-48.433,27.962c-1.212,0.7-2.706,0.7-3.918,0
l-48.432-27.962c-1.212-0.7-1.959-1.994-1.959-3.394v-55.924C95.063,101.009,95.81,99.716,97.021,99.016"/>
<path fill="#4B32C3" d="M273.336,124.488L215.469,23.816c-2.102-3.64-5.985-6.325-10.188-6.325H89.545
c-4.204,0-8.088,2.685-10.19,6.325l-57.867,100.45c-2.102,3.641-2.102,8.236,0,11.877l57.867,99.847
c2.102,3.64,5.986,5.501,10.19,5.501h115.735c4.203,0,8.087-1.805,10.188-5.446l57.867-100.01
C275.439,132.396,275.439,128.128,273.336,124.488 M225.419,172.898c0,1.48-0.891,2.849-2.174,3.59l-73.71,42.527
c-1.282,0.74-2.888,0.74-4.17,0l-73.767-42.527c-1.282-0.741-2.179-2.109-2.179-3.59V87.843c0-1.481,0.884-2.849,2.167-3.59
l73.707-42.527c1.282-0.741,2.886-0.741,4.168,0l73.772,42.527c1.283,0.741,2.186,2.109,2.186,3.59V172.898z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB