View Full Version : japi - a text editor capable of editing ePub directly


hekkel
02-10-2009, 06:28 AM
I've been writing text editors for many years and since I wanted to change the layout of a recently downloaded .epub I decided it would be best to add support for this format into my editor directly.

Japi is an open-source Gtk2 application and should be able to run on any OS that has GNOME installed. I've created two binaries for Ubuntu 8.10:

http://www.xs4all.nl/~hekkel2/japi-amd64-0.9.7-b1.tar.gz
http://www.xs4all.nl/~hekkel2/japi-i386-0.9.7-b1.tar.gz

To use this software, download the appropriate file and unpack it. There's only one file inside the archive and it does not need to be installed to be used. However, you can install it system wide by running the command (from a terminal):

sudo ./japi -i /usr/local/bin/japi

As you can see from the version number, Japi is still considered to be beta quality. But I thought some of you might find this interesting. And of course, I'm very interested in feedback.

-maarten

delphidb96
02-10-2009, 04:10 PM
I've been writing text editors for many years and since I wanted to change the layout of a recently downloaded .epub I decided it would be best to add support for this format into my editor directly.

Japi is an open-source Gtk2 application and should be able to run on any OS that has GNOME installed. I've created two binaries for Ubuntu 8.10:

http://www.xs4all.nl/~hekkel2/japi-amd64-0.9.7-b1.tar.gz
http://www.xs4all.nl/~hekkel2/japi-i386-0.9.7-b1.tar.gz

To use this software, download the appropriate file and unpack it. There's only one file inside the archive and it does not need to be installed to be used. However, you can install it system wide by running the command (from a terminal):

sudo ./japi -i /usr/local/bin/japi

As you can see from the version number, Japi is still considered to be beta quality. But I thought some of you might find this interesting. And of course, I'm very interested in feedback.

-maarten

Now if ONLY you'd create a standalone Windows version, you might have something here. :) (Of course, having a Mac-runtime version wouldn't hurt either. :D)

Derek

Valloric
02-10-2009, 05:25 PM
Don't get me wrong, but I don't see much point in this. It's not a WYSIWYG editor. It's rather spartan. I open an epub file (and I had to go through a fair few until I found one that would open without an error dialog), and I'm presented with a dialog that let's me edit the metadata? In some tab I can see a list of files in the archive and if I double-click a file, I get the source view?

From what I can tell, using this editor won't give me much beyond creating/editing the epub by hand in some HTML editor. If I'm missing something (entirely possible), please elaborate.

Not to sound too negative, I'm sure this could have its uses. I just don't see it. I still can't help but feel I'm missing some key point.

hekkel
02-11-2009, 02:13 AM
Don't get me wrong, but I don't see much point in this. It's not a WYSIWYG editor. It's rather spartan. I open an epub file (and I had to go through a fair few until I found one that would open without an error dialog), and I'm presented with a dialog that let's me edit the metadata? In some tab I can see a list of files in the archive and if I double-click a file, I get the source view?

From what I can tell, using this editor won't give me much beyond creating/editing the epub by hand in some HTML editor. If I'm missing something (entirely possible), please elaborate.

Not to sound too negative, I'm sure this could have its uses. I just don't see it. I still can't help but feel I'm missing some key point.

Yup, you're completely right. After all it is a spartan text editor, it certainly looks like one.

The ePub support does a little more than what you describe here. It generates the OPF and NCX files automatically based on what you enter on tab 2 and 3 of the interface. And I've tried to make this as simple as possible, hence the spartan looking interface. Just use the mouse to manipulate the items. So you end up with an HTML editor that reads and writes its files directly from an ePub file while maintaining an up-to-date OPF.

Japi is not a WYSIWYG editor, and never will be. But I'm planning on adding a good XHTML formatter and validator. I understood from the other discussion here on ePub editing that HTMLTidy is not good enough so I will come up with something else (probably using libtidy as the basis).

BTW, I'm very interested in the errors you have seen.

-maarten

Valloric
02-11-2009, 08:27 AM
BTW, I'm very interested in the errors you have seen.

I saw one that said the epub was "truncated" and another that the said the mimetype was missing. You should be more lenient when it comes to opening epubs. If it's missing the mimetype, throw a warning but do open it up, and then when the user saves the file, add the mimetype to the file.

The "truncated" error I still don't understand.

hekkel
02-20-2009, 08:46 AM
I saw one that said the epub was "truncated" and another that the said the mimetype was missing. You should be more lenient when it comes to opening epubs. If it's missing the mimetype, throw a warning but do open it up, and then when the user saves the file, add the mimetype to the file.

The "truncated" error I still don't understand.

You're right, there were quite a few problems left in handling ePub. After all, it was a first attempt. I made several improvements. E.g. Japi will now collect all problems during opening and will report them while still trying to work around these.

And another change has to do with the big news in ePub land this week.

You can download japi here (http://www.xs4all.nl/~hekkel2/japi.html), source code can be found there as well. Japi is hosted on Berlios BTW.

Finally, I understand if you're underwhelmed by Japi and its features. Yes, it is not much more than a text editor and using emacs you sure can get a long way too. But it works for me and I thought some might be interested in this.

-maarten