README overview

This commit is contained in:
Stefan Thoss
2025-06-08 08:57:36 -07:00
parent 323fead5e0
commit b84616487f
3 changed files with 244 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
#!/bin/bash
HEADER_FILE="readme-header.md"
README_FILE="README.md"
# Create or truncate the README file
> $README_FILE
# Add the header to the README file
cat $HEADER_FILE >> $README_FILE
# Loop through each directory in the current working directory
for dir in */; do
# Extract and print the directory name without the trailing slash
echo -e "\n## ${dir%/}\n" >> $README_FILE
# Loop through all PNG files in the directory and embed them in the README file
for png in "$dir"*.png; do
[ -f "$png" ] || break # Break if no more PNG files are found
echo "![${png##*/}](${png})" >> $README_FILE
done
# Print a list of .scad files in the directory
echo -e "\nModel files:\n" >> $README_FILE
find "$dir" -type f -name '*.scad' | sed "s|$dir||g" | awk '{ print "* " $0 }' >> $README_FILE
done