Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This looks pretty good. It's very similar to something I built [1] to scratch my own itch for some illustrated short stories I've been self-publishing.

I needed some more fine-grained control over page layout so I did go down a completely different route for generating PDFs - I do manual pagination and render the PDF pages using PhantomJS - but generating ePubs is something I've been wanting to do for a while.

Hope you don't mind me looking through your code to see how you've handled ePubs.

[1]: https://github.com/andrey-p/apocalism-js



Go for it. That's why it's open source. :-)

For BookMD, I use Pandoc [1], which is the most versatile Markdown generator in existence. Pandoc has out-of-the-box support for ePub, so I just use that.

The part where more customization is needed is if you want page breaks. For PDF output, Pandoc lets you use Latex directives in your Markdown (\newpage, etc.), so that should work fine. For ePub, I'm not actually sure what you would do, or whether you would even want the same sort of pagination.

[1]: http://johnmacfarlane.net/pandoc/


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: