weblate/scripts/compact-changes.py
Michal Čihař 51d10e8b63 fix: remove empty rubric from changes upon release
Doing that manually fails, so automate that.
2025-02-21 13:19:19 +01:00

22 lines
410 B
Python
Executable file

#!/usr/bin/env python3
# Copyright © Michal Čihař <michal@weblate.org>
#
# SPDX-License-Identifier: GPL-3.0-or-later
import re
from pathlib import Path
COMPACT_RE = re.compile(
r""".. rubric:: .*
.. rubric::""",
re.MULTILINE,
)
ROOT_DIR = Path(__file__).parent.parent
file = ROOT_DIR / "docs" / "changes.rst"
content = file.read_text()
file.write_text(COMPACT_RE.sub(".. rubric::", content))