html.rb 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. module Docs
  2. class Html < Mdn
  3. self.name = 'HTML'
  4. self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/HTML'
  5. self.root_path = '/Element'
  6. self.initial_paths = %w(/Attributes /Link_types)
  7. html_filters.push 'html/clean_html', 'html/entries', 'title'
  8. options[:root_title] = 'HTML'
  9. options[:title] = ->(filter) do
  10. if filter.slug == 'Element/Heading_Elements'
  11. 'Heading Elements'
  12. elsif filter.slug == 'Attributes'
  13. 'Attributes'
  14. elsif filter.slug == 'Link_types'
  15. 'Link types'
  16. else
  17. "<#{filter.default_title}>"
  18. end
  19. end
  20. options[:skip] = ['/Element/shadow']
  21. options[:only_patterns] = [/\A\/Element/]
  22. options[:replace_paths] = {
  23. '/Element/h1' => '/Element/Heading_Elements',
  24. '/Element/h2' => '/Element/Heading_Elements',
  25. '/Element/h3' => '/Element/Heading_Elements',
  26. '/Element/h4' => '/Element/Heading_Elements',
  27. '/Element/h5' => '/Element/Heading_Elements',
  28. '/Element/h6' => '/Element/Heading_Elements' }
  29. end
  30. end