1
0

html.rb 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. module Docs
  2. class Html < Mdn
  3. prepend FixInternalUrlsBehavior
  4. # release = '2023-01-06'
  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[:skip] = %w(
  14. /index
  15. /Element/shadow
  16. /Element/webkit-meter-optimum-value
  17. )
  18. options[:replace_paths] = {
  19. '/Element/h1' => '/Element/Heading_Elements',
  20. '/Element/h2' => '/Element/Heading_Elements',
  21. '/Element/h3' => '/Element/Heading_Elements',
  22. '/Element/h4' => '/Element/Heading_Elements',
  23. '/Element/h5' => '/Element/Heading_Elements',
  24. '/Element/h6' => '/Element/Heading_Elements',
  25. '/Global_attributes/data-%2A' => '/Global_attributes/data-*' }
  26. options[:fix_urls] = ->(url) do
  27. url.sub! 'https://developer.mozilla.org/en-US/docs/HTML/', "#{Html.base_url}/" unless url.include?('Content_categories')
  28. url
  29. end
  30. end
  31. end