@@ -114,6 +114,11 @@ def generate_site():
114
114
f .write (jekyll_config )
115
115
print ('Generated _config.yml' )
116
116
117
+ # Initialize metrics for dashboard
118
+ graph_breaks_with_additional_info = 0
119
+ graph_breaks_with_missing_content = 0
120
+ total_graph_breaks = 0
121
+
117
122
# Generate index.md
118
123
index_md = """\
119
124
---
@@ -137,12 +142,27 @@ def generate_site():
137
142
Path (gb_dir ).mkdir (exist_ok = True )
138
143
139
144
for gbid , entries in registry .items ():
145
+ total_graph_breaks += 1
140
146
entry = entries [0 ] # Using first entry for the detail page
141
147
file_path = os .path .join (gb_dir , f"{ gbid .lower ()} .md" )
142
148
143
149
# Extract any manually added content from existing file
144
150
manual_content = extract_manual_content (file_path )
145
151
152
+ if manual_content :
153
+ graph_breaks_with_additional_info += 1
154
+
155
+ # Check for missing content
156
+ missing_content = False
157
+ if entry .get ('Gb_type' , '*No Gb_type provided.*' ) == '*No Gb_type provided.*' or \
158
+ entry .get ('Context' , '*No context provided.*' ) == '*No context provided.*' or \
159
+ entry .get ('Explanation' , '*No explanation provided.*' ) == '*No explanation provided.*' or \
160
+ not entry .get ('Hints' , []):
161
+ missing_content = True
162
+
163
+ if missing_content :
164
+ graph_breaks_with_missing_content += 1
165
+
146
166
hints = entry .get ('Hints' , [])
147
167
hints_content = '\n ' .join ([f"- { h } " for h in hints ]) if hints else '*No hints provided.*'
148
168
@@ -192,6 +212,24 @@ def generate_site():
192
212
f .write (detail_md )
193
213
print (f'Generated { file_path } ' )
194
214
215
+ # Generate dashboard.md
216
+ dashboard_md = f"""\
217
+ ---
218
+ layout: default
219
+ title: Graph Break Dashboard
220
+ ---
221
+
222
+ # Graph Break Metrics Dashboard
223
+
224
+ - Total Graph Breaks: { total_graph_breaks }
225
+ - Graph Breaks with Additional Info: { graph_breaks_with_additional_info }
226
+ - Graph Breaks with Missing Content: { graph_breaks_with_missing_content }
227
+
228
+ """
229
+ with open (os .path .join (output_dir , 'dashboard.md' ), 'w' ) as f :
230
+ f .write (dashboard_md )
231
+ print ('Generated dashboard.md' )
232
+
195
233
print ('Site generation complete!' )
196
234
197
235
0 commit comments