[Booki-dev] irc, demo, and trac

Douglas Bagnall douglas at paradise.net.nz
Sat Sep 12 03:08:39 PDT 2009


hi,

I am Douglas Bagnall, living in Wellington, New Zealand.  I've been
programming for FLOSS Manuals most of this year.

At the moment I'm working on the Espri, the epub to FLOSS Manuals
importer.  At the moment that means I'm reading through the epub specs,
re-expressing them in python, and testing against a messy collection of
files.  The repository is here:

http://booki-dev.flossmanuals.net/git?p=espri.git

The aim is to extract the metadata as JSON and convert the text into FM
style xhtml, which can then be handed to booki as a bundle.  There's a
ticket about this at http://booki-dev.flossmanuals.net/ticket/27 though
the ideas there are perhaps naive as when I wrote it I had not looked so
closely at epub.

The FLOSS Manuals format has not been specified as a standard but as a
set of practices, like "always start the chapter with an <h1>", "use
this editor", and "don't make images wider than 600 pixels".
Nevertheless, the format arising from all this is central to the way FM
works, and approximating it is the aim of Espri.  The main thing is to
make sure each chapter is its own file, and starts with an h1, and
perhaps tune it from there.  For most individual epub files, this looks
simple, but it gets more complicated as the sample size grows.

Most epub files contain a lot of metadata that booki can't use, but we
can make sure it doesn't lose anything on a round trip.  Also booki will
(probably) deal with the stuff it does know (like contributors and
dates) on a chapter by chapter basis, which we will need to coalesce on
return to epub.  Ideally we will be able keep the fine grained detail
for booki to reuse if the book is re-edited again.

Mike McCabe wrote:


> epub.py abstracts the process, at least a bit - first create an
> epub.Book object, then add items and bits of indexing info as desired.
> Works for what I have.  Any cleanup / review welcome; my prior Python
> experience is limited.

This looks good -- I think I could use/adapt it for the booki -> epub
conversion.  Perhaps some of it is specific to your task, or maybe I
just don't understand yet (e.g. what does 'OEBPS/page-template.xpgt'
do?) and there might be things that booki needs to do that you don't, so
maybe there is a case for a generalised module that both could use.  But
I haven't really looked yet.


Douglas




More information about the Booki-dev mailing list