flask.rb 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. module Docs
  2. class Flask < UrlScraper
  3. self.type = 'sphinx'
  4. self.root_path = 'index.html'
  5. self.links = {
  6. home: 'https://palletsprojects.com/p/flask/',
  7. code: 'https://github.com/pallets/flask'
  8. }
  9. html_filters.push 'flask/entries', 'sphinx/clean_html'
  10. options[:container] = '.body > .section'
  11. options[:skip] = %w(extensiondev/ styleguide/ upgrading/ changelog/ license/ contributing/)
  12. options[:skip_patterns] = [/\Atutorial\//]
  13. options[:attribution] = <<-HTML
  14. &copy; 2007&ndash;2020 Pallets<br>
  15. Licensed under the BSD 3-clause License.
  16. HTML
  17. version '1.1' do
  18. self.release = '1.1.x'
  19. self.base_url = "https://flask.palletsprojects.com/en/#{self.release}/"
  20. end
  21. version '1.0' do
  22. self.release = '1.0.x'
  23. self.base_url = "https://flask.palletsprojects.com/en/#{self.release}/"
  24. end
  25. version '0.12' do
  26. self.release = '0.12.x'
  27. self.base_url = "https://flask.palletsprojects.com/en/#{self.release}/"
  28. end
  29. def get_latest_version(opts)
  30. get_latest_github_release('pallets', 'flask', opts)
  31. end
  32. end
  33. end