html.rb 971 B

123456789101112131415161718192021222324252627282930313233
  1. module Docs
  2. class Html < Mdn
  3. prepend FixInternalUrlsBehavior
  4. self.name = 'HTML'
  5. self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/HTML'
  6. html_filters.push 'html/clean_html', 'html/entries'
  7. options[:root_title] = 'HTML'
  8. options[:skip] = %w(
  9. /index
  10. /Element/shadow
  11. /Element/webkit-meter-optimum-value
  12. )
  13. options[:replace_paths] = {
  14. '/Element/h1' => '/Element/Heading_Elements',
  15. '/Element/h2' => '/Element/Heading_Elements',
  16. '/Element/h3' => '/Element/Heading_Elements',
  17. '/Element/h4' => '/Element/Heading_Elements',
  18. '/Element/h5' => '/Element/Heading_Elements',
  19. '/Element/h6' => '/Element/Heading_Elements',
  20. '/Global_attributes/data-%2A' => '/Global_attributes/data-*' }
  21. options[:fix_urls] = ->(url) do
  22. url.sub! 'https://developer.mozilla.org/en-US/docs/HTML/', "#{Html.base_url}/" unless url.include?('Content_categories')
  23. url
  24. end
  25. end
  26. end