Skip to content

Commit

Permalink
Merge pull request #22 from hgkegft/master
Browse files Browse the repository at this point in the history
Handle splitting by forward or backward slash depending on operation system
  • Loading branch information
Wytamma authored Feb 26, 2024
2 parents f2a4025 + 5fa5f28 commit 47579ed
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion write_the/commands/mkdocs/mkdocs.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import sys

from pathlib import Path
from collections import defaultdict
from write_the.utils import list_python_files
Expand Down Expand Up @@ -41,7 +43,14 @@ def write_the_mkdocs(
) or f"{code_dir.name}/{group}." in str(file):
key = group
break
module = str(file).rstrip(".py").replace("/", ".") # breaks on windows?

module = str(file).rsplit(".py")[0]
if sys.platform.startswith("win32") or sys.platform.startswith("cygwin"):
splitter = "\\"
else:
splitter = "/"
module = module.replace(splitter, ".")

references[key].append(f"::: {module}")
docs_dir = out_dir / "docs"
reference_path = docs_dir / "reference"
Expand Down

0 comments on commit 47579ed

Please sign in to comment.