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.
devdocs/lib/docs/scrapers/mdn/html.rb

36 lines
1017 B

11 years ago
module Docs
class Html < Mdn
self.name = 'HTML'
self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/HTML'
11 years ago
html_filters.push 'html/clean_html', 'html/entries', 'title'
options[:root_title] = 'HTML'
options[:title] = ->(filter) do
if filter.slug == 'Element/Heading_Elements'
11 years ago
'Heading Elements'
9 years ago
elsif filter.slug.start_with?('Element/')
11 years ago
"<#{filter.default_title}>"
9 years ago
else
filter.default_title
11 years ago
end
end
9 years ago
options[:skip] = %w(
/index
/Element/shadow
/Element/webkit-meter-optimum-value
)
11 years ago
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',
9 years ago
'/Element/h6' => '/Element/Heading_Elements',
'/Global_attributes/data-%2A' => '/Global_attributes/data-*' }
11 years ago
end
end