MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Calibre (https://www.mobileread.com/forums/forumdisplay.php?f=166)
-   -   Command Line Options for ebook-convert (https://www.mobileread.com/forums/showthread.php?t=52878)

godel10 08-06-2009 07:09 AM

Command Line Options for ebook-convert
 
I have just realized that html2lrf is no longer available, and that now we have to use the command line tool ebook-convert.

In the past I was using
Code:

html2lrf --bottom-margin=10 file.html
in order to generate my e-books (because the Librie screen is smaller than the PRS). How can I use this option right now? I have tried
Code:

ebook-convert file.html file.lrf --bottom-margin=10
but it is not working

By the way, is there some place where we can find the command line options for ebook-convert?

pepak 08-06-2009 07:51 AM

Quote:

Originally Posted by godel10 (Post 545129)
By the way, is there some place where we can find the command line options for ebook-convert?

Code:

ebook-convert <existing_html_file_name> anything.lrf --help
I still think Calibre should print out at least a basic, not-format-specific help with ebook-convert --help

user_none 08-06-2009 08:11 AM

Quote:

Originally Posted by pepak (Post 545158)
Code:

ebook-convert <existing_html_file_name> anything.lrf --help
I still think Calibre should print out at least a basic, not-format-specific help with ebook-convert --help

That would be confusing because a format can disable general help options.

godel10 08-06-2009 11:01 AM

Quote:

Originally Posted by pepak (Post 545158)
Code:

ebook-convert <existing_html_file_name> anything.lrf --help
I still think Calibre should print out at least a basic, not-format-specific help with ebook-convert --help

This was helpful. It seems that now the right option is --margin-bottom=10

By the way I suggest to the developers to modify "ebook-convert --help" in such a way that at least it tells you that you can get specific information about a particular format (lrf or any other) using
Code:

ebook-convert <existing_html_file_name> anything.format --help

pepak 08-06-2009 01:58 PM

Quote:

Originally Posted by user_none (Post 545167)
That would be confusing because a format can disable general help options.

You mean, more confusing than the fact that unlike any other command line tool ebook-convert does not print help with either --help or -?

Not to mention that I find it strange (to say the least) that to get a command line help, I must not only specify the input and output formats, but the input file must actually exist! It's not as if anything was read from it - if I create a zero-byte HTML file, I will get my help, but if I use a nonexistent filename, I get an error message...

kovidgoyal 08-06-2009 02:06 PM

Quote:

Originally Posted by pepak (Post 545624)
You mean, more confusing than the fact that unlike any other command line tool ebook-convert does not print help with either --help or -?

Not to mention that I find it strange (to say the least) that to get a command line help, I must not only specify the input and output formats, but the input file must actually exist! It's not as if anything was read from it - if I create a zero-byte HTML file, I will get my help, but if I use a nonexistent filename, I get an error message...

You've done a survey of all command line tools in existence, have you?

rogue_ronin 08-07-2009 01:55 AM

Quote:

Originally Posted by kovidgoyal (Post 545629)
You've done a survey of all command line tools in existence, have you?

Debating 101: don't talk about the topic, talk about the words used to describe the topic.

Pepak is not out of line here -- even if there may exist tools that don't do help in the fashion he states. Kovid, have you ever seen the zenity help? It's pretty cool: you could do something similar, like --help-2lrf, --help-2epub, etc.

Nonetheless, I'm sure you're annoyed by the repeated requests to change the help system, something that you have decided is settled. And I've surely annoyed you further.

m a r

kovidgoyal 08-07-2009 12:59 PM

Sigh. Here are some command line tools that dont print a complete help with --help, just like ebook-convert

svn, bzr, mplayer, gnuplot, gcc

Basically any command line tool that does anything non-trivial.

Now if someone has some concrete suggestion as to how to improve the help interface of ebook-convert, keeping in mind the oft repeated constraint that the available options depend on the input and output formats, please say so, otherwise hold your peace.

And I should note that both the concrete suggestions in this thread have been implemented for the next release, in particular:

1) Adding a sentence about how to get more detailed help by specifying input and output formats
2) Not requiring that the input file exists when getting help

ilovejedd 08-07-2009 03:13 PM

Including a separate readme.txt for ebook-convert containing all available options/permutations would be much appreciated while you're still working on the online manual. Besides, I think I'd much rather view the help file in my favorite text viewer/editor rather than in shell.

It doesn't even have to be pretty. I'm not sure how ebook-convert limits the options (by input format? output format? both?), but a readme containing the following would probably work well enough for most people:
Code:


Syntax:
ebook-convert .....

General Options:
blah...            //output of ebook-convert --help

List of Supported Input Formats:

List of Supported Output Formats:


FORMAT-SPECIFIC OPTIONS

EPUB                //if options change based on output format
HTML to EPUB        //if options change based on both input and output formats
blah...            //output of ebook-convert file.html .epub --help

LRF                //if options change based on output format
HTML to LRF        //if options change based on both input and output formats
blah...            //output of ebook-convert file.html .lrf --help

etc...

I've made an MS-DOS batch file that creates something similar to the above for myself.
Code:


@echo off
ebook-convert --help>ebook-convert-readme.txt
echo  >>ebook-convert-readme.txt
echo **********************>>ebook-convert-readme.txt
echo *                    *>>ebook-convert-readme.txt
echo *  EPUB (html2epub)  *>>ebook-convert-readme.txt
echo *                    *>>ebook-convert-readme.txt
echo **********************>>ebook-convert-readme.txt
ebook-convert file.html .epub --help>>ebook-convert-readme.txt
echo  >>ebook-convert-readme.txt
echo *******************>>ebook-convert-readme.txt
echo *                *>>ebook-convert-readme.txt
echo *  LIT (any2lit)  *>>ebook-convert-readme.txt
echo *                *>>ebook-convert-readme.txt
echo *******************>>ebook-convert-readme.txt
ebook-convert file.html .lit --help>>ebook-convert-readme.txt
echo  >>ebook-convert-readme.txt
echo *********************>>ebook-convert-readme.txt
echo *                  *>>ebook-convert-readme.txt
echo *  MOBI (any2mobi)  *>>ebook-convert-readme.txt
echo *                  *>>ebook-convert-readme.txt
echo *********************>>ebook-convert-readme.txt
ebook-convert file.html .mobi --help>>ebook-convert-readme.txt
echo  >>ebook-convert-readme.txt
echo ************************>>ebook-convert-readme.txt
echo *                      *>>ebook-convert-readme.txt
echo *  OEBPS (html2oebps)  *>>ebook-convert-readme.txt
echo *                      *>>ebook-convert-readme.txt
echo ************************>>ebook-convert-readme.txt
ebook-convert file.html folder --help>>ebook-convert-readme.txt

My source files are primarily in HTML format and the ones in the batch file are the only formats I convert to. I also added the old names of the corresponding command-line utilities (at least the ones I used) for my convenience.

kovidgoyal 08-07-2009 09:21 PM

You mean like this?

http://calibre.kovidgoyal.net/user_m...k-convert.html

Kostas 08-07-2009 09:31 PM

Quote:

Originally Posted by kovidgoyal (Post 547392)

:rofl:

I really aprreciate Kovid's humor!! :2thumbsup

ilovejedd 08-07-2009 09:53 PM

Whoops. Guess I'm behind the times. :p Last time I went to that link, it was empty. Well, it wasn't but it only contained general help info. Granted, I think it was still back when I was beta testing 0.6. :sweatdrop

Still, I think including a copy of that HTML file with the Calibre install would be a good idea, specially for people who occasionally need to work on ebooks when they don't have internet access. Then, just point people to that HTML file.

I also suggest switching the link in ebook-convert --help from:
http://calibre.kovidgoyal.net/user_m...onversion.html

to:
http://calibre.kovidgoyal.net/user_m...k-convert.html

At least, temporarily, while the first link is still empty.

kovidgoyal 08-07-2009 09:56 PM

That HTML file is 2.2MB I don't think I want to distribute it. People that want to refer to it offline can just save it from their browsers.

I'll add a link to the main conversion documentation pointing to the ebook-convert docs until that is ready.

ilovejedd 08-07-2009 10:00 PM

Quote:

Originally Posted by kovidgoyal (Post 547422)
That HTML file is 2.2MB I don't think I want to distribute it. People that want to refer to it offline can just save it from their browsers.

I'll add a link to the main conversion documentation pointing to the ebook-convert docs until that is ready.

Oh, wow. 2.2MB? That's bigger than most my ebooks. :p

rogue_ronin 08-08-2009 09:28 AM

Quote:

Originally Posted by kovidgoyal (Post 546852)
Sigh.

Sorry, man. Didn't mean to pile on.

Believe me, when I want to pile on, I do. I think I just ate a guy's spleen in another thread.

So, don't change it -- change it; it's all okay.

You've done plenty of good,

m a r


All times are GMT -4. The time now is 10:24 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.