Skip to content

Commit 6797b57

Browse files
committed
Update HTML documentation ()
1 parent b864fb1 commit 6797b57

File tree

3 files changed

+12
-17
lines changed

3 files changed

+12
-17
lines changed

lib/docs/filters/html/entries.rb

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,22 @@ class EntriesFilter < Docs::EntriesFilter
55

66
def get_name
77
name = super
8-
name.sub!('Element.', '').try(:downcase!)
9-
name.sub!('Global attributes.', '').try(:concat, ' (attribute)')
8+
name.sub!('Guides.', '')
9+
name.sub!('How to.', '')
10+
name.sub!('Reference.Elements.', '').try(:downcase!)
11+
name.sub!('Reference.Attributes.', '').try(:concat, ' (attribute)')
12+
name.sub!('Reference.Global attributes.', '').try(:concat, ' (attribute)')
1013
name.sub!(/input\.([-\w]+)/, 'input type="\1"')
1114
name
1215
end
1316

1417
def get_type
15-
return 'Miscellaneous' if slug.include?('CORS') || slug.include?('Using')
16-
1718
if at_css('.deprecated', '.non-standard', '.obsolete')
18-
'Obsolete'
19-
elsif slug.start_with?('Global_attr')
20-
'Attributes'
21-
elsif slug.start_with?('Element/')
22-
'Elements'
19+
'Obsolete'
20+
elsif slug.start_with?('Guides/')
21+
'Guides'
22+
elsif slug.start_with?('Reference/')
23+
slug.split('/').drop(1).first.sub(/_/, ' ')
2324
else
2425
'Miscellaneous'
2526
end

lib/docs/scrapers/mdn/html.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module Docs
22
class Html < Mdn
33
prepend FixInternalUrlsBehavior
44

5-
# release = '2024-08-20'
5+
# release = '2025-06-01'
66
self.name = 'HTML'
77
self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/HTML'
88
self.links = {
@@ -22,11 +22,5 @@ class Html < Mdn
2222
'/Element/h5' => '/Element/Heading_Elements',
2323
'/Element/h6' => '/Element/Heading_Elements',
2424
'/Global_attributes/data-%2A' => '/Global_attributes/data-*' }
25-
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-
3125
end
3226
end

lib/docs/scrapers/mdn/mdn.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class Mdn < UrlScraper
1818
}
1919

2020
options[:attribution] = <<-HTML
21-
&copy; 2005&ndash;2024 MDN contributors.<br>
21+
&copy; 2005&ndash;2025 MDN contributors.<br>
2222
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
2323
HTML
2424

0 commit comments

Comments
 (0)