mirror of https://github.com/freeCodeCamp/devdocs
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.
36 lines
1007 B
36 lines
1007 B
module Docs
|
|
class Varnish < UrlScraper
|
|
self.name = 'Varnish'
|
|
self.type = 'sphinx'
|
|
|
|
self.root_path = 'index.html'
|
|
self.links = {
|
|
home: 'https://varnish-cache.org/',
|
|
code: 'https://github.com/varnishcache/varnish-cache'
|
|
}
|
|
|
|
html_filters.push 'varnish/entries', 'sphinx/clean_html'
|
|
|
|
options[:container] = '.body > section'
|
|
options[:skip] = %w(genindex.html search.html)
|
|
options[:skip_patterns] = [/phk/, /glossary/, /whats-new/]
|
|
|
|
options[:attribution] = <<-HTML
|
|
Copyright © 2006 Verdens Gang AS<br>
|
|
Copyright © 2006–2020 Varnish Software AS<br>
|
|
Licensed under the BSD-2-Clause License.
|
|
HTML
|
|
|
|
version do
|
|
self.release = '7.4'
|
|
self.base_url = "https://varnish-cache.org/docs/#{release}/"
|
|
end
|
|
|
|
def get_latest_version(opts)
|
|
contents = get_github_file_contents('varnishcache', 'varnish-cache', 'doc/changes.rst', opts)
|
|
contents.scan(/Varnish\s+Cache\s+([0-9.]+)/)[0][0]
|
|
end
|
|
|
|
end
|
|
end
|