EPUB tools in Mylyn 3.13

I realized it’s been quite a while since I wrote about building electronic books using the tools in Mylyn Docs and figured it is about time I published an update. It’s been pretty quiet around this project. I’ve had a couple of e-mails with request for support and a few bugs reported, most by myself. So I decided to have a look at the download numbers. The Mylyn Docs EPUB tools have not been part of the Eclipse release trains, so anyone installing the feature must be doing so actively. There was a total of 7899 downloads from the Mylyn 3.12 release (June 2014) and so far 2304 downloads from the latest 3.13 release (September 2014) — which I figure is not bad at all. I guess the silence is because there is little trouble with it. Anyway, a few bugs has been fixed and some new features has been added to simplify EPUB building. Here’s the summary.

Earlier this year I did some major changes in order to future proof the code and make ready for EPUB 3 support. In short the following was done:

  • OPSPublication was moved to Publication in order to make sense for both EPUB 2 and 3.
  • OPS2Publication was moved to OPSPublication as there is no OPS in EPUB 3.
  • EPUB2Bean was moved to public API and renamed to PublicationProxy.
  • Public API was cleaned up and documentation added where lacking.

These were API breaking changes and the version number was bumped to 2.0.0.

In addition MIME type detection was been greatly improved through the use of Apache Tika. In practice this does not matter much for EPUB 2 publications as the allowed content types are quite limited. But my dodgy content detection code from earlier could be removed and this implementation is much more trustworthy.

The biggest improvement came with the 3.13 release of Mylyn. It is now possible to simply specify an Eclipse table of contents file as a source for content declaration. This allows you to single source this part of the manifest. We use this mechanism at a project I’m working on and it has turned out to be real timesaver. Here’s another example:

This is the actual Ant code used to build the Mylyn Docs EPUB tools user guide as a book at the same time as the Eclipse Help is built. The Ant script is referenced in the pom-file and called by Maven during the generate-sources phase. You’ll find a mirror of the code at GitHub if you’d like a closer look. An example of the resulting book can be downloaded from http://blog.resheim.net/files/Building_EPUBs_with_Eclipse.epub

I’m planning to add support for EPUB 3, but so far there is no real need and nobody has requested it. However one feature I’ll probably will add, is to the wiki markup to HTML generation mechanism of Mylyn Docs. At the project just mentioned we use a lot of LaTeX math in our Markdown documents, so we would like these to be converted to MathML when the HTML is generated. Many reading systems are capable of displaying MathML properly, it is an required part of implementing EPUB 2 support. So we would be able to create e-books with beautifully rendered math straight from wiki markup.

…until next time.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.