Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
TOsmanov committed Jul 19, 2024
1 parent 443b516 commit 17643be
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions foliant/preprocessors/includes.py
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ def process_includes(
:returns: Markdown content with resolved includes
'''

recipient_md_path = markdown_file_path.relative_to(self.working_dir).as_posix()
recipient_md_path = f'{self.src_dir}/{markdown_file_path.relative_to(self.working_dir).as_posix()}'
markdown_file_path = markdown_file_path.resolve()

self.logger.debug(f'Processing Markdown file: {markdown_file_path}')
Expand Down Expand Up @@ -1175,7 +1175,7 @@ def process_includes(
if self.includes_map.get(recipient_md_path) == None :
self.includes_map[recipient_md_path] = []

self.includes_map[recipient_md_path].append({"path": donor_md_path})
self.includes_map[recipient_md_path].append(donor_md_path)

else:
processed_content_part = content_part
Expand Down Expand Up @@ -1224,6 +1224,7 @@ def apply(self):
for source_file_path in self.working_dir.rglob(source_files_extension):
with open(source_file_path, encoding='utf8') as source_file:
source_content = source_file.read()

processed_content = self.process_includes(
source_file_path,
source_content,
Expand Down

0 comments on commit 17643be

Please sign in to comment.