2017-06-05 02:56:54 +02:00
|
|
|
module Docs
|
|
|
|
class Godot < UrlScraper
|
|
|
|
self.type = 'sphinx_simple'
|
|
|
|
self.links = {
|
|
|
|
home: 'https://godotengine.org/',
|
|
|
|
code: 'https://github.com/godotengine/godot'
|
|
|
|
}
|
|
|
|
|
|
|
|
html_filters.push 'godot/entries', 'godot/clean_html', 'sphinx/clean_html'
|
|
|
|
|
2017-07-24 00:05:47 +02:00
|
|
|
options[:download_images] = false
|
|
|
|
options[:container] = '.document .section'
|
|
|
|
|
2017-06-05 02:56:54 +02:00
|
|
|
options[:only_patterns] = [/\Alearning\//, /\Aclasses\//]
|
2017-07-24 00:05:47 +02:00
|
|
|
options[:skip] = %w(classes/class_@global\ scope.html)
|
2017-06-05 02:56:54 +02:00
|
|
|
|
2017-07-24 00:05:47 +02:00
|
|
|
options[:attribution] = ->(filter) do
|
|
|
|
if filter.subpath.start_with?('classes')
|
|
|
|
<<-HTML
|
2018-02-25 16:29:29 +01:00
|
|
|
© 2014–2018 Juan Linietsky, Ariel Manzur, Godot Engine contributors<br>
|
2017-07-24 00:05:47 +02:00
|
|
|
Licensed under the MIT License.
|
|
|
|
HTML
|
|
|
|
else
|
|
|
|
<<-HTML
|
2018-02-25 16:29:29 +01:00
|
|
|
© 2014–2018 Juan Linietsky, Ariel Manzur and the Godot community<br>
|
2017-07-24 00:05:47 +02:00
|
|
|
Licensed under the Creative Commons Attribution Unported License v3.0.
|
|
|
|
HTML
|
|
|
|
end
|
|
|
|
end
|
2017-06-05 02:56:54 +02:00
|
|
|
|
2018-02-25 16:29:29 +01:00
|
|
|
version '3.0' do
|
2018-11-04 15:42:54 +01:00
|
|
|
self.release = '3.0.6'
|
2018-02-25 16:29:29 +01:00
|
|
|
self.base_url = "http://docs.godotengine.org/en/#{self.version}/"
|
|
|
|
end
|
|
|
|
|
2017-06-05 02:56:54 +02:00
|
|
|
version '2.1' do
|
|
|
|
self.release = '2.1'
|
|
|
|
self.base_url = "http://docs.godotengine.org/en/#{self.version}/"
|
|
|
|
end
|
2019-03-09 02:36:05 +01:00
|
|
|
|
2019-03-10 03:02:24 +01:00
|
|
|
def get_latest_version(opts)
|
|
|
|
doc = fetch_doc('https://docs.godotengine.org/', opts)
|
|
|
|
doc.at_css('.version').content.strip
|
2019-03-09 02:36:05 +01:00
|
|
|
end
|
2017-06-05 02:56:54 +02:00
|
|
|
end
|
|
|
|
end
|