Skip to content

Commit 70c5489

Browse files
committed
add search entries
1 parent afd18f6 commit 70c5489

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/docs/filters/react/entries_react_dev.rb

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ def update_canary_copy(string)
2424
canary_copy = '- This feature is available in the latest Canary'
2525
return string.sub(canary_copy, ' (Canary)')
2626
end
27+
28+
def additional_entries
29+
excluded = %w(usage troubleshooting recap reference challenges alternatives)
30+
entries = []
31+
css('article h2, article h3').map do |node|
32+
next unless node.has_attribute?('id')
33+
name = node.content.strip
34+
next if excluded.include?(name.downcase)
35+
entries << [name, node['id'], type]
36+
end
37+
return entries
38+
end
2739
end
2840
end
2941
end

0 commit comments

Comments
 (0)