Skip to content

Commit

Permalink
Fix a Few Formatting Problems
Browse files Browse the repository at this point in the history
  • Loading branch information
Bibo-Joshi committed May 20, 2024
1 parent d799828 commit ff1224c
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions ptb_changelog_helper/changelog.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,14 @@ def as_md(self, exclude_users: Collection[User]) -> str:

def as_html(self, exclude_users: Collection[User]) -> str:
"""Returns the change block as HTML."""
return f"<b>{self.title}</b>\n" + "\n".join(
return f"<b>{self.title}</b>\n\n" + "\n".join(
f"• {change.as_html(exclude_users)}" for change in self.changes
)

def as_rst(self, exclude_users: Collection[User]) -> str:
"""Returns the change block as reStructuredText."""
return f"{self.title}\n\n" + "\n".join(
f" - {change.as_rst(exclude_users)}" for change in self.changes
return f"{self.title}\n{'-' * len(self.title)}\n\n" + "\n".join(
f"- {change.as_rst(exclude_users)}" for change in self.changes
)


Expand Down Expand Up @@ -272,9 +272,10 @@ def as_md(self, exclude_users: Collection[User]) -> str:
def as_html(self, exclude_users: Collection[User]) -> str:
"""Returns the changelog as HTML."""
header = (
f"<b>We've just released v{self.version}.</b>\n\n"
"Thank you to everyone who contributed to this release.\n\n"
"As usual, upgrade using <code>pip install -U python-telegram-bot</code>."
f"<b>We've just released v{self.version}.</b>\n"
"Thank you to everyone who contributed to this release.\n"
"As usual, upgrade using <code>pip install -U python-telegram-bot</code>.\n\n"
"For the full list of changes and improvements, please see the below changelog."
)
changes = "\n\n".join(
block.as_html(exclude_users) for block in self._sorted_blocks if block.has_changes()
Expand All @@ -286,8 +287,8 @@ def as_rst(self, exclude_users: Collection[User]) -> str:
title = f"Version {self.version}"
header = (
f"{title}\n{'=' * len(title)}\n\n"
f"Released {self.date.isoformat()}\n\n"
"This is the technical changelog for version {self.version}. More elaborate "
f"*Released {self.date.isoformat()}*\n\n"
f"This is the technical changelog for version {self.version}. More elaborate "
"release notes can be found in the news channel `@pythontelegrambotchannel "
"<https://t.me/pythontelegrambotchannel>`_."
)
Expand Down

0 comments on commit ff1224c

Please sign in to comment.