View Single Post
Old 05-06-2011, 12:47 AM   #9
Little Frank
Junior Member
Little Frank began at the beginning.
 
Posts: 6
Karma: 10
Join Date: May 2011
Device: nook, Nokia N800 with FBreader
Cool

First, there is a limit of 127 characters to any MS-DOS command line; more then 127 characters and MS-DOS truncates the line without a warning. This is not a Calibre bug, but intrinsic to MS-DOS, and Microsoft has declined changing it for over 20 years. See
http://support.microsoft.com/kb/69563
(IBM field engineers are trained to say “that isn’t a bug, that’s part of a feature for our other customers” when they are backed into a corner.)
I have launched
ebook-meta ThisBook.epub --to-opf file.opf
Then edited the .opf file, for
ebook-meta ThisBook.epub --from-opf file.opf --other-meta
but if there is an equivalent way of loading the ebook-convert non - meta data, I haven’t found it.
A feature of Windows is that it tries to launch all the Windows programs it can find in a .BAT file at one time. Helpful if you’re trying to get 2 spreadsheets and 3 documents going at once; but irritating for sequential processing. What I have found myself doing in a .bat is:
copy "Eusebeus Church History.htm" in.htm
del *.epub
ebook-convert in.htm w.epub --output-profile nook --level1-toc //h:h2 --level2-toc //h:h4 --max-toc-links 0 --chapter /
This is barely under the length limit, but I get all the TOC stuff on one line. There is no space remaining on the line for a pause technique. Then I hand launch a second .bat
ebook-convert w.epub o.epub --output-profile nook --smarten-punctuation --change-justification left --pretty-print
in a second .bat file, this does all the “cosmetic treatment.”
Then a third batch file I hand launch is
ebook-meta o.epub --cover Eu.jpg --author-sort "Eusebius of Caesarea"
which adds the meta data that it can’t find in the HTML.
Oh yeah; one more batch file. Number four.
start "" /w "calibredb.exe" add -d o.epub
start "" /w "ebook-viewer.exe" o.epub
Lets me see the results, and places it in the DB.
If you name the batch file sequentially, conv1.bat conv2.bat conv3.bat conv4.bat; well I’ve got decades of COBOL experience, so I’m brain damaged to the point where it seems acceptable. For the sake of the rest of humanity, and to bypass two MS-DOS/Windows bugs at once, it would be nice if there was one additional option:
---------------------------
ebook-convert in.htm o.epub --command-line misccmds.txt
---------------------------
where misccmds.txt would contain all the familiar calibre line commands; either all on one line, or preferably, it being possible to spread out the line commands with their parameters over more then one line. (.txt extension preferable so it would open automatically with Notepad/VIM/etc.).
Thank you for your attention to this matter; and the excelent product. Usually doing everything through the GUI interface is good enough for me, and I'm done in two minutes, but once in a while . . .
P.S. I have done enough stuff in Linux to be able to see how it would be helpful to combine different misccmds.txt files with cp, as with MS-DOS copy, since you might want to combine preferred formatting, (second ebook-convert above) with book specific meta-data.
Little Frank is offline   Reply With Quote