knazarov.com/toc.sh

26 lines
293 B
Bash
Raw Normal View History

2021-08-08 17:47:34 +00:00
#!/bin/bash
render() {
TITLE="$1"
DIR="$2"
find "$DIR/" -type f -name '*.md' | while read -r FN
do
echo "FILE: $(realpath $FN)"
done
}
if [ -z "$1" ]; then
echo "Missing page title"
exit 1
fi
if [ ! -d "$2" ]; then
echo "Missing source directory"
exit 1
fi
render "$1" "$2"