Electronic publishing

Electronic books are already commonplace. The abundance of inexpensive, portable reading systems available will will surely make such formats even more popular. I've invested a lot of effort in EPUB which is one of the competing formats; one that is open, free and widely supported.

Eclipse

Eclipse is a platform particularily well suited for building integrated development environments, but can just as well be used for general applications.

Thursday, March 15, 2012

Building EPUBs with Apache Ant

The EPUB tooling that I've been working on the past year or so is about to graduate and is now a part of the Mylyn Docs project. Currently it is only available in the nightly builds. If you would like to install the tooling you may do so from the p2 repository listed. You can also built it yourself from my public git repo which is a bit ahead.

As the video in one of my earlier posts demonstrates, it is easy to create EPUBs from within Eclipse using the conversion wizard. But this method is fairly limited and lack many of the features of the Ant task. The task can easily be used from within the Eclipse, but what if you want to use it in a build which does not utilize Eclipse? As it turns out, this is quite straightforward.

In order to execute the Ant task from outside of Eclipse we need the core EPUB features along with parts of EMF and the EPUB Ant task. The following bundles are those required:
  • epub-ant
  • org.eclipse.emf.common
  • org.eclipse.emf.ecore.xmi
  • org.eclipse.emf.ecore
  • org.eclipse.mylyn.docs.epub.core
Now, epub-ant.jar is a bit special. It is packaged within org.eclipse.mylyn.docs.epub.ant. So if you build the tooling yourself, or use the nightly builds you need to dissect the bundle in order to get to the jar.

Don't feel like digging for jar files and writing Ant scripts in order to try this out? No worries. Simply clone the git repository I've set up for examples and execute Ant in the various sub-folders. It contains a couple of examples (more to come) and also have the binaries you need.

If you need more information on how to use the tooling you can clone both the examples and the Mylyn Docs repositories and build the documentation EPUB (the "book" example) in order to read it on your favorite device. And if you feel adventurous you may want to try out the reader building on this tooling. It still have a few issues, but is quite usable and will of course allow you to read your (computer science) books from within Eclipse. You will have to build it from source, but there are instructions.

Saturday, November 12, 2011

Getting to the EPUB support in Eclipse

It has been a very hectic week since EclipeCon Europe 2011 and I have not had time to follow up on those of you that have taken contact to learn more about EPUB support in Eclipse. My apologies. In case you missed the presentation you will find it at SlideShare (sans the demos). At the time I was told that all presentations were taped and will be published at YouTube. (I'm looking forward to watching those I missed).

Anyway... A short summary of status: The EPUB API, Ant task and UI is currently in CQ and is heading towards a release published with the next Mylyn release in February. So for now you cannot find the code in the Eclipse repositories. Meanwhile it is available at GitHub. If you need a p2 repository and have trouble creating it yourself, please ping me.

Screenshot showing "The Book of CSS3" rendered within Eclipse.

The screenshot above shows the EPUB reader within Eclipse. This is currently experimental and not a part of the initial contribution to Mylyn Docs. This code is also at GitHub, just take a look in the reader branch.

Please let me know if you have any questions.

Saturday, October 29, 2011

Build your EPUBs with Eclipse, and read them too.

A lot has happened in the e-book world the past couple of years. There is an abundance of hardware for reading electronic books and the state of desktop reading systems is steadily improving. There is also a large number of electronic books available. Especially novels, but also technical material such as one of my current favorites: Pro Git. And as reading systems are improving, utilizing technologies such as SVG and CSS3; Electronic books become more suitable for publications where there are tables, figures and illustrations that must be presented correctly.

In response to this development I have in the past year worked on implementing support for putting together and reading EPUBs in Eclipse. This contribution is currently being processed and will most likely be available as a part of the next Mylyn release. One of the features of this contribution is the ability to quickly generate an EPUB from wiki markup as the video below demonstrates.



If you're interested in creating electronic publications, from wiki markup or other sources – and you're going to the sixth European Eclipse Conference – you may want to attend my talk about the subject. In any case I'll be happy to answer any questions you may have. Just locate me in the foyer.

And while we're on the subject of EclipseCon Europe. I'm really looking forward to it. This is one of the highlights of the year. A rare opportunity to attend very interesting talks and meet the rest of the community over a beer or two. See you in Ludwigsburg!

(In case the video is missing due to the RSS aggregator removing HTML code you will find it here: From wiki markup to EPUB in 45 seconds).

Thursday, June 23, 2011

Extending gesture support in Eclipse

With the release of Eclipse 3.7 the SWT team added support for touch and gesture events. Gesture support can be a bit tricky. So much that to solve this; scientists develop intricate algorithms and give them names.

Currently Eclipse supports the following gestures.

  • SWT.GESTURE_MAGNIFY
  • SWT.GESTURE_PAN
  • SWT.GESTURE_ROTATE
  • SWT.GESTURE_SWIPE

Now this set is about what most operating systems have. But would it not be cool if we could have separate, configurable gestures for Debug Launch, Next Annotation, switch to Mylyn Perspective and so on? I started imagining a preference page similar to the General > Keys page but with a wide range of gestures instead of key combinations.

Thankfully the guys that wrote the paper linked to above actually did something about that. They developed a framework named iGesture and released it under the Apache 2.0 license. As their web-page states:
"iGesture supports the application developer who would like to add new gesture recognition functionality to their application as well as the designer of new gesture recognition algorithms. The iGesture framework can easily be configured to use any of the existing recognition algorithms (e.g. Rubine, SiGeR) or customised gesture sets can be defined."
So you can design your own gestures (or take advantage of predefined ones) and use them in your application. That was almost to good to be true, but I decided to give it a go and downloaded the whole shebang. At the first go it crashed because I'm not using a Windows computer and the mouse device won't work otherwise. Good thing they know a thing or two about API design so I set about to write a SWTInputDevice (with friends) to solve the issue.

A couple of hours later we have a very simple (and slightly buggy) SWT application that blends the new touch support in Eclipse 3.7 with iGesture and is actually able to detect a few custom gestures. It needs a lot more work to be useful, but I think it's a decent proof of concept.

Now what to do in the summer vacation...

Friday, June 10, 2011

Building electronic books using ANT part II

For the last couple of weeks I've been busy reading Fortran77 code in order to re-implement some of it in Java. Most of the code has been fairly easy to understand, even with no prior knowledge of Fortran. But at the end of last week I stumbled upon some code I could not grok. After googling a while I found a book by Dr. Clive G. Page; Professional Programmer's Guide to Fortran77. This turned out to be a pretty good resource on the subject. However it's source format is LaTeX and these days I really like ePUB.

Since the book is released under the GNU Free Documentation License I decided to use it as a test case for my recent efforts to add ePUB support to Mylyn Docs. As it turned out this was quite straightforward. I did find a few bugs in my ePUB producing code and latex2html produced some ugly HTML. But with some fixing, configuration tweaking and the help of sed and tidy I got a pretty decent result. If you're interested in Fortran you'll find the book as a download over at GitHub. Where you will also find an example of using the new epub Ant task.