Skip to content

Commit

Permalink
Set column width instead of using non-breaking spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Aemiii91 committed May 18, 2024
1 parent 13c1579 commit e8d0dc8
Show file tree
Hide file tree
Showing 24 changed files with 285 additions and 463 deletions.
6 changes: 3 additions & 3 deletions .github/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,12 @@ def generate_table_grid(themes) -> str:
for i, theme in enumerate(themes):
if i > 0 and i % THEMES_COLS == 0:
buffer += "</tr><tr>\n"
buffer += generate_item(theme, index=i, collect_data=True)
buffer += generate_item(theme, collect_data=True)

return apply_template(GRID_TEMPLATE, {"GRID_ITEMS": buffer})


def generate_item(theme: str, index: int = 0, collect_data: bool = False) -> str:
def generate_item(theme: str, collect_data: bool = False) -> str:
dir_path = os.path.join(THEME_DIR, theme)
is_valid, has_subdirs = validate_theme(dir_path)

Expand Down Expand Up @@ -259,7 +259,7 @@ def generate_item(theme: str, index: int = 0, collect_data: bool = False) -> str
"PREVIEW_URL": preview_url,
"RELEASE_URL": release_url,
"HISTORY_URL": history_url,
"COLUMN_SPANNER": THEMES_COLUMN_SPANNER if index < THEMES_COLS else ""
"COLUMN_WIDTH": f"{100 / THEMES_COLS:.2f}%"
}

if collect_data:
Expand Down
8 changes: 4 additions & 4 deletions .github/generate_icons.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ def get_ordered_icons() -> list[dict]:
return ordered_icons


def generate_icon_pack_table(icon_packs: list[IconPack], cols: int = ICONS_COLS) -> str:
def generate_icon_pack_table(icon_packs: list[IconPack]) -> str:
current_path = os.path.join(PAGES_ICONS_DIR, ".")
output = "<table align=center><tr>\n\n"

for i, icon_pack in enumerate(icon_packs):
if i > 0 and i % cols == 0:
if i > 0 and i % ICONS_COLS == 0:
output += "</tr><tr>\n"
output += generate_icon_pack_entry(current_path, icon_pack, index=i)

Expand All @@ -71,7 +71,7 @@ def generate_icon_pack_entry(current_path: str, icon_pack: IconPack, index: int

ensure_has_icon_preview(icon_pack.path)

output = f"""\n<td valign="top">\n\n[![{icon_pack.name}]({urlencode(rel_path(preview_path, current_path))})]({icon_pack.preview_url} "Click to see the full icon pack preview page")\n\n**{icon_pack.name}**\n\n"""
output = f"""\n<td valign="top" width="{100 / ICONS_COLS:.2f}%">\n\n[![{icon_pack.name}]({urlencode(rel_path(preview_path, current_path))})]({icon_pack.preview_url} "Click to see the full icon pack preview page")\n\n**{icon_pack.name}**\n\n"""

dn_text = f"Download theme" if icon_pack.is_theme else f"Download icon pack"
dn_link = f"[{dn_text}]({icon_pack.release_url} \"{icon_pack.theme if icon_pack.is_theme else icon_pack.name}\")"
Expand All @@ -90,7 +90,7 @@ def generate_icon_pack_entry(current_path: str, icon_pack: IconPack, index: int
icon_count = sum(os.path.isfile(f"{icon_pack.path}/{icon}.png") for icon in ALL_ICONS)
output += f"{dn_link} <sub><sup>{NB_SPACER} {icon_count / len(ALL_ICONS) * 100:.0f}%{NB_SPACE}complete</sup> {NB_SPACER} {readme}</sub>"

output += f"\n\n{ICONS_COLUMN_SPANNER if index < ICONS_COLS else ''}<br/></td>\n\n"
output += f"\n\n</td>\n\n"

return output

Expand Down
3 changes: 1 addition & 2 deletions .github/template/item.template.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
<td align="center" valign="top">
$COLUMN_SPANNER<br/>
<td align="center" valign="top" width="$COLUMN_WIDTH">
<a href="$RELEASE_URL">
<img title="$TITLE" width="480px" src="$PREVIEW_URL" /><br/>
<b>$NAME</b>
Expand Down
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@
Do you want to share your own custom themes with the community? <sup><sub>❤️</sub></sup> [Click here !](CONTRIBUTING.md)

<table align="center"><tr>
<td align="center" valign="top">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Fairy-Type%20by%20UnBurn.zip">
<img title="Super effective" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Fairy-Type%20by%20UnBurn/preview.png" /><br/>
<b>Fairy-Type</b>
Expand All @@ -104,8 +103,7 @@ Do you want to share your own custom themes with the community? <sup><sub>❤️



<td align="center" valign="top">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/AnalogPhosphor%20%283-pack%29%20by%20trash.zip">
<img title="AnalogPhosphor (3-pack) by trash" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/AnalogPhosphor%20%283-pack%29%20by%20trash/preview.png" /><br/>
<b>AnalogPhosphor (3-pack)</b>
Expand All @@ -118,8 +116,7 @@ Do you want to share your own custom themes with the community? <sup><sub>❤️



<td align="center" valign="top">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Game%20Boy%20Scouts%20by%20UnBurn.zip">
<img title="For the Adventurer" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Game%20Boy%20Scouts%20by%20UnBurn/preview.png" /><br/>
<b>Game Boy Scouts</b>
Expand All @@ -140,8 +137,7 @@ Do you want to share your own custom themes with the community? <sup><sub>❤️
## Recently Updated Themes

<table align="center"><tr>
<td align="center" valign="top">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Capcom%20SNK%20%28Handheld%20Filter%29%20by%20Sheezie.zip">
<img title="Capcom & SNK theme" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Capcom%20SNK%20%28Handheld%20Filter%29%20by%20Sheezie/preview.png" /><br/>
<b>Capcom SNK (Handheld Filter)</b>
Expand All @@ -154,8 +150,7 @@ Do you want to share your own custom themes with the community? <sup><sub>❤️



<td align="center" valign="top">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Silky%20Remix%20SUPER%20GAME%20BOY%20by%20MLOPEZMAD.zip">
<img title="Silky Remix SUPER GAME BOY by MLOPEZMAD" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Silky%20Remix%20SUPER%20GAME%20BOY%20by%20MLOPEZMAD/preview.png" /><br/>
<b>Silky Remix SUPER GAME BOY</b>
Expand All @@ -168,8 +163,7 @@ Do you want to share your own custom themes with the community? <sup><sub>❤️



<td align="center" valign="top">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Mucha%20Miyoo%20by%20LamiaLazuli.zip">
<img title="Mucha Miyoo by LamiaLazuli" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Mucha%20Miyoo%20by%20LamiaLazuli/preview.png" /><br/>
<b>Mucha Miyoo</b>
Expand Down
36 changes: 12 additions & 24 deletions generated/custom/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@

*Page 1 of 13 — 156 items available*
<table align="center"><tr>
<td align="center" valign="top">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Fairy-Type%20by%20UnBurn.zip">
<img title="Super effective" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Fairy-Type%20by%20UnBurn/preview.png" /><br/>
<b>Fairy-Type</b>
Expand All @@ -81,8 +80,7 @@
</sub>
</td>

<td align="center" valign="top">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Game%20Boy%20Scouts%20by%20UnBurn.zip">
<img title="For the Adventurer" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Game%20Boy%20Scouts%20by%20UnBurn/preview.png" /><br/>
<b>Game Boy Scouts</b>
Expand All @@ -93,8 +91,7 @@
</sub>
</td>

<td align="center" valign="top">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/AnalogPhosphor%20%283-pack%29%20by%20trash.zip">
<img title="AnalogPhosphor (3-pack) by trash" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/AnalogPhosphor%20%283-pack%29%20by%20trash/preview.png" /><br/>
<b>AnalogPhosphor (3-pack)</b>
Expand All @@ -106,8 +103,7 @@
</td>

</tr><tr>
<td align="center" valign="top">
<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Dark%20Onion%20by%20Alpatov%20Danila.zip">
<img title="Unlike the Light Onion, that one is dark" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Dark%20Onion%20by%20Alpatov%20Danila/preview.png" /><br/>
<b>Dark Onion</b>
Expand All @@ -118,8 +114,7 @@
</sub>
</td>

<td align="center" valign="top">
<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/win98%20by%20kyhynngy_oyuur.zip">
<img title="win98 by kyhynngy_oyuur" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/win98%20by%20kyhynngy_oyuur/preview.png" /><br/>
<b>win98</b>
Expand All @@ -130,8 +125,7 @@
</sub>
</td>

<td align="center" valign="top">
<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Capcom%20SNK%20%28Handheld%20Filter%29%20by%20Sheezie.zip">
<img title="Capcom & SNK theme" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Capcom%20SNK%20%28Handheld%20Filter%29%20by%20Sheezie/preview.png" /><br/>
<b>Capcom SNK (Handheld Filter)</b>
Expand All @@ -143,8 +137,7 @@
</td>

</tr><tr>
<td align="center" valign="top">
<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Shallot%20by%20Cyberbellum.zip">
<img title="Minimalist theme, inspired by Aemiii91's Analogue theme." width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Shallot%20by%20Cyberbellum/preview.png" /><br/>
<b>Shallot</b>
Expand All @@ -155,8 +148,7 @@
</sub>
</td>

<td align="center" valign="top">
<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Silky%20Remix%20SUPER%20GAME%20BOY%20by%20MLOPEZMAD.zip">
<img title="Silky Remix SUPER GAME BOY by MLOPEZMAD" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Silky%20Remix%20SUPER%20GAME%20BOY%20by%20MLOPEZMAD/preview.png" /><br/>
<b>Silky Remix SUPER GAME BOY</b>
Expand All @@ -167,8 +159,7 @@
</sub>
</td>

<td align="center" valign="top">
<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/CleanOnionGB%20by%20KulhyCZ.zip">
<img title="Clean" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/CleanOnionGB%20by%20KulhyCZ/preview.png" /><br/>
<b>CleanOnionGB</b>
Expand All @@ -180,8 +171,7 @@
</td>

</tr><tr>
<td align="center" valign="top">
<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Power%20Onions%20OS%20by%20LeonardoDaPinchy.zip">
<img title="A Mighty Morphing Power Rangers Theme" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Power%20Onions%20OS%20by%20LeonardoDaPinchy/preview.png" /><br/>
<b>Power Onions OS</b>
Expand All @@ -192,8 +182,7 @@
</sub>
</td>

<td align="center" valign="top">
<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Mucha%20Miyoo%20by%20LamiaLazuli.zip">
<img title="Mucha Miyoo by LamiaLazuli" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Mucha%20Miyoo%20by%20LamiaLazuli/preview.png" /><br/>
<b>Mucha Miyoo</b>
Expand All @@ -204,8 +193,7 @@
</sub>
</td>

<td align="center" valign="top">
<br/>
<td align="center" valign="top" width="33.33%">
<a href="https://raw.githubusercontent.com/OnionUI/Themes/main/release/Miyoo%20x%20Rilakkuma%20Pink%21%20by%20Jasminum%20C.zip">
<img title="A lovely pink theme for Rilakkuma lovers" width="480px" src="https://raw.githubusercontent.com/OnionUI/Themes/main/themes/Miyoo%20x%20Rilakkuma%20Pink%21%20by%20Jasminum%20C/preview.png" /><br/>
<b>Miyoo X Rilakkuma Pink!</b>
Expand Down
Loading

0 comments on commit e8d0dc8

Please sign in to comment.