@@ -101,6 +101,12 @@ def parse_functions(self):
101101 for issue in type_info ['issues' ]:
102102 issue ['description_html' ] = utils .to_html (issue ['description' ], single_paragraph = True )
103103
104+ if 'preview_images' in type_info :
105+ function ["has_preview_image" ] = True
106+ for preview_img in type_info ['preview_images' ]:
107+ if 'description' in preview_img :
108+ preview_img ['description_html' ] = utils .to_html (preview_img ['description' ], single_paragraph = True )
109+
104110 if ('returns' in type_info ) and ('description' in type_info ['returns' ]):
105111 type_info ['returns' ]['description_html' ] = utils .to_html (type_info ['returns' ]['description' ], single_paragraph = True )
106112
@@ -190,17 +196,15 @@ def parse_function_preview_images(self, function):
190196 base_name = os .path .basename (real_path )
191197 output_path = os .path .join (preview_images_folder , base_name )
192198
193- # Ignore if destination file already exists
194- if os .path .exists (output_path ):
195- continue
196-
197- shutil .copyfile (real_path , output_path )
198- self .logger .info (f"Created function preview image { output_path } " )
199+ # Copy only if not already copied
200+ if not os .path .exists (output_path ):
201+ shutil .copyfile (real_path , output_path )
202+ self .logger .info (f"Created function preview image { output_path } " )
199203
200204 preview_images [type_name ].append ({
201205 'real_path' : real_path ,
202206 'path_html' : f"/function_images/{ base_name } " ,
203- 'description' : preview_img .get ('description' ),
207+ 'description' : preview_img .get ('description' , '' ),
204208 })
205209 type_info ['preview_images' ] = preview_images [type_name ]
206210
0 commit comments