Skip to content

Commit

Permalink
Remove unneeded regex for admonitions
Browse files Browse the repository at this point in the history
  • Loading branch information
jayqi committed Mar 26, 2024
1 parent baed976 commit 11eb697
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions docs/hooks.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import inspect
import logging
from pathlib import Path
import re
import textwrap

from typer.testing import CliRunner
Expand All @@ -15,29 +14,6 @@
REPO_ROOT = Path(__file__).resolve().parents[1]


# def _github_alert_to_admonition(markdown: str):
# """Converts GitHub alert blockquote syntax to admonition syntax."""
# # Ungreedy regex https://stackoverflow.com/a/7124976
# pattern = re.compile(r"> \[\!(?P<type>\w+)\]\n(?P<content>.+?)(?=\n[^>])", re.DOTALL)
# match = pattern.search(markdown)
# alert_type = match.group("type")
# alert_content = "\n".join(
# line.removeprefix("> ") for line in match.group("content").split("\n")
# )
# template = textwrap.dedent(
# """\
# !!! {admonition_type}

# {content}
# """
# )
# admonition = template.format(
# admonition_type=alert_type.lower(),
# content=textwrap.indent(alert_content, " "),
# )
# return pattern.sub(admonition, markdown)


def _read_readme():
readme_path = REPO_ROOT / "README.md"
logger.info("Reading README from %s", readme_path)
Expand All @@ -50,7 +26,6 @@ def _read_readme():
"./HISTORY.md",
"changelog.md",
)
# readme_text = _github_alert_to_admonition(readme_text)
return readme_text


Expand Down

0 comments on commit 11eb697

Please sign in to comment.