gen-chapters.sh