mirror of https://github.com/freeCodeCamp/devdocs
parent
4eb4bfe5da
commit
f4b66063ac
@ -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
|
@ -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
|
@ -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
|
After Width: | Height: | Size: 2.7 KiB |
After Width: | Height: | Size: 4.8 KiB |
@ -0,0 +1 @@
|
|||||||
|
https://spring.io/trademarks
|
Loading…
Reference in new issue