Duff is a tool designed to format Daisy digital talking books. A common use is to help printing of a Daisy book by making single file of its text content. Duff supports the Digital Talking Book version 2.02 specification, namely books with an XHTML Navigation Control Center (NCC), XHTML textual content and SMIL 1.0 multimedia content. This document covers the source distribution of the pre-release version 0.7 of Duff (17 Jul 2005.) Duff is free software and released under the GNU Lesser General Public License version 2.1.
The source
release of version 0.7 is available from Sourceforge. Note about the project
name: unfortunately, there is already a project named "Duff" hosted
by Sourceforge, so the UNIX name for the project is fudd
.
Duff is implemented in Java, and should therefore run in any environment that supports Java (J2SE) version 1.4 or higher. Duff relies on two external libraries which must installed prior to compiling:
saxon.jar
must be in your class path;resolver.jar
must be in your class path.You can then compile Duff by the command
javac Duff.java
. If you wish to run Duff in Japanese or French, you also need to run the
command perl to_ascii.pl
which transforms the localization
messages into the correct encoding for Java. You can then run Duff by calling the main class Duff
.
There are currently three possible outputs for a given book:
The GUI consists of a menu bar and an information window. Formatting a
book with Duff is a two-step process. First, open
the NCC file for the book (using the Open NCC file item of the
File menu.) A file chooser will appear, in which you can select the
ncc.html
or NCC.HTML
navigation control center file
of a book. When a file was selected, a preliminary transformation is run to
create an intermediary representation of the book that will be used by
further transformations (the so-called XML table of contents of the book.)
Once the NCC file has been read, the Transform menu is enabled. From this menu you can either view the hierarchical table of contents of the book, or format the book. When you choose one of the three transformations described above, you will be presented with a file chooser where you can select the output file. At the moment, it is best to save the output in the same directory as the one where the XHTML files reside, so that links will stay consistent. Future versions will address this problem.
Menu reference. Following is a quick description of the menus of the GUI.
Duff is specifically built on XSLT, the XML transformation language defined by the W3C. Since Daisy books are built out of XHTML and SMIL files, which are both XML formats, it is possible to transform a book stylesheets. The Java version of Duff uses the Saxon processor from Michael Kay.
The design of Duff is very simple. The core formatting functionalities are implemented with XSLT stylesheets, and the graphical user interface is implemented in Java. This design allows to cleanly separate the formatting functionalities, so that the same functionalities can be accessed from a different application: for example, a command line tool written in Perl can use the same stylesheets to make batch transformations faster than the Java version.
The application is also easy to customize by a user who knows XSLT. A future version of Duff will allow to easily add custome stylesheets for advanced formatting purposes. It is already possible in the current version to do so, but this necessitates to recompile the application.
Julien Quint <pom@graougraou.com>
, with
support and funding from ELSA and
NRCD.