-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(generate-readme.py generate-readme.yml): jvflkjfkjfrlkjlkjlkjlk…
…jflkjfdslk🧱 🧱 🧱
- Loading branch information
1 parent
d847b22
commit a1d24f7
Showing
2 changed files
with
53 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import os | ||
|
||
# Directory containing the images | ||
image_directory = 'output' | ||
|
||
# URL of the GitHub repository | ||
github_repo_url = 'https://github.com/andrewzn69/wallpapers/tree/main/' | ||
|
||
|
||
# Function to generate the README content | ||
def generate_readme(directory): | ||
readme_content = "# Wallpapers\n\n" | ||
files = os.listdir(directory) | ||
|
||
for file in files: | ||
if file.endswith('.png'): | ||
# Create the links | ||
file_name, file_extension = os.path.splitext(file) | ||
print(file_name) | ||
readme_content += f"[{file_name}]({github_repo_url}{file})\n" | ||
readme_content += f"![{file_name}]({directory}/{file})\n---\n" | ||
|
||
return readme_content | ||
|
||
|
||
# Generate the README content | ||
readme_content = generate_readme(image_directory) | ||
|
||
# Write the content to the README.md file | ||
with open('README.md', 'w') as readme_file: | ||
readme_file.write(readme_content) | ||
|
||
print("README.md generated successfully.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters