@@ -360,9 +360,13 @@ def process_file(self, markdown_file_path):
360
360
with open (markdown_file_path , 'w' , encoding = 'utf8' ) as markdown_file :
361
361
markdown_file .write (processed_markdown_content )
362
362
363
- def process_all_files (self , list_of_files ):
363
+ def process_all_files (self , list_of_files : list , project_path : str ):
364
364
threads = []
365
365
for markdown_file_path in list_of_files :
366
+ if isinstance (markdown_file_path , str ):
367
+ markdown_file_path = Path (markdown_file_path )
368
+ if project_path :
369
+ markdown_file_path = Path (self .working_dir / markdown_file_path .relative_to (Path (project_path / self .config ['src_dir' ])))
366
370
process_file_thread = threading .Thread (target = self .process_file ,
367
371
args = [markdown_file_path ])
368
372
process_file_thread .start ()
@@ -393,8 +397,8 @@ def apply(self):
393
397
394
398
self .repo_web_url = self ._get_repo_web_url ()
395
399
if self .context ['only_partial' ]:
396
- self .process_all_files (self .context ['only_partial' ])
400
+ self .process_all_files (self .context ['only_partial' ], self . project_path )
397
401
else :
398
- self .process_all_files (self .working_dir .rglob ('*.md' ))
402
+ self .process_all_files (self .working_dir .rglob ('*.md' ), "" )
399
403
400
404
self .logger .info ('Preprocessor applied' )
0 commit comments