Hmm, that's not quite what I want in that case - I've used Pandoc before but I want pretty strict control over the way things are converted since I use my project to build books where layout is almost as important as the content. That's why I went for manual pagination and page-by-page conversion with PhantomJS rather than using Pandoc.
Sure, and with PDFs that makes sense. But with ePub, you're going to lose a lot of control anyway, so it's not obvious to me to what extent you can achieve the effect you want, even with a custom tool.