|
19 | 19 | from fnmatch import fnmatch
|
20 | 20 | import glob
|
21 | 21 | import os
|
| 22 | +import re |
22 | 23 |
|
23 | 24 | log = logging.getLogger('mkdocs')
|
24 | 25 |
|
25 | 26 |
|
| 27 | +def process_feature_name(feature): |
| 28 | + """ |
| 29 | + Process feature names by: |
| 30 | + 1. Removing HTTPRoute and Gateway prefixes |
| 31 | + 2. Splitting camelCase into space-separated words |
| 32 | + """ |
| 33 | + # Remove prefixes |
| 34 | + feature = re.sub(r'^(HTTPRoute|Gateway)', '', feature) |
| 35 | + |
| 36 | + # Split camelCase |
| 37 | + words = re.findall(r'[A-Z][a-z]*(?=[A-Z][a-z]*|$)|[A-Z]{2,}(?=[A-Z][a-z]|\d|\W|$)|[A-Z][a-z]+|\d+', feature) |
| 38 | + |
| 39 | + # Join words with spaces and title case each word |
| 40 | + return ' '.join(word.title() for word in words) |
| 41 | + |
| 42 | + |
26 | 43 | @plugins.event_priority(100)
|
27 | 44 | def on_pre_build(config, **kwargs):
|
28 | 45 | log.info("generating conformance")
|
@@ -114,7 +131,9 @@ def generate_profiles_report(reports, route,version):
|
114 | 131 | for row in http_table.itertuples():
|
115 | 132 | if type(row._4) is list:
|
116 | 133 | for feat in row._4:
|
117 |
| - http_table.loc[row.Index, feat] = ':white_check_mark:' |
| 134 | + # Process feature name before using it as a column |
| 135 | + processed_feat = process_feature_name(feat) |
| 136 | + http_table.loc[row.Index, processed_feat] = ':white_check_mark:' |
118 | 137 | http_table = http_table.fillna(':x:')
|
119 | 138 | http_table = http_table.drop(['extended.supportedFeatures'], axis=1)
|
120 | 139 |
|
|
0 commit comments