Create per-rule pages and link from README (#2644)

This commit is contained in:
Charlie Marsh 2023-02-07 18:15:05 -05:00 committed by GitHub
parent f1cdd108e6
commit 271e4fda8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 156 additions and 40 deletions

View file

@ -36,6 +36,12 @@ def main() -> None:
raise ValueError(msg)
content = content.replace(DOCUMENTATION_LINK, "")
# Replace all GitHub links with relative links.
content = content.replace(
"https://github.com/charliermarsh/ruff/blob/main/docs/rules/",
"rules/",
)
Path("docs").mkdir(parents=True, exist_ok=True)
# Split the README.md into sections.
@ -71,8 +77,13 @@ def main() -> None:
]
config["extra"] = {"analytics": {"provider": "fathom"}}
Path(".overrides/partials/integrations/analytics").mkdir(parents=True, exist_ok=True)
with Path(".overrides/partials/integrations/analytics/fathom.html").open("w+") as fp:
Path(".overrides/partials/integrations/analytics").mkdir(
parents=True,
exist_ok=True,
)
with Path(".overrides/partials/integrations/analytics/fathom.html").open(
"w+",
) as fp:
fp.write(FATHOM_SCRIPT)
with Path("mkdocs.yml").open("w+") as fp: