From 9fdaf078bdbae2074f6935b6321c5e1132155058 Mon Sep 17 00:00:00 2001 From: Cyril Lakech <1169286+clakech@users.noreply.github.com> Date: Mon, 23 Oct 2017 23:03:37 +0200 Subject: [PATCH] add eslint doc (4.9.0) --- lib/docs/filters/eslint/clean_html.rb | 10 ++++++++++ lib/docs/filters/eslint/entries.rb | 25 +++++++++++++++++++++++++ lib/docs/scrapers/eslint.rb | 25 +++++++++++++++++++++++++ public/icons/docs/eslint/16.png | Bin 0 -> 505 bytes public/icons/docs/eslint/16@2x.png | Bin 0 -> 1088 bytes public/icons/docs/eslint/SOURCE. | 17 +++++++++++++++++ 6 files changed, 77 insertions(+) create mode 100644 lib/docs/filters/eslint/clean_html.rb create mode 100644 lib/docs/filters/eslint/entries.rb create mode 100644 lib/docs/scrapers/eslint.rb create mode 100644 public/icons/docs/eslint/16.png create mode 100644 public/icons/docs/eslint/16@2x.png create mode 100644 public/icons/docs/eslint/SOURCE. 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 0000000000000000000000000000000000000000..10e1edb099ce97816e834be20429fbecc2b312ae GIT binary patch literal 505 zcmVeCgh3d`fBWt#vNo;`TqGr}-lC)tTP|L0YEx3aN)A5mio=u(H!UeCp`5j9 zt}d?wZB2<1HV3(JTKS5#F0(Z@TzG1l`Tw8inUClB5B$*rHt<}(7C0~FEqe!|N{j0P z;S>dI0cAj`85!Wh!eL;;PH?Q#yMRsuUw~1iMU&E^85l7fK+JRf*mpPBGIKKbmJ2H_ zwx!GtNtqp0TI}TBa^*nM#H@d*f#>?uzzWc-v`|uJ8-ZOQYT{0TK`A3=p6mAj3Ybz_ ztOY#R4*^d=2@q?EM=ycfABtF)-an}U4uEH%$^n*5a=}8sbS-GD%YY>ZsQiNrDji^= zh|K?zVEaCR8AoaH1k4q#C}rdZNC5X%@I8=_GIC{!Y+h;c5U_M`XWlidv{(g@GP?i- z8`>-82D$@z&-EvPMc@&rR$Aok4dOt`zzi^^v^X@rc3=~zH~v1QMe4i1a169s)Sl6Q vzr`IXE!uu+*)Wg>UJdTBYJh3?IR9y%x#e}`xO^X500000NkvXXu0mjf{*2OE literal 0 HcmV?d00001 diff --git a/public/icons/docs/eslint/16@2x.png b/public/icons/docs/eslint/16@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..463fc6109b85eab498275b2fd5d9fea12e899780 GIT binary patch literal 1088 zcmV-G1i$-;(V-1IU=%8NzD9-{EVdWBGApf?l3h^%hPDN61= z6QqnoqwY#c$HFTM(uav)1h0tVd{~syA1g0(;z*}wQfnLM?dCUlI-U1DXJ^p*T^*j^ zbH2at@Av%vy)e(BDqRTt$eROxY^;uJCJ^{hJCFxf1JkoKo&hcby~gUFXH6jRqeZ}8 zV9y+*{2p-7SUp}&nHJs^KzCYrB`Q<$J4s##)+Q;v1n(D%@ic;0fmeVo;QN$&O+Z)R zN3B&6kfeJG=uGhXHgEt~XRPiwRv!mCfDjl>AkhUpQ&kQGezX)gDI{DO2hITdjMYCT zL~ezU+XyTy!T%cAVXXc&kwD-_8DKl`iF5oHa0S?JtTr=;VOXdKT7Y_BBn+FT9h?n7 z4)8@kBRha&#_Fjg0`0(M;8CCm+yFj8@u9h_ivT_Q?UWA)X45eWRKL0ET-@d)TNR*yPfXXU*Ql*#O2;9cPCpW_n~@8?@$ z!EFQjf%P*mK;BsWpfm}W1G}8C56u`4!$Msc7FNmA3?`J-8p)lb3l}x4$>jgjQ@B%+lz_Y;S z6wnrFt<_4S{3l7a1AgE~%9BR%K?T5KErY0nejm{00WZn0`LE?U;AszNo5yva)sqsr zH4nyr0Zw|r9jV_rEiN_urw17IjMcG<)c|lQbFxv9g_e(J@+$8sZL-)9LJyMa?O(f z8`qx8#KrhAiR4?r!zIn9&shCO+CtI_oC6*&QT+rQ0tSuMBMA#h8?XU*2Y9kX{T;B` zSbfbstS^J}yF{SB%#wN-7!3UAW8i|ZdQ1#A%X93MZK#~&f$LS(ssMfgypRAkA&E60 z3Ak0ZoovGWQ^0G+>YLRPP{8xD1J + + + + + + + +