mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-22 19:34:23 +00:00
Minor improvements to the docs (#2371)
This commit is contained in:
parent
b5816634b3
commit
69e20c4554
2 changed files with 23 additions and 13 deletions
|
@ -15,12 +15,22 @@ SECTIONS: list[tuple[str, str]] = [
|
|||
("FAQ", "faq.md"),
|
||||
]
|
||||
|
||||
DOCUMENTATION_LINK: str = (
|
||||
"This README is also available as [documentation](https://beta.ruff.rs/docs/)."
|
||||
)
|
||||
|
||||
|
||||
def main() -> None:
|
||||
"""Generate an MkDocs-compatible `docs` and `mkdocs.yml`."""
|
||||
with Path("README.md").open(encoding="utf8") as fp:
|
||||
content = fp.read()
|
||||
|
||||
# Remove the documentation link, since we're _in_ the docs.
|
||||
if DOCUMENTATION_LINK not in content:
|
||||
msg = "README.md is not in the expected format."
|
||||
raise ValueError(msg)
|
||||
content = content.replace(DOCUMENTATION_LINK, "")
|
||||
|
||||
Path("docs").mkdir(parents=True, exist_ok=True)
|
||||
|
||||
# Split the README.md into sections.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue