I guess I'll see how much i may have changed these scripts after things ot running
According to the remarkable-contents history, I cleaned up the templates in that directory (which would be necessary to get good pdf exports) a day after the last commit here. That implies that these scripts were working ok then.
I'll document what I do to get re-set up here this time.