From 830a6b79cd881a9ddfa346ce95edde1b0cd11dda Mon Sep 17 00:00:00 2001 From: Christian Studer Date: Wed, 31 May 2023 15:25:08 +0200 Subject: [PATCH] fix: [documentation] Fixed path for the documentation README file to be written to --- documentation/generate_documentation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/documentation/generate_documentation.py b/documentation/generate_documentation.py index 8d9116ea..c6b1cc7c 100644 --- a/documentation/generate_documentation.py +++ b/documentation/generate_documentation.py @@ -2,6 +2,7 @@ import os import json import sys +from pathlib import Path module_types = ['expansion', 'export_mod', 'import_mod'] titles = ['Expansion Modules', 'Export Modules', 'Import Modules'] @@ -53,7 +54,7 @@ def write_doc(root_path): for _path, title in zip(module_types, titles): markdown.append(f'\n## {title}\n') markdown.extend(generate_doc(_path, root_path)) - with open('README.md', 'w') as w: + with open(root_path / 'README.md', 'w') as w: w.write(''.join(markdown)) @@ -65,6 +66,6 @@ def write_docs_for_mkdocs(root_path): if __name__ == '__main__': - root_path = os.path.dirname(os.path.realpath(__file__)) + root_path = Path(__file__).resolve().parent write_doc(root_path) write_docs_for_mkdocs(root_path)