#!/bin/sh
# The source seems to use level 3 headers in ALL CAPS, so make those markdown level
# 3 headers, noting that some parts seem to put things intending to be level 4 in
# ALL CAPS too, so this will need some human post processing

# clean up some typos and similar
sed -E 's/ACTION: Activate a Special Ability/ACTION: ACTIVATE A SPECIAL ABILITY/' _tmp/ccsrd.md > _tmp/ccsrd.new.md
sed -E 's/FIFTH-TIER SKILLS ANd KNOWLEDGE ABILITIES/FIFTH-TIER SKILLS AND KNOWLEDGE ABILITIES/' -i _tmp/ccsrd.new.md
sed -E 's/FANTASy/FANTASY/' -i _tmp/ccsrd.new.md

# s is here because e.g. "NPCs" is a common occurrence
sed -E "s/^[A-Z0-9s ()@'?&.,:\/-]+$/### \0/" -i _tmp/ccsrd.new.md