Skip to content

Commit

Permalink
🐛 fix(readme): Remove extra newlines and trim whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
thibaultyou committed Sep 30, 2024

Verified

This commit was signed with the committer’s verified signature.
Randoooom Fritz Leo Ochsmann
1 parent 7298157 commit 112d154
Showing 2 changed files with 11 additions and 5 deletions.
7 changes: 6 additions & 1 deletion .github/scripts/update_views.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import re
import yaml
import logging
from jinja2 import Environment, FileSystemLoader
@@ -87,9 +88,13 @@ def update_views():
# Generate README content using the template and write to file
logger.info("Generating README content")
readme_content = readme_template.render(categories=sorted_categories, format_category=format_category)

# Remove multiple consecutive newlines
readme_content = re.sub(r'\n{3,}', '\n\n', readme_content)

readme_path = 'README.md'
with open(readme_path, 'w') as f:
f.write(readme_content)
f.write(readme_content.strip()) # Use strip() to remove leading/trailing whitespace
logger.info(f"Wrote README content to {readme_path}")

logger.info("update_views process completed")
9 changes: 5 additions & 4 deletions .github/templates/readme_template.md
Original file line number Diff line number Diff line change
@@ -4,14 +4,15 @@ Welcome to the **Prompt Library**. This repository contains a collection of AI p

## 🗂️ Categories

{% for category, prompts in categories.items() %}
{%- for category, prompts in categories.items() %}

### {{ format_category(category) }}

{% for prompt in prompts %}
{%- for prompt in prompts %}

- [{{ prompt.title }}]({{ prompt.path }}) - {{ prompt.description }}
{% endfor %}
{% endfor %}
{%- endfor %}
{%- endfor %}

## 🚀 Getting Started

0 comments on commit 112d154

Please sign in to comment.