Unified · Split
| @@ -821,5 +821,10 @@ credits = [ · 820 unmodified lines | ||
| 821 | 821 | '2008-2017 by Yii Software LLC', |
| 822 | 822 | 'BSD', |
| 823 | 823 | 'https://raw.githubusercontent.com/yiisoft/yii/master/LICENSE' |
| 824 | + ], [ | |
| 825 | + 'Spring Boot', | |
| 826 | + '2002 - 2020 Pivotal, Inc. All Rights Reserved.', | |
| 827 | + 'Apache License 2.0', | |
| 828 | + 'https://raw.githubusercontent.com/spring-projects/spring-boot/master/LICENSE.txt' | |
| 824 | 829 | ] |
| 825 | 830 | ] |
| @@ -0,0 +1,15 @@ | ||
| 1 | +module Docs | |
| 2 | + class SpringBoot | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + | |
| 6 | + css('pre').each do |node| | |
| 7 | + language = node.children.first['data-lang'] if node.children.first.name == 'code' | |
| 8 | + node['data-language'] = language | |
| 9 | + end | |
| 10 | + | |
| 11 | + doc | |
| 12 | + end | |
| 13 | + end | |
| 14 | + end | |
| 15 | +end | |
| @@ -0,0 +1,21 @@ | ||
| 1 | +module Docs | |
| 2 | + class SpringBoot | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + | |
| 5 | + def get_type | |
| 6 | + slug.gsub('-', ' ').capitalize | |
| 7 | + end | |
| 8 | + | |
| 9 | + def additional_entries | |
| 10 | + css('td a[href], li a[href]').each_with_object [] do |node, entries| | |
| 11 | + next if root_page? | |
| 12 | + next if node['href'].start_with?('http') | |
| 13 | + name = node.content.strip | |
| 14 | + id = node['href'].remove('#') | |
| 15 | + next if id.blank? | |
| 16 | + entries << [name, id, get_type] | |
| 17 | + end | |
| 18 | + end | |
| 19 | + end | |
| 20 | + end | |
| 21 | +end | |
| @@ -0,0 +1,28 @@ | ||
| 1 | +module Docs | |
| 2 | + class SpringBoot < UrlScraper | |
| 3 | + self.name = 'Spring Boot' | |
| 4 | + self.slug = 'spring_boot' | |
| 5 | + self.type = 'simple' | |
| 6 | + self.release = '2.3.0.RELEASE' | |
| 7 | + self.base_url = 'https://docs.spring.io/spring-boot/docs/current/reference/html/' | |
| 8 | + self.root_path = "index.html" | |
| 9 | + self.links = { | |
| 10 | + home: 'https://spring.io/', | |
| 11 | + code: 'https://github.com/spring-projects/spring-boot' | |
| 12 | + } | |
| 13 | + | |
| 14 | + html_filters.push 'spring_boot/entries', 'spring_boot/clean_html' | |
| 15 | + | |
| 16 | + options[:skip_patterns] = [/legal/] | |
| 17 | + | |
| 18 | + options[:attribution] = <<-HTML | |
| 19 | + Copyright © 2002 - 2020 Pivotal, Inc. All Rights Reserved. | |
| 20 | + HTML | |
| 21 | + | |
| 22 | + def get_latest_version(opts) | |
| 23 | + doc = fetch_doc('https://docs.spring.io/spring-boot/docs/current/reference/html/legal.html', opts) | |
| 24 | + table = doc.at_css('#content p').inner_text | |
| 25 | + end | |
| 26 | + | |
| 27 | + end | |
| 28 | +end | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://spring.io/trademarks | |