Created
April 17, 2024 17:11
-
-
Save ejfox/e97f19d4232ef839dddc93bc3ae87fe8 to your computer and use it in GitHub Desktop.
Usage: `./files-to-md.sh *`
This file contains hidden or 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
#!/bin/bash | |
for file in "$@"; do | |
# Extract filename with extension | |
filename=$(basename "$file") | |
# Print Markdown header with filename (including extension) | |
echo "## $filename" | |
echo '```' | |
cat "$file" | |
echo '```' | |
echo "" | |
done |
Author
ejfox
commented
Apr 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment