You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/lib/docs/scrapers/d.rb

36 lines
970 B

module Docs
class D < UrlScraper
7 years ago
include MultipleBaseUrls
self.release = '2.095.1'
self.type = 'd'
7 years ago
self.base_urls = ['https://dlang.org/phobos/', 'https://dlang.org/spec/']
self.root_path = 'index.html'
self.links = {
home: 'https://dlang.org/',
code: 'https://github.com/dlang/phobos'
}
html_filters.push 'd/entries', 'd/clean_html'
7 years ago
options[:skip] = %w(spec.html)
options[:container] = '.container'
options[:root_title] = 'D Programming Language'
options[:title] = false
options[:attribution] = <<-HTML
&copy; 1999&ndash;2021 The D Language Foundation<br>
7 years ago
Licensed under the Boost License 1.0.
HTML
7 years ago
def initial_urls
%w(https://dlang.org/phobos/index.html https://dlang.org/spec/intro.html)
end
def get_latest_version(opts)
doc = fetch_doc('https://dlang.org/changelog/', opts)
doc.at_css('#content > ul > li:nth-child(2) > a')['id']
end
end
end