html.rb 1000 B

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