Posted on by & filed under epub, tools.

Our Python script to convert from DocBook to ePub using the DocBook XSL has been updated to version 1.0.2.

I’ve added some command-line options to override the location of the DocBook XSL (previously it was stuck in a settings file) and to also point to an optional CSS file.


$ db2epub.py 
Usage: db2epub.py docbook1.xml [docbook2.xml]... --xsl [DocBook XSL or customization] --css 

Tags:

9 Responses to “docbook2epub updated to version 1.0.2”

  1. Dave Pawson

    python setup.py install shows

    Installed /usr/lib/python2.6/site-packages/docbook2epub-1.0.1dev-py2.6.egg
    Processing dependencies for docbook2epub==1.0.1dev
    Searching for epubtools
    Reading http://pypi.python.org/simple/epubtools/
    Reading http://code.google.com/p/epub-tools/
    No local packages or download links found for epubtools
    Best match: None
    Traceback (most recent call last):
    File “setup.py”, line 30, in
    “””,
    File “/usr/lib64/python2.6/distutils/core.py”, line 152, in setup
    dist.run_commands()
    File “/usr/lib64/python2.6/distutils/dist.py”, line 975, in run_commands
    self.run_command(cmd)
    File “/usr/lib64/python2.6/distutils/dist.py”, line 995, in run_command
    cmd_obj.run()
    File “/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/install.py”, line 76, in run
    File “/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/install.py”, line 104, in do_egg_install
    File “/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py”, line 211, in run

    File “/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py”, line 427, in easy_install

    File “/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py”, line 478, in install_item

    File “/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py”, line 519, in process_distribution

    File “/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py”, line 563, in resolve
    distributions, errors = working_set.find_plugins(
    File “/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py”, line 799, in best_match

    File “/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/pkg_resources.py”, line 811, in obtain
    raise TypeError(“Can’t add %r to environment” % (other,))
    File “/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/command/easy_install.py”, line 434, in easy_install

    File “/usr/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg/setuptools/package_index.py”, line 475, in fetch_distribution
    AttributeError: ‘NoneType’ object has no attribute ‘clone’

  2. Liza Daly

    Hi Dave,

    I’ve updated a newer version with some instructions:

    This package installs using setuptools. If you don’t have setuptools installed, run:

    $ python ez_setup.py

    …first.

    To install the package, first install epubtools, which should be bundled in the distribution zip file:

    $ cd epubtools
    $ python setup.py install

    Then set run the same thing in docbook2epub:

    $ cd docbook2epub
    $ python setup.py install

  3. Jacques Foucry

    Hello,

    Nice idea the README !

    I have a problem with my project. It seems that the images (png) are not copied into OEBPS/images…. Is it a “feature” or a bug ?

    Thanks in advance,
    Jacques

  4. Robert Nagle

    This sounds great.

    is there an easier way to feed the script multiple xml files? My docbook project uses xincludes and about a dozen xml files or more….

    I got it running once with index.xml in the vain hope it would traverse through the xincludes, but it did not.

    Thanks.

  5. Liza Daly

    Hi Robert,

    Thanks, that’s definitely a bug. It ought to do xinclude parsing but you have to tell the XML parser to do that explicitly, and I’m not. I’ll release an updated version shortly.