#!/bin/bash
# A script which converts plaintext cantos from one canticle to XML formatting.
# Must be run inside canticle directory: [inferno,purgatorio,paradiso]-xml.d
# Tag scripts must be in the above directory.
# 1) word-tags.sh --- add tags to each word.
# 2) terzina-tags.sh --- add tags to each terzina
# 3) top-level-tags.sh --- add XML header; add and tags
# Check parent directory
if [[ "$(pwd | awk -F'/' '{print $NF}')" =~ inferno-xml.d|purgatorio-xml.d|paradiso-xml.d ]]; then
clear
echo "Starting..."
cp ../py-scripts.d/word-tags.py && python3 word-tags.py && rm word-tags.py
#cp ../shell-scripts.d/word-tags.sh . && ./word-tags.sh && rm word-tags.sh
cp ../shell-scripts.d/tercet-tags.sh . && ./tercet-tags.sh && rm tercet-tags.sh
cp ../shell-scripts.d/top-level-tags.sh . && ./top-level-tags.sh && rm top-level-tags.sh
fi