@@ -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
@@ -138,7 +138,7 @@ def generate_icon_prompt(name, platform, description):
138138
139139Style: Enterprise professional, instantly recognizable at small sizes, similar to app icons or logos.
140140Dimensions: 800x800 pixels"""
141-
141+
142142 # Generate post-processing instructions
143143 post_processing = """**Step 1: Remove white background with GIMP (free)**
144144
@@ -162,7 +162,7 @@ def generate_icon_prompt(name, platform, description):
162162- This reduces file size by 60-80% while maintaining quality
163163
164164**Target specs:** 800x800px PNG with transparent background, under 100KB"""
165-
165+
166166 return {
167167 'ai_prompt' : ai_prompt ,
168168 'post_processing' : post_processing
@@ -171,23 +171,23 @@ def generate_icon_prompt(name, platform, description):
171171def find_missing_logos (modules_dir ):
172172 """Find all buildingblock directories missing logo.png"""
173173 missing = []
174-
174+
175175 for root , dirs , files in os .walk (modules_dir ):
176176 if 'buildingblock' in root :
177177 buildingblock_path = Path (root )
178178 readme_path = buildingblock_path / 'README.md'
179179 logo_path = buildingblock_path / 'logo.png'
180-
180+
181181 if readme_path .exists () and not logo_path .exists ():
182182 frontmatter = parse_readme_frontmatter (readme_path )
183183 if frontmatter :
184184 platform = get_platform_from_frontmatter (frontmatter )
185185 name = frontmatter .get ('name' , 'Unknown' )
186186 description = frontmatter .get ('description' , '' )
187-
187+
188188 # Get relative path from modules directory
189189 rel_path = buildingblock_path .relative_to (modules_dir )
190-
190+
191191 missing .append ({
192192 'path' : str (rel_path ),
193193 'name' : name ,
@@ -196,21 +196,21 @@ def find_missing_logos(modules_dir):
196196 'readme_path' : str (readme_path ),
197197 'logo_path' : str (logo_path )
198198 })
199-
199+
200200 return missing
201201
202202def main ():
203203 # Get modules directory
204204 repo_root = Path (__file__ ).parent .parent .parent
205205 modules_dir = repo_root / 'modules'
206-
206+
207207 if not modules_dir .exists ():
208208 print (f"ERROR: Modules directory not found: { modules_dir } " , file = sys .stderr )
209209 sys .exit (1 )
210-
210+
211211 # Find missing logos
212212 missing_logos = find_missing_logos (modules_dir )
213-
213+
214214 # Generate prompts for each missing logo
215215 results = []
216216 for item in missing_logos :
@@ -219,7 +219,7 @@ def main():
219219 item ['platform' ] or 'generic' ,
220220 item ['description' ]
221221 )
222-
222+
223223 results .append ({
224224 'name' : item ['name' ],
225225 'platform' : item ['platform' ],
@@ -228,7 +228,7 @@ def main():
228228 'ai_prompt' : prompt_data ['ai_prompt' ],
229229 'post_processing' : prompt_data ['post_processing' ]
230230 })
231-
231+
232232 # Output as JSON for GitHub Action to consume
233233 print (json .dumps (results , indent = 2 ))
234234
0 commit comments