@@ -40,13 +40,13 @@ def _parse_package(source: Path):
40
40
41
41
def _generate_reference (source : Path , destination : Path , ext : str ):
42
42
"""Generate reference."""
43
- nav_items : Dict [str , List [str ]] = {"Code Reference " : []}
43
+ nav_items : Dict [str , List [str ]] = {"API " : []}
44
44
# generate reference content
45
45
for module_name , aliases in _parse_package (source ):
46
46
for alias in aliases :
47
47
_write_ref_content (destination / f"{ module_name } .{ ext } " , module_name , alias .name )
48
48
if ext == "md" :
49
- nav_items ["Code Reference " ].append (f"references/{ module_name } .md" )
49
+ nav_items ["API " ].append (f"references/{ module_name } .md" )
50
50
return nav_items
51
51
52
52
@@ -65,6 +65,9 @@ def _update_mkdocs_config(source: Path, destination: Path, nav_items: Dict[str,
65
65
66
66
def _gen_md_docs (source : Path , refs_path : Path ):
67
67
"""Generate Markdown docs."""
68
+ # remove existing markdown files
69
+ for md_files in (source / "docs/references" ).glob ("*.md" ):
70
+ md_files .unlink ()
68
71
nav_items = _generate_reference (source / "src/validators/__init__.py" , refs_path , "md" )
69
72
# backup mkdocs config
70
73
_update_mkdocs_config (source / "mkdocs.yaml" , source / "mkdocs.bak.yaml" , nav_items )
@@ -166,7 +169,7 @@ def package(source: Path):
166
169
if len (argv ) != 2 :
167
170
quit (exit_code )
168
171
169
- if argv [1 ] == "package " :
172
+ if argv [1 ] == "pkg " :
170
173
exit_code = package (project_root )
171
174
if argv [1 ] == "docs" :
172
175
exit_code = generate_documentation (
0 commit comments