From 03e42df10e03222b63f989f321f71d706b5812c5 Mon Sep 17 00:00:00 2001 From: Simon Legner Date: Sat, 27 Aug 2022 21:01:10 +0200 Subject: [PATCH] Add Axios documentation (0.27.2) --- assets/javascripts/news.json | 2 +- .../templates/pages/about_tmpl.coffee | 5 ++++ lib/docs/filters/axios/clean_html.rb | 10 +++++++ lib/docs/filters/axios/entries.rb | 13 +++++++++ lib/docs/scrapers/axios.rb | 26 ++++++++++++++++++ public/icons/docs/axios/16.png | Bin 0 -> 473 bytes public/icons/docs/axios/16@2x.png | Bin 0 -> 683 bytes public/icons/docs/axios/SOURCE | 1 + 8 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 lib/docs/filters/axios/clean_html.rb create mode 100644 lib/docs/filters/axios/entries.rb create mode 100755 lib/docs/scrapers/axios.rb create mode 100644 public/icons/docs/axios/16.png create mode 100644 public/icons/docs/axios/16@2x.png create mode 100644 public/icons/docs/axios/SOURCE diff --git a/assets/javascripts/news.json b/assets/javascripts/news.json index 077180c9..d76b8b3f 100644 --- a/assets/javascripts/news.json +++ b/assets/javascripts/news.json @@ -1,7 +1,7 @@ [ [ "2022-08-27", - "New documentations: Sanctuary, Requests" + "New documentations: Sanctuary, Requests, Axios" ], [ "2022-05-03", diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index b3b7136c..f72b00a0 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -106,6 +106,11 @@ credits = [ '2010-2018 Caolan McMahon', 'MIT', 'https://raw.githubusercontent.com/caolan/async/master/LICENSE' + ], [ + 'Axios', + '2014-present Matt Zabriskie', + 'MIT', + 'https://raw.githubusercontent.com/axios/axios/main/LICENSE' ], [ 'Babel', '2014-present Sebastian McKenzie', diff --git a/lib/docs/filters/axios/clean_html.rb b/lib/docs/filters/axios/clean_html.rb new file mode 100644 index 00000000..7a1aa8cc --- /dev/null +++ b/lib/docs/filters/axios/clean_html.rb @@ -0,0 +1,10 @@ +module Docs + class Axios + class CleanHtmlFilter < Filter + def call + css('.links').remove + doc + end + end + end +end diff --git a/lib/docs/filters/axios/entries.rb b/lib/docs/filters/axios/entries.rb new file mode 100644 index 00000000..a23a223b --- /dev/null +++ b/lib/docs/filters/axios/entries.rb @@ -0,0 +1,13 @@ +module Docs + class Axios + class EntriesFilter < Docs::EntriesFilter + def get_name + at_css('h1').content + end + + def get_type + 'axios' + end + end + end +end diff --git a/lib/docs/scrapers/axios.rb b/lib/docs/scrapers/axios.rb new file mode 100755 index 00000000..96314eb7 --- /dev/null +++ b/lib/docs/scrapers/axios.rb @@ -0,0 +1,26 @@ +module Docs + class Axios < UrlScraper + self.type = 'simple' + self.links = { + home: 'hthttps://axios-http.com/', + code: 'https://github.com/axios/axios' + } + self.release = '0.27.2' + self.base_url = "https://axios-http.com/docs/" + self.initial_paths = %w(intro) + + html_filters.push 'axios/entries', 'axios/clean_html' + + options[:container] = 'main > .body' + + # https://github.com/axios/axios-docs/blob/master/LICENSE + options[:attribution] = <<-HTML + © 2020-present John Jakob "Jake" Sarjeant
+ Licensed under the MIT License. + HTML + + def get_latest_version(opts) + get_latest_github_release('axios', 'axios', opts) + end + end +end diff --git a/public/icons/docs/axios/16.png b/public/icons/docs/axios/16.png new file mode 100644 index 0000000000000000000000000000000000000000..8cbd5d4979b9615c4cbee2519001f54d3420cf60 GIT binary patch literal 473 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GY}JiEBhjN@7W>RY_)UYH>+oZUKXl zfsv7}frYM-d5EEE)e-c@Ne1&9>AYTTC zDm4a%h86~fUqGRT7Yq!g1`G_Z5*Qe)W-u^_7tGleXakgBFY)wsWq-yYEzHFFe6EuV zP>8d@BeIx*fm;}a85w5HkpK!-1o(uw{znDhzyAC7`S0Jq|JTp>bZ-Cm>t}u*So?Km z^}7?>zy167|Lnf+1+FjVHoTu*_x{9=Z-4*%e|+oLvYrp~o8KSa`1RoWucvl>n_c^U zPW}69Cx86;{eMQ~yNZC9H_rS#xbExmZQq{W{e5!hw;fA9|N8MyI?Qng& z>d&4T%dq8zIyd8l09O{rd%4fQHr$9kU(e3iWY8r#VTt79olISuR+&0vCO2(+Hka{N y;v5qL{nf8-+^EaYf3AAC`^7ok*MCpX{3_oh$?NMQuI$e^q=lK->ZS<) z0}62#ctjR6FmMZlFeAgPITAp@djUQnuK)3afB*jh(ck}n|NQ^+``_HXg~&;PuB`sdlb-%sxTeti4aqg%gjo&S0B+|Qe5e_lEMuFq4=pCy?*O*DF%VE8m%|7o1w z(^#D+G1^a}wVp(2K8e(L5~2PiLhVU!|G8$6_e+BOf*H6(6K2mj^!Z!)q$_qnLB=F+ zcNc~ZR#^`q=bWdDV@SoVy_b*kH5&-9TrkwNm~c<}<=*f2xF7zn*SOA*xHC0x+WaS5 zw=g$!dNus_a1fMa;MjD^c99p;0Tn-&G=WgA6-pw0ZjIUdLN1zV&iQ`R_kLMf^@0kvc2cHHPp&;%`h>S>>fF?MoB}J$Zr#rAtZMpvvzP7GAOD00>~2vSYXl!` zj9<4akm-(Y@vMdOD&|#jX0;t#xHQmt+GjTPx{W&|&#`V|tTpo4b>RD@SFJl%$NkHG qA1$L6?2y!;P&qwZjA8$;dIq;IrgzHEv!4O_jKR~@&t;ucLK6VOZB0G^ literal 0 HcmV?d00001 diff --git a/public/icons/docs/axios/SOURCE b/public/icons/docs/axios/SOURCE new file mode 100644 index 00000000..fcf8b034 --- /dev/null +++ b/public/icons/docs/axios/SOURCE @@ -0,0 +1 @@ +https://raw.githubusercontent.com/axios/axios-docs/master/assets/favicon.png