[devdocsgjs/main: 1056/1867] Add documentation for Spring Boot
- From: Andy Holmes <andyholmes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [devdocsgjs/main: 1056/1867] Add documentation for Spring Boot
- Date: Fri, 19 Nov 2021 23:47:40 +0000 (UTC)
commit f4b66063ac8a235b228a82b5bfd318bc03b05c8a
Author: Aymen Hosni <aymanoos gmail com>
Date: Sat May 16 03:00:17 2020 +0100
Add documentation for Spring Boot
.../javascripts/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(+)
---
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 00000000..8668b904
Binary files /dev/null and b/public/icons/docs/spring_boot/16.png differ
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 00000000..cfaf4d83
Binary files /dev/null and b/public/icons/docs/spring_boot/16 2x png differ
diff --git a/public/icons/docs/spring_boot/SOURCE b/public/icons/docs/spring_boot/SOURCE
new file mode 100644
index 00000000..eb93f3d7
--- /dev/null
+++ b/public/icons/docs/spring_boot/SOURCE
@@ -0,0 +1 @@
+https://spring.io/trademarks
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]