Skip to content

Commit 0b74b25

Browse files
Process css types from bcd
1 parent 9176374 commit 0b74b25

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

_plugins/generated_features.rb

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ def getVersions(feature, platform)
4747

4848
def generate_bcd_from_section(site, section, timestamp, category, appended_title = "")
4949
section.keys.each do |title|
50+
# We skip potential special keys since we can iterate over sub sections
51+
next unless title.index("__") != 0
52+
5053
feature = section[title]
5154

5255
title = "#{appended_title}#{title}"
@@ -66,7 +69,7 @@ def generate_bcd_from_section(site, section, timestamp, category, appended_title
6669
doc.data['last_test_date'] = timestamp
6770
doc.data['notes'] = data_source
6871
doc.data['links'] = feature["__compat"].key?("mdn_url") ? {
69-
"MDN reference" => feature["__compat"]["mdn_url"]
72+
"MDN reference" => feature["__compat"]["mdn_url"]
7073
} : {}
7174
doc.data['stats'] = {
7275
"wkwebview" => {
@@ -123,6 +126,13 @@ def generate_bcd(site)
123126
timestamp, "http", "HTTP header: ")
124127
generate_bcd_from_section(site, parsed_bcd['http']['status'],
125128
timestamp, "http", "HTTP status code: ")
129+
130+
# The css types can have sub fields so we iterate over these and then
131+
# generate sections.
132+
parsed_bcd['css']['types'].keys.each do |type|
133+
generate_bcd_from_section(site, parsed_bcd['css']['types'][type],
134+
timestamp, "css", "CSS type: #{type}: ")
135+
end
126136
end
127137

128138
def generate_baseline(site)

0 commit comments

Comments
 (0)