View Single Post
Old 09-18-2015, 11:40 AM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Three cheers for sed!

As far as calibre goes, the editor APIs, which is what I was thinking of, don't do anything to your code. Conversion is what mangles your code.

You can open up an ebook container, add files as-is (calibre will then take care of managing to OPF), rewrite all your scripts to use python or use subprocess.check_output() in convoluted ways, build the ToC through XPath, etc.


I'm not saying this is the easiest way for you -- you have to learn python (if you don't know it) first, and migrate a bunch of stuff that works already, but it is certainly *possible*.

Which is all you asked : do such scripting tools exist.
Answer: calibre is one such tool, being possessed of extensive python modules for manipulating ebooks.


And just for the perversity: You can turn all that into an editor plugin that can be used from within the ebook-edit GUI.
Then, what is the difference between the GUI and the command line?
Other than processing many books in one pass. (Answer: calibre plugins can have CLI modes. Rarely do their makers create one, but hey, it's possible. )

You could make a fair argument that the GUI is not just a passing fad.
But then, I could also poke fun at you for using a GUI to write the preceding post, if I was that determined to poke fun at you...


As a fellow believer in flexible automation, can I tempt you with Vimperator or VimFX?
eschwartz is offline   Reply With Quote