aboutsummaryrefslogtreecommitdiffstats
path: root/docs/utils.py
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2022-11-10 22:42:18 +0400
committerGravatar Hassan Abouelela <[email protected]>2022-11-10 22:42:18 +0400
commita7e908a51d62021e4b8d49af73da605c2dfc73e7 (patch)
tree6256b0d3f7302ac08638c2e576fa00629f76c79b /docs/utils.py
parentAdd Support For Attributes In Docstrings (diff)
Clean Up Formatting Of Project Name In Docs
Signed-off-by: Hassan Abouelela <[email protected]>
Diffstat (limited to '')
-rw-r--r--docs/utils.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/docs/utils.py b/docs/utils.py
index ba6c8e34..3f58e767 100644
--- a/docs/utils.py
+++ b/docs/utils.py
@@ -160,9 +160,13 @@ def cleanup() -> None:
content = file.read_text(encoding="utf-8").splitlines(keepends=True)
# Rename the extension to be less wordy
- # Example: pydis_core.exts -> pydis_core Exts
- title = content[0].split()[0].strip().replace("pydis_core.", "").replace(".", " ").title()
- title = f"{title}\n{'=' * len(title)}\n\n"
+ # Example: pydis_core.exts -> Exts
+ title = content[0].split()[0].strip().replace("\\", "").replace("pydis_core.", "").replace(".", " ")
+ if "pydis_core" in title:
+ # Root title: pydis_core -> pydis core
+ title = title.replace("_", " ")
+
+ title = f"{title.title()}\n{'=' * len(title)}\n\n"
content = title, *content[3:]
file.write_text("".join(content), encoding="utf-8")