Skip to content

Commit

Permalink
Improve line-breaking in pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
Aemiii91 authored May 18, 2024
1 parent 9e244d1 commit a8d7c5d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions .github/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,18 @@ def generate_pagination(current_page: int, num_pages: int) -> str:
buffer += """---\n\n<table align="center"><tr><td align="center" valign="top">\n\n"""

if current_page > 0:
buffer += f"[◀&nbsp;PREV&nbsp;PAGE]({format_page_filename(current_page - 1)})&nbsp;&nbsp;|&nbsp;&nbsp;"
buffer += f"[◀&nbsp;PREV&nbsp;PAGE]({format_page_filename(current_page - 1)})&nbsp;&nbsp;| &nbsp;"

for page in range(num_pages):
if page == current_page:
buffer += f"**{page + 1:02}**"
else:
buffer += f"[{page + 1:02}]({format_page_filename(page)})"
if page < num_pages - 1:
buffer += "&nbsp;&nbsp;"
buffer += " &nbsp;"

if current_page < num_pages - 1:
buffer += f"&nbsp;&nbsp;|&nbsp;&nbsp;[NEXT&nbsp;PAGE&nbsp;▶]({format_page_filename(current_page + 1)})"
buffer += f"&nbsp; |&nbsp;&nbsp;[NEXT&nbsp;PAGE&nbsp;▶]({format_page_filename(current_page + 1)})"

buffer += """</td></tr></table>"""

Expand Down

0 comments on commit a8d7c5d

Please sign in to comment.