From f4b66063ac8a235b228a82b5bfd318bc03b05c8a Mon Sep 17 00:00:00 2001 From: Aymen Hosni Date: Sat, 16 May 2020 03:00:17 +0100 Subject: [PATCH] Add documentation for Spring Boot --- .../templates/pages/about_tmpl.coffee | 5 ++++ lib/docs/filters/spring_boot/clean_html.rb | 15 ++++++++++ lib/docs/filters/spring_boot/entries.rb | 21 +++++++++++++ lib/docs/scrapers/spring_boot.rb | 28 ++++++++++++++++++ public/icons/docs/spring_boot/16.png | Bin 0 -> 2781 bytes public/icons/docs/spring_boot/16@2x.png | Bin 0 -> 4929 bytes public/icons/docs/spring_boot/SOURCE | 1 + 7 files changed, 70 insertions(+) create mode 100644 lib/docs/filters/spring_boot/clean_html.rb create mode 100644 lib/docs/filters/spring_boot/entries.rb create mode 100644 lib/docs/scrapers/spring_boot.rb create mode 100644 public/icons/docs/spring_boot/16.png create mode 100644 public/icons/docs/spring_boot/16@2x.png create mode 100644 public/icons/docs/spring_boot/SOURCE diff --git a/assets/javascripts/templates/pages/about_tmpl.coffee b/assets/javascripts/templates/pages/about_tmpl.coffee index 8ac93ed4..b86ab6e6 100644 --- a/assets/javascripts/templates/pages/about_tmpl.coffee +++ b/assets/javascripts/templates/pages/about_tmpl.coffee @@ -821,5 +821,10 @@ credits = [ '2008-2017 by Yii Software LLC', 'BSD', 'https://raw.githubusercontent.com/yiisoft/yii/master/LICENSE' + ], [ + 'Spring Boot', + '2002 - 2020 Pivotal, Inc. All Rights Reserved.', + 'Apache License 2.0', + 'https://raw.githubusercontent.com/spring-projects/spring-boot/master/LICENSE.txt' ] ] diff --git a/lib/docs/filters/spring_boot/clean_html.rb b/lib/docs/filters/spring_boot/clean_html.rb new file mode 100644 index 00000000..eb1639d3 --- /dev/null +++ b/lib/docs/filters/spring_boot/clean_html.rb @@ -0,0 +1,15 @@ +module Docs + class SpringBoot + class CleanHtmlFilter < Filter + def call + + css('pre').each do |node| + language = node.children.first['data-lang'] if node.children.first.name == 'code' + node['data-language'] = language + end + + doc + end + end + end +end diff --git a/lib/docs/filters/spring_boot/entries.rb b/lib/docs/filters/spring_boot/entries.rb new file mode 100644 index 00000000..f6809024 --- /dev/null +++ b/lib/docs/filters/spring_boot/entries.rb @@ -0,0 +1,21 @@ +module Docs + class SpringBoot + class EntriesFilter < Docs::EntriesFilter + + def get_type + slug.gsub('-', ' ').capitalize + end + + def additional_entries + css('td a[href], li a[href]').each_with_object [] do |node, entries| + next if root_page? + next if node['href'].start_with?('http') + name = node.content.strip + id = node['href'].remove('#') + next if id.blank? + entries << [name, id, get_type] + end + end + end + end +end diff --git a/lib/docs/scrapers/spring_boot.rb b/lib/docs/scrapers/spring_boot.rb new file mode 100644 index 00000000..10792cb9 --- /dev/null +++ b/lib/docs/scrapers/spring_boot.rb @@ -0,0 +1,28 @@ +module Docs + class SpringBoot < UrlScraper + self.name = 'Spring Boot' + self.slug = 'spring_boot' + self.type = 'simple' + self.release = '2.3.0.RELEASE' + self.base_url = 'https://docs.spring.io/spring-boot/docs/current/reference/html/' + self.root_path = "index.html" + self.links = { + home: 'https://spring.io/', + code: 'https://github.com/spring-projects/spring-boot' + } + + html_filters.push 'spring_boot/entries', 'spring_boot/clean_html' + + options[:skip_patterns] = [/legal/] + + options[:attribution] = <<-HTML + Copyright © 2002 - 2020 Pivotal, Inc. All Rights Reserved. + HTML + + def get_latest_version(opts) + doc = fetch_doc('https://docs.spring.io/spring-boot/docs/current/reference/html/legal.html', opts) + table = doc.at_css('#content p').inner_text + end + + end +end diff --git a/public/icons/docs/spring_boot/16.png b/public/icons/docs/spring_boot/16.png new file mode 100644 index 0000000000000000000000000000000000000000..8668b90404ad6f76e51eeff3ba4b3d34ec2e3615 GIT binary patch literal 2781 zcmV<33L^E1P) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O1bvvg9ZX{O1&N1dsrUo&+=XtSL=V{#B6NDi~%llRG zS)VZ;K0df)xbi%1^vsZ+joiKQ`tg)J`|VLljME->{%n-`?!=_>sA@SI)w6J^a&CXC zwVU~F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bj=}=e*aMb z4iD{Wey97RK_lka literal 0 HcmV?d00001 diff --git a/public/icons/docs/spring_boot/16@2x.png b/public/icons/docs/spring_boot/16@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..cfaf4d833017ab93f49dd8946b76321908b9f09c GIT binary patch literal 4929 zcmV-H6Ta+;P) zaB^>EX>4U6ba`-PAZ2)IW&i+q+O3#rlH58Dg#Ysta|DqfxEzOT#N1$xKOZP{^=A9I zC#K~psU(U7kU%17xBm0*?f%7|T;+06b4fL&i@#W74ULO(-GB9b`zxOB^B0~+{Qh*` zy&eQ^31_)~=Jt$l+}HOP-q!H_^L*`DJLwoMamsqAJMqK>zf!8nh<+V)sxUjq|3ZEa$aJ6sl zJfFR1*?ZmIwU~%#dNS$++rLf2z)r~Jyp}jJALTlqqjD6M89+X-adnR2s}G>EosWL{ z=C@zxJp91K7*@!fLl{BMy&^f(FaX9&w8QU^rOK27W+N;o!tL;~#h-QSS#S8l%F{D6 zcqa3_^4r7x>ETZfxA(9R`K!EQg(Q{Fitt&CFEV6&jf^swH0H$fWVc!s89aNA!P4~V*#LsM~U~BVE_GfI+kb>QYn*c&3Nd}uL4X|QV@+Zea4mA~xs+u%waay${Nik_k zDJLVjmLuk%r1yiiJbfuM7S#`Bdu5HrOlGvg>Xy z)E-p79X~+LKd6O+l#RR@K4A&gYN%>OZVs{l~luW5c zecaM@`IW!9{J+NN{Y(kSOzJeoI!m17LcreIDi-%^4b5#=%%3H75{%~1%h=@j&SXXC z*DiG_ZsoCdRCh-{cmK(sxi#Uw5Xc8(K&a!sHZAk*?0)y)@6L)3Tc@AuV)A2MRmUuC z)P{MDMDIj+#$3~EbyBQ3$tcZGBJ!1Z5157;2>2z(C$lIwx&6xcl{(WOzv8=Jp_cLw zQFlLrNfO-;B}O(=vKoUogZxUNxtSXST3ZCX(z7=yvs+z-n|bs+={;2KDgh_c)&Mo3 zeS2Nf)ohOwAK|01Gc}oXqELKjL_y4N*k$+)jD=zl)9|5l7LhdnO5fV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