html.rb 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. module Docs
  2. class Html < Mdn
  3. prepend FixInternalUrlsBehavior
  4. # release = '2023-04-24'
  5. self.name = 'HTML'
  6. self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/HTML'
  7. self.links = {
  8. home: 'https://developer.mozilla.org/en-US/docs/Web/HTML',
  9. code: 'https://github.com/mdn/content/tree/main/files/en-us/web/html'
  10. }
  11. html_filters.push 'html/clean_html', 'html/entries'
  12. options[:root_title] = 'HTML'
  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