Skip to content

Commit 818d598

Browse files
committed
add: type processing
1 parent a5af694 commit 818d598

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

foliant/preprocessors/showcommits.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,13 @@ def process_file(self, markdown_file_path):
360360
with open(markdown_file_path, 'w', encoding='utf8') as markdown_file:
361361
markdown_file.write(processed_markdown_content)
362362

363-
def process_all_files(self, list_of_files):
363+
def process_all_files(self, list_of_files: list, project_path: str):
364364
threads = []
365365
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'])))
366370
process_file_thread = threading.Thread(target=self.process_file,
367371
args=[markdown_file_path])
368372
process_file_thread.start()
@@ -393,8 +397,8 @@ def apply(self):
393397

394398
self.repo_web_url = self._get_repo_web_url()
395399
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)
397401
else:
398-
self.process_all_files(self.working_dir.rglob('*.md'))
402+
self.process_all_files(self.working_dir.rglob('*.md'), "")
399403

400404
self.logger.info('Preprocessor applied')

0 commit comments

Comments
 (0)