View Single Post
Old 07-26-2014, 07:34 PM   #252
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by shotsky View Post
I use Calibre to convert from various ebook formats to 'htmlz' at this point, which is the only way I know of to get all the html files into a single file. Unfortunately, Calibre replaces a lot of classes with its own made up classes, which 'breaks' the meaning of various existing classes. All I really need is one single html file, unmodified, and the photos. The htmlz export joins the files, but it converts the classes as well, even though there is no need to do so.
I've just installed the KindleUnpack plugin, and it does exactly what I need - merge the html files into one file, without using Calibre's conversion routines, which renames classes from whatever they were to 'calibexx', which causes a loss of the original class names.
The only problem I still have is that I need the same feature for Epub files. Would it be impossible to add that as an import format?
What would be even better would be to add a 'unpack' feature to Calibre itself, which would take any input format, merge the html files, and provide a zipped output.
So, my three most important needs are:
1. Merge the html files into a single file
2. Not change or rename classes.
3. Run from the command line.
Thanks!
A manual way of doing this would be:

- Open the ePub in the calibre editor
- Select all the HTML files
- Right click on them and select "Merge selected text files"
- Press OK when prompted
- Save the changes and close the editor
- Change the file extension to HTMLZ
- Open the file with your favourite zip file manager and remove the extra files

The only issue I can think of is the stylesheets. If there are multiple stylesheets in the epub, they will probably all be referenced in the final HTML file. But, if there are duplicate selectors across the stylesheets, the final result could be interesting. And that is the reason calibre does the renaming.
davidfor is offline   Reply With Quote