mirror of https://github.com/freeCodeCamp/devdocs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
1.0 KiB
36 lines
1.0 KiB
module Docs
|
|
class Html < Mdn
|
|
self.name = 'HTML'
|
|
self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/HTML'
|
|
self.root_path = '/Element'
|
|
self.initial_paths = %w(/Attributes /Link_types)
|
|
|
|
html_filters.push 'html/clean_html', 'html/entries', 'title'
|
|
|
|
options[:root_title] = 'HTML'
|
|
|
|
options[:title] = ->(filter) do
|
|
if filter.slug == 'Element/Heading_Elements'
|
|
'Heading Elements'
|
|
elsif filter.slug == 'Attributes'
|
|
'Attributes'
|
|
elsif filter.slug == 'Link_types'
|
|
'Link types'
|
|
else
|
|
"<#{filter.default_title}>"
|
|
end
|
|
end
|
|
|
|
options[:skip] = ['/Element/shadow']
|
|
options[:only_patterns] = [/\A\/Element/]
|
|
|
|
options[:replace_paths] = {
|
|
'/Element/h1' => '/Element/Heading_Elements',
|
|
'/Element/h2' => '/Element/Heading_Elements',
|
|
'/Element/h3' => '/Element/Heading_Elements',
|
|
'/Element/h4' => '/Element/Heading_Elements',
|
|
'/Element/h5' => '/Element/Heading_Elements',
|
|
'/Element/h6' => '/Element/Heading_Elements' }
|
|
end
|
|
end
|