Skip to content

Commit

Permalink
Remove docs/api directory before running create_api_docs script (#1730)
Browse files Browse the repository at this point in the history
  • Loading branch information
kumaranvpl authored Aug 26, 2024
1 parent 72de4ec commit a689896
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/create_api_docs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Create API documentation for a module."""

import itertools
import shutil
from importlib import import_module
from inspect import getmembers, isclass, isfunction
from pathlib import Path
Expand Down Expand Up @@ -295,6 +296,7 @@ def _generate_api_docs_for_module(root_path: Path, module_name: str) -> Tuple[st
api_summary = _get_api_summary(members_with_submodules)

api_root = root_path / "docs" / "en" / "api"
shutil.rmtree(api_root / module_name, ignore_errors=True)
api_root.mkdir(parents=True, exist_ok=True)

(api_root / ".meta.yml").write_text(API_META)
Expand Down

0 comments on commit a689896

Please sign in to comment.