Skip to content

Commit

Permalink
Can we link users to plugin docs?
Browse files Browse the repository at this point in the history
  • Loading branch information
snejus committed Dec 4, 2024
1 parent e945b11 commit ea3961b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions extra/release.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
BASE = Path(__file__).parent.parent.absolute()
PYPROJECT = BASE / "pyproject.toml"
CHANGELOG = BASE / "docs" / "changelog.rst"
DOCS = "https://beets.readthedocs.io/en/stable"

version_header = r"\d+\.\d+\.\d+ \([^)]+\)"
RST_LATEST_CHANGES = re.compile(
Expand All @@ -28,7 +29,7 @@
RST_REPLACEMENTS: list[Replacement] = [
(r"(?<=\n) {3,4}(?=\*)", " "), # fix indent of nested bullet points ...
(r"(?<=\n) {5,6}(?=[\w:`])", " "), # ... and align wrapped text indent
(r"(?<=[\s(])`([^`]+)`(?=[^_])", r"``\1``"), # ticks with verbatim ranges.
(r"(?<=[\s(])(`[^`]+`)(?!_)", r"`\1`"), # double quotes for inline code
(r":bug:`(\d+)`", r":bug: (#\1)"), # Issue numbers.
(r":user:`(\w+)`", r"\@\1"), # Users.
]
Expand All @@ -37,8 +38,8 @@
(r"^ +( - )", r"\1"), # adjust nested bullet points indent
(r"^(\w[^\n]{,80}):(?=\n\n[^ ])", r"### \1"), # format section headers
(r"^(\w[^\n]{81,}):(?=\n\n[^ ])", r"**\1**"), # and bolden too long ones
(r"^- `/?plugins/(\w+)`:?", r"- Plugin **`\1`**:"), # highlight plugins
(r"^- `(\w+)-cmd`:?", r"- Command **`\1`**:"), # highlight commands
(r"^- `/?plugins/(\w+)`:?", rf"- Plugin [\1]({DOCS}/plugins/\1.html):"),
(r"^- `(\w+)-cmd`:?", rf"- Command [\1]({DOCS}/reference/cli.html#\1):"),
(r"### [^\n]+\n+(?=### )", ""), # remove empty sections
]
order_bullet_points = partial(
Expand Down
4 changes: 2 additions & 2 deletions test/test_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def rst_changelog():
def md_changelog():
return r"""### New features
- Command **`list`**: Update.
- Plugin **`substitute`**: Some substitute multi-line change. :bug: (\#5467)
- Command [list](https://beets.readthedocs.io/en/stable/reference/cli.html#list): Update.
- Plugin [substitute](https://beets.readthedocs.io/en/stable/plugins/substitute.html): Some substitute multi-line change. :bug: (\#5467)
You can do something with this command:
Expand Down

0 comments on commit ea3961b

Please sign in to comment.