Skip to content

Commit

Permalink
docs: fix rst changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
camille-004 committed Dec 5, 2024
1 parent 0243fcc commit d110f08
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
project = "nanofed"
copyright = "2024, Camille Dunning"
author = "Camille Dunning"
release = "0.1.0"
release = "0.1.1"

# -- General configuration
extensions = [
Expand Down
25 changes: 23 additions & 2 deletions scripts/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,30 @@ def generate_rst_changelog(

changelog_items = []

type_headers = {
"feat": "🎁 Features",
"fix": "🐛 Bug Fixes",
"docs": "📚 Documentation",
"style": "🎨 Style",
"refactor": "♻️ Code Refactoring",
"perf": "⚡ Performance",
"test": "🧪 Tests",
"build": "📦 Build System",
"ci": "🔄 CI Changes",
"chore": "🔧 Maintenance",
"other": "📝 Other Changes",
}

for category, commits in categories.items():
if commits:
changelog_items.append(f"{category.title()}")
changelog_items.append("~" * (len(category) + 2))
header = type_headers.get(category, category.title())
changelog_items.append(f"{header}")
underline_length = (
len(header.split(" ", 1)[1])
if " " in header
else len(header)
)
changelog_items.append("~" * underline_length)
changelog_items.append("")

for commit in commits:
Expand All @@ -139,6 +159,7 @@ def generate_rst_changelog(
content = content.replace(
".. Generated automatically from git commits", changelog_section
)
return content

def generate_md_changelog(
self, version: str, categories: dict[str, list[dict[str, str]]]
Expand Down

0 comments on commit d110f08

Please sign in to comment.