Skip to content

Commit

Permalink
fix: doc_genがwindowsだと\なせいで動かない
Browse files Browse the repository at this point in the history
  • Loading branch information
yupix committed Nov 25, 2023
1 parent 50fb89c commit 843b19d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions doc_gen.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import importlib
import inspect
from pathlib import PurePath
import subprocess
from typing import TypedDict

Expand All @@ -19,7 +20,7 @@ def get_defined_functions_and_classes(module):


class IGenerateSphinx(TypedDict):
module_path: str
module_path: PurePath
module_name: str
functions: list[str]
classes: list[str]
Expand Down Expand Up @@ -51,7 +52,7 @@ def add_data(_data: IGenerateSphinx, add_to: list):
for i in data:
add_to = "__OTHER"
for category in hierarchy.keys():
if category in i["module_path"]:
if PurePath(category).as_posix() in i["module_path"].as_posix():
add_to = hierarchy[category]
add_data(i, tmp[add_to])

Expand Down Expand Up @@ -80,7 +81,7 @@ def generate_documentation(base_path, output_file, hierarchy, exclude_files=[]):
if functions or classes:
items.append(
{
"module_path": module_path,
"module_path": PurePath(module_path),
"module_name": module_import_path,
"functions": functions,
"classes": classes,
Expand Down

0 comments on commit 843b19d

Please sign in to comment.