chef.rb 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. module Docs
  2. class Chef < UrlScraper
  3. self.type = 'sphinx_simple'
  4. self.base_url = 'https://docs.chef.io/release/'
  5. self.links = {
  6. home: 'https://www.chef.io/',
  7. code: 'https://github.com/chef/chef'
  8. }
  9. html_filters.push 'chef/entries', 'chef/clean_html'
  10. options[:skip_patterns] = [
  11. /\A[^\/]+\/\z/,
  12. /\A[^\/]+\/index\.html\z/,
  13. /\A[^\/]+\/release_notes\.html\z/,
  14. /\Aserver[^\/]+\/chef_overview\.html\z/ ]
  15. options[:attribution] = <<-HTML
  16. &copy; Chef Software, Inc.<br>
  17. Licensed under the Creative Commons Attribution 3.0 Unported License.<br>
  18. The Chef&trade; Mark and Chef Logo are either registered trademarks/service marks or trademarks/service
  19. marks of Chef, in the United States and other countries and are used with Chef Inc's permission.<br>
  20. We are not affiliated with, endorsed or sponsored by Chef Inc.
  21. HTML
  22. version '12' do
  23. self.release = '12.7'
  24. options[:client_path] = client_path = '12-7'
  25. options[:server_path] = server_path = 'server_12-4'
  26. self.root_path = "#{client_path}/chef_overview.html"
  27. self.initial_paths = ["#{server_path}/server_components.html"]
  28. options[:only_patterns] = [/\A#{client_path}\//, /\A#{server_path}\//]
  29. end
  30. version '11' do
  31. self.release = '11.18'
  32. options[:client_path] = client_path = '11-18'
  33. options[:server_path] = server_path = 'server_12-4'
  34. self.root_path = "#{client_path}/chef_overview.html"
  35. self.initial_paths = ["#{server_path}/server_components.html"]
  36. options[:only_patterns] = [/\A#{client_path}\//, /\A#{server_path}\//]
  37. end
  38. end
  39. end