|
21 | 21 |
|
22 | 22 | def build_docfx( |
23 | 23 | current_dir: Union[str, pathlib.Path], |
24 | | - repo_root: Union[str, pathlib.Path], |
25 | 24 | docs_map: Dict[str, str], |
26 | 25 | ) -> None: |
27 | 26 | current_dir = pathlib.Path(current_dir) |
28 | | - repo_root = pathlib.Path(repo_root) |
29 | 27 | output_dir = current_dir / "docs" / "_build" |
30 | 28 |
|
31 | 29 | if output_dir.exists(): |
@@ -58,7 +56,7 @@ def build_docfx( |
58 | 56 | 'gfm', |
59 | 57 | format='rst' |
60 | 58 | ) |
61 | | - (output_dir / target_filename).write_text(output) |
| 59 | + (output_dir / target_filename).write_text(output, encoding="utf-8") |
62 | 60 | else: |
63 | 61 | print(f"Warning: Source {source_path} not found.") |
64 | 62 | (output_dir / target_filename).write_text(f"# {title}\n\nContent missing.") |
@@ -95,10 +93,9 @@ def build_docfx( |
95 | 93 | if __name__ == "__main__": |
96 | 94 | parser = argparse.ArgumentParser(description="Build DocFX documentation.") |
97 | 95 | parser.add_argument("--current-dir", required=True, help="Current package directory") |
98 | | - parser.add_argument("--repo-root", required=True, help="Repository root directory") |
99 | 96 | parser.add_argument("--doc", action="append", nargs=2, metavar=("TITLE", "PATH"), help="Add a document title and its source path") |
100 | 97 |
|
101 | 98 | args = parser.parse_args() |
102 | 99 |
|
103 | 100 | docs_map = {title: path for title, path in args.doc} if args.doc else {} |
104 | | - build_docfx(args.current_dir, args.repo_root, docs_map) |
| 101 | + build_docfx(args.current_dir, docs_map) |
0 commit comments