@@ -78,15 +78,15 @@ def parse_readme_frontmatter(readme_path):
7878 """Extract YAML frontmatter from README.md"""
7979 with open (readme_path , 'r' , encoding = 'utf-8' ) as f :
8080 content = f .read ()
81-
81+
8282 if not content .startswith ('---' ):
8383 return None
84-
84+
8585 # Extract frontmatter between --- delimiters
8686 parts = content .split ('---' , 2 )
8787 if len (parts ) < 3 :
8888 return None
89-
89+
9090 try :
9191 frontmatter = yaml .safe_load (parts [1 ])
9292 return frontmatter
@@ -105,16 +105,16 @@ def get_platform_from_frontmatter(frontmatter):
105105def generate_icon_prompt (name , platform , description ):
106106 """Generate an AI image generation prompt for an icon"""
107107 platform_colors = PLATFORM_COLORS .get (platform )
108-
108+
109109 if not platform_colors :
110110 # Fallback to generic bright colors
111111 color_scheme = "bright, vibrant colors"
112112 else :
113113 color_scheme = platform_colors ["name" ]
114-
114+
115115 # Clean up description
116116 clean_description = description .strip ().replace ('\n ' , ' ' )
117-
117+
118118 # Generate AI prompt
119119 ai_prompt = f"""Create a professional flat design icon for the meshcloud Building Block ecosystem.
120120
@@ -139,7 +139,7 @@ def generate_icon_prompt(name, platform, description):
139139
140140Style: Enterprise professional, instantly recognizable at small sizes, similar to app icons or logos.
141141Dimensions: 800x800 pixels"""
142-
142+
143143 # Generate post-processing instructions
144144 post_processing = """**Step 1: Remove white background with GIMP (free)**
145145
@@ -163,7 +163,7 @@ def generate_icon_prompt(name, platform, description):
163163- This reduces file size by 60-80% while maintaining quality
164164
165165**Target specs:** 800x800px PNG with transparent background, under 100KB"""
166-
166+
167167 return {
168168 'ai_prompt' : ai_prompt ,
169169 'post_processing' : post_processing
@@ -172,23 +172,23 @@ def generate_icon_prompt(name, platform, description):
172172def find_missing_logos (modules_dir ):
173173 """Find all buildingblock directories missing logo.png"""
174174 missing = []
175-
175+
176176 for root , dirs , files in os .walk (modules_dir ):
177177 if 'buildingblock' in root :
178178 buildingblock_path = Path (root )
179179 readme_path = buildingblock_path / 'README.md'
180180 logo_path = buildingblock_path / 'logo.png'
181-
181+
182182 if readme_path .exists () and not logo_path .exists ():
183183 frontmatter = parse_readme_frontmatter (readme_path )
184184 if frontmatter :
185185 platform = get_platform_from_frontmatter (frontmatter )
186186 name = frontmatter .get ('name' , 'Unknown' )
187187 description = frontmatter .get ('description' , '' )
188-
188+
189189 # Get relative path from modules directory
190190 rel_path = buildingblock_path .relative_to (modules_dir )
191-
191+
192192 missing .append ({
193193 'path' : str (rel_path ),
194194 'name' : name ,
@@ -197,21 +197,21 @@ def find_missing_logos(modules_dir):
197197 'readme_path' : str (readme_path ),
198198 'logo_path' : str (logo_path )
199199 })
200-
200+
201201 return missing
202202
203203def main ():
204204 # Get modules directory
205205 repo_root = Path (__file__ ).parent .parent .parent
206206 modules_dir = repo_root / 'modules'
207-
207+
208208 if not modules_dir .exists ():
209209 print (f"ERROR: Modules directory not found: { modules_dir } " , file = sys .stderr )
210210 sys .exit (1 )
211-
211+
212212 # Find missing logos
213213 missing_logos = find_missing_logos (modules_dir )
214-
214+
215215 # Generate prompts for each missing logo
216216 results = []
217217 for item in missing_logos :
@@ -220,7 +220,7 @@ def main():
220220 item ['platform' ] or 'generic' ,
221221 item ['description' ]
222222 )
223-
223+
224224 results .append ({
225225 'name' : item ['name' ],
226226 'platform' : item ['platform' ],
@@ -229,7 +229,7 @@ def main():
229229 'ai_prompt' : prompt_data ['ai_prompt' ],
230230 'post_processing' : prompt_data ['post_processing' ]
231231 })
232-
232+
233233 # Output as JSON for GitHub Action to consume
234234 print (json .dumps (results , indent = 2 ))
235235
0 commit comments