diff --git a/lib/docs/filters/html/entries.rb b/lib/docs/filters/html/entries.rb index ef8a80be..c3526620 100644 --- a/lib/docs/filters/html/entries.rb +++ b/lib/docs/filters/html/entries.rb @@ -27,7 +27,7 @@ module Docs end def include_default_entry? - !%w(Attributes Element/Heading_Elements).include?(slug) + !%w(Attributes Link_types Element/Heading_Elements).include?(slug) end def additional_entries @@ -39,6 +39,13 @@ module Docs id = node.parent['id'] = name.parameterize [name, id, 'Attributes'] end + elsif slug == 'Link_types' + css('.standard-table td:first-child > code').map do |node| + name = node.content.strip + id = node.parent.parent['id'] = name.parameterize + name.prepend 'rel: ' + [name, id, 'Attributes'] + end else [] end diff --git a/lib/docs/scrapers/mdn/html.rb b/lib/docs/scrapers/mdn/html.rb index a63aff06..129c597e 100644 --- a/lib/docs/scrapers/mdn/html.rb +++ b/lib/docs/scrapers/mdn/html.rb @@ -3,7 +3,7 @@ module Docs self.name = 'HTML' self.base_url = 'https://developer.mozilla.org/en-US/docs/Web/HTML' self.root_path = '/Element' - self.initial_paths = %w(/Attributes) + self.initial_paths = %w(/Attributes /Link_types) html_filters.push 'html/clean_html', 'html/entries', 'title' @@ -14,6 +14,8 @@ module Docs 'Heading Elements' elsif filter.slug == 'Attributes' 'Attributes' + elsif filter.slug == 'Link_types' + 'Link types' else "<#{filter.default_title}>" end