View Single Post
Old 12-04-2009, 03:21 PM   #63
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,949
Karma: 6361444
Join Date: Nov 2009
Device: many
new version of xpml2xhtml.py

Hi,

I finished my grading early (final exams are as a big a pain for profs as they are for students) so I went ahead and posted the new version of xpml2xhtml.py to pastebin.de. This code is completely anti-drm free and so is okay to post, e-mail people and share. It requires HTML Tidy command line executable to be installed on the machine. This is installed already under Mac OSX (at least on my machine) and will build out of the box on Mac OSX and Linux and pre-built binaries for Windows are available from: http://int64.org/projects/tidy-binaries

Just make sure tidy is in the path someplace (I have never tried tidy on windows so feedback welcome).

The link is to xpml2xhtml.py is:

http://pastebin.de/3445

It includes a command line optional switch --sigil-breaks that will automatically insert sigil Chapter Breaks which makes it easy to use Sigil to go from the output to a finished epub in much less time (if sigil would only read in the meta info in the header I would be so happy!).

I use it as follows (on my Mac or under Linux)

python xpml2xhtml.py --sigil-breaks input.pml output.html

And to just make things clear, the format for footnotes in the input pml file is the xml one not the one of the original ereader2html one. The snippets of code to which create this format in the pml file are at:

http://pastebin.de/3444

for those who are interested.

Hope this helps,

Please let me know if you run into problems or troublesome files that won't convert. I am always looking for test documents that hit corner cases.

Take care,

KevinH
KevinH is online now   Reply With Quote