Skip to content

Commit

Permalink
Fix Layout
Browse files Browse the repository at this point in the history
  • Loading branch information
harilvfs committed Jan 25, 2025
1 parent 04d7413 commit d045a45
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions scripts/generate_readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,17 @@
README_FILE = "README.md"

def generate_markdown(images):
"""Generates Markdown grid format for images with four images per row."""
"""Generates Markdown for a responsive grid of four images per row."""
rows = []
row = []
for i, img in enumerate(images, start=1):
row.append(f"<img src='{img}' alt='img' width='200px'>")
row.append(f"<img src='{img}' alt='Wallpaper' width='250px' style='margin: 10px;'>") # Adjust width as needed
if i % 4 == 0:
rows.append("| " + " | ".join(row) + " |")
rows.append("<div style='display: flex; justify-content: center; gap: 10px;'>\n" + "\n".join(row) + "\n</div>")
row = []
if row:
rows.append("| " + " | ".join(row) + " |")
separator = "| " + " | ".join(["---"] * 4) + " |\n"
return "\n".join(["\n" + separator] + rows)
if row:
rows.append("<div style='display: flex; justify-content: center; gap: 10px;'>\n" + "\n".join(row) + "\n</div>")
return "\n".join(rows)

def main():
images = [
Expand All @@ -41,4 +40,3 @@ def main():

if __name__ == "__main__":
main()

0 comments on commit d045a45

Please sign in to comment.