bootstrap.rb 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. module Docs
  2. class Bootstrap < UrlScraper
  3. self.type = 'bootstrap'
  4. self.links = {
  5. home: 'https://getbootstrap.com/',
  6. code: 'https://github.com/twbs/bootstrap'
  7. }
  8. options[:trailing_slash] = false
  9. options[:attribution] = <<-HTML
  10. &copy; 2011&ndash;2016 Twitter, Inc.<br>
  11. Code licensed under the MIT License.<br>
  12. Documentation licensed under the Creative Commons Attribution License v3.0.
  13. HTML
  14. version '4' do
  15. self.release = 'alpha.3'
  16. self.base_url = 'https://v4-alpha.getbootstrap.com/'
  17. self.root_path = 'getting-started/introduction'
  18. html_filters.push 'bootstrap/entries_v4', 'bootstrap/clean_html_v4'
  19. options[:only_patterns] = [/\Agetting-started\//, /\Alayout\//, /\Acontent\//, /\Acomponents\//]
  20. end
  21. version '3' do
  22. self.release = '3.3.7'
  23. self.base_url = 'https://getbootstrap.com/'
  24. self.root_path = 'getting-started'
  25. html_filters.push 'bootstrap/entries_v3', 'bootstrap/clean_html_v3'
  26. options[:only] = %w(getting-started css components javascript)
  27. end
  28. private
  29. def handle_response(response)
  30. response.effective_url.scheme = 'https'
  31. response.effective_url.path = response.effective_url.path.remove(/\/\z/)
  32. super
  33. end
  34. end
  35. end