abelardopardo / Adagio

Agile Distributed Authoring Kit
http://www.it.uc3m.es/abel/Adagio/FAQ.html
GNU General Public License v3.0
4 stars 2 forks source link

Production rule: docbook -> epub #6

Open abelardopardo opened 12 years ago

abelardopardo commented 12 years ago

A production rule would be desirable that given a single docbook file produces an epub package. The styles are present in docbook-xsl (although without profiling). The difficulty comes from the fact that two directories are created, the images need to be copied in the proper location as an additional step, a few additional passes are required and the zip created.

The rule would receive a single file name and perform all these steps. The trickiest one could be the inclusion of the right images or auxiliary files, but parsing the opf file could help detect anomalies.

This issue is likely to be open for quite some time.

abelardopardo commented 12 years ago

Explored a bit more the issue. There should be a bit of processing to create the proper XML files surrounding the generated html. The step xml -> html is mature with the given stylesheets. Images need to be processed though to be scaled to the ebook resolution (600px wide). From python, the PIL package (http://effbot.org/zone/python-fileinfo.htm) gives the functionality to know the size of a picture and eventually scale it.