reworked to use a single plugin hook instead of peacemeal. much more reliable now. Needs a different dokuwiki patch to work, but its a 1 liner