http.rb 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. module Docs
  2. class Http < Mdn
  3. include MultipleBaseUrls
  4. self.name = 'HTTP'
  5. self.base_urls = ['https://developer.mozilla.org/en-US/docs/Web/HTTP', 'https://tools.ietf.org/html/']
  6. html_filters.push 'http/clean_html', 'http/entries', 'title'
  7. options[:root_title] = 'HTTP'
  8. options[:title] = ->(filter) {
  9. filter.current_url.host == 'tools.ietf.org' ? false : filter.default_title
  10. }
  11. options[:container] = ->(filter) {
  12. filter.current_url.host == 'tools.ietf.org' ? '.content' : nil
  13. }
  14. options[:skip_links] = ->(filter) {
  15. filter.current_url.host == 'tools.ietf.org' ? true : false
  16. }
  17. options[:attribution] = ->(filter) {
  18. if filter.current_url.host == 'tools.ietf.org'
  19. "&copy; document authors. All rights reserved."
  20. else
  21. Docs::Mdn.options[:attribution]
  22. end
  23. }
  24. def initial_urls
  25. %w(https://developer.mozilla.org/en-US/docs/Web/HTTP
  26. https://tools.ietf.org/html/rfc2616
  27. https://tools.ietf.org/html/rfc4918
  28. https://tools.ietf.org/html/rfc7230
  29. https://tools.ietf.org/html/rfc7231
  30. https://tools.ietf.org/html/rfc7232
  31. https://tools.ietf.org/html/rfc7233
  32. https://tools.ietf.org/html/rfc7234
  33. https://tools.ietf.org/html/rfc7235)
  34. end
  35. end
  36. end