diff --git a/src/parse_apiref.py b/src/parse_apiref.py index dbd0a31..c25503f 100644 --- a/src/parse_apiref.py +++ b/src/parse_apiref.py @@ -407,5 +407,8 @@ def parseAll(dir: str) -> list[NoirValue]: valuesForFiles[value.path].append(markdown) for path, markdown in valuesForFiles.items(): - with open(f"../apiref/{os.path.basename(path)}.md", "w", encoding="utf-8") as file: + writePath = f"../apiref/{os.path.relpath(path)}" + os.makedirs(os.path.dirname(writePath), exist_ok = True) + + with open(f"{writePath}.md", "w", encoding="utf-8") as file: file.write("\n\n---\n\n".join(markdown)) \ No newline at end of file