History

Update HTML documentation

Simon Legner committed 4 years ago

Commit df0824a1 parent 2aac2052 files · +3 −1Browse files

Unified · Split

2 files
  1. lib/docs/filters/html/entries.rb +2 −0
  2. lib/docs/scrapers/mdn/html.rb +1 −1
lib/docs/filters/html/entries.rb+2−0
@@ -37,12 +37,14 @@ module Docs · 36 unmodified lines
37 css('.standard-table td:first-child').each_with_object [] do |node, entries|37 css('.standard-table td:first-child').each_with_object [] do |node, entries|
38 next if node.next_element.content.include?('Global attribute')38 next if node.next_element.content.include?('Global attribute')
39 name = "#{node.content.strip} (attribute)"39 name = "#{node.content.strip} (attribute)"
40 name = "#{node.at_css('code').content.strip} (attribute)" if node.at_css('code')
40 id = node.parent['id'] = name.parameterize41 id = node.parent['id'] = name.parameterize
41 entries << [name, id, 'Attributes']42 entries << [name, id, 'Attributes']
42 end43 end
43 elsif slug == 'Link_types'44 elsif slug == 'Link_types'
44 css('.standard-table td:first-child > code').map do |node|45 css('.standard-table td:first-child > code').map do |node|
45 name = node.content.strip46 name = node.content.strip
47 name = "#{node.at_css('code').content.strip} (attribute)" if node.at_css('code')
46 id = node.parent.parent['id'] = name.parameterize48 id = node.parent.parent['id'] = name.parameterize
47 name.prepend 'rel: '49 name.prepend 'rel: '
48 [name, id, 'Attributes']50 [name, id, 'Attributes']
lib/docs/scrapers/mdn/html.rb+1−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Html < Mdn2 class Html < Mdn
3 prepend FixInternalUrlsBehavior3 prepend FixInternalUrlsBehavior
4 4
5 # release = '2022-01-22'5 # release = '2022-04-27'
6 self.name = 'HTML'6 self.name = 'HTML'
7 self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/HTML'7 self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/HTML'
8 8