Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infra: Improve email and link processing and rendering in headers #2467

Merged
Prev Previous commit
Next Next commit
Infra: Support mailing list info pages as well as archives
CAM-Gerlach committed Apr 17, 2022

Unverified

This user has not yet uploaded their public signing key.
commit f9d14d3cbcc1150dcde010fb193a340e9e15c357
11 changes: 11 additions & 0 deletions pep_sphinx_extensions/pep_processor/transforms/pep_headers.py
Original file line number Diff line number Diff line change
@@ -110,12 +110,23 @@ def _process_list_url(list_url: str) -> tuple[str, str]:
if len(parts) > 6 and parts[6] in {"message", "thread"}:
url_type = parts[6]

# Mailman3 list info structure is
# https://mail.python.org/mailman3/lists/<list_name>.python.org/
elif "mailman3" in parts:
list_name = (
parts[parts.index("mailman3") + 2].removesuffix(".python.org"))

# Pipermail (Mailman) archive structure is
# https://mail.python.org/pipermail/<list_name>/<month>-<year>/<id>
elif "pipermail" in parts:
list_name = parts[parts.index("pipermail") + 1]
url_type = "message" if len(parts) > 6 else "list"

# Mailman listinfo structure is
# https://mail.python.org/mailman/listinfo/<list_name>
elif "listinfo" in parts:
list_name = parts[parts.index("listinfo") + 1]

# Not a link to a mailing list, message or thread
else:
raise ValueError("Not a link to a mailing list, message or thread")