fishtank/parse.sh

22 lines
444 B
Bash
Raw Normal View History

2024-06-05 21:58:15 +00:00
#!/bin/sh
target="$1"
cd "$(dirname "$target")"
fileName="$(basename "$target")"
sectionName="$(basename -s .md "$target" | tr '_' ' ')"
printf "\n\n# $sectionName\n"
2024-06-05 21:58:15 +00:00
while read -r line; do
echo "$line" | grep -q '^.so ' && \
file="$(echo "$line" | grep '^.so ' | cut -d' ' -f2 )" && \
[ -e "$file" ] && \
echo '```graph' && \
cat "$file" | graph-easy --boxart && \
echo '```' || \
echo "$line"
done < "$fileName"