View Single Post
Old 07-04-2017, 01:40 AM   #27
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)
Quote:
Originally Posted by norbusan View Post
Thanks for the patch, but I can't get it to run, getting error
Code:
Exception occurred:
  File "conf.py", line 20, in <module>
    import init_calibre
It works fine for me, calibre should install a file /usr/lib/python2.7/site-packages/init_calibre.py which when using a distro calibre installation allows any python project to make use of the 'calibre' module after initializing it with 'import init_calibre' (this is necessary because calibre still relies on a forked version of html5lib).
I think Debian deletes that file though, and I am not sure why.

This is not really suitable for the actual package recipe at build time of course since it uses bits from the installed version of calibre rather than the source code in the build directory.

Kovid, when viewing the generated manpages I see garbage like:
Code:
You can also use \fBcalibre\-debug\fP to run standalone scripts. To do that use it like this:
.INDENT 0.0
.INDENT 3.5
\fBcalibre\-debug\fP myscript.py \-<U+200B>\- \fB\-\-option1\fP \fB\-\-option2\fP file1 file2 …
That "<U+200B>" is highly disruptive when viewed with man(1).

Also, I've never really tried formatting a manpage and I don't know much about Sphinx, but e.g. "ebook-convert input_file output_file [options]" should be dedented and be preceded by the "SYNOPSIS" header and followed by the "DESCRIPTION" header.
The ebook-convert page has:
Code:
Below are the options that are common to all conversion, followed by the
options specific to every input and output format.
.INDENT 0.0
.IP \(bu 2
\fI\%Look and Feel\fP
.IP \(bu 2
\fI\%Heuristic Processing\fP
.IP \(bu 2
\fI\%Search and Replace\fP
.IP \(bu 2
\fI\%Structure Detection\fP
.IP \(bu 2
\fI\%Table of Contents\fP
.IP \(bu 2
\fI\%Metadata\fP
.IP \(bu 2
\fI\%Debug\fP
.IP \(bu 2
\fI\%AZW4 Input Options\fP
.IP \(bu 2
\fI\%CHM Input Options\fP
.IP \(bu 2
\fI\%Comic Input Options\fP
.IP \(bu 2
\fI\%DJVU Input Options\fP
.IP \(bu 2
\fI\%DOCX Input Options\fP
.IP \(bu 2
\fI\%EPUB Input Options\fP
.IP \(bu 2
\fI\%FB2 Input Options\fP
.IP \(bu 2
\fI\%HTLZ Input Options\fP
.IP \(bu 2
\fI\%HTML Input Options\fP
.IP \(bu 2
\fI\%LIT Input Options\fP
.IP \(bu 2
\fI\%LRF Input Options\fP
.IP \(bu 2
\fI\%MOBI Input Options\fP
.IP \(bu 2
\fI\%ODT Input Options\fP
.IP \(bu 2
\fI\%PDB Input Options\fP
.IP \(bu 2
\fI\%PDF Input Options\fP
.IP \(bu 2
\fI\%PML Input Options\fP
.IP \(bu 2
\fI\%RB Input Options\fP
.IP \(bu 2
\fI\%RTF Input Options\fP
.IP \(bu 2
\fI\%Recipe Input Options\fP
.IP \(bu 2
\fI\%SNB Input Options\fP
.IP \(bu 2
\fI\%TCR Input Options\fP
.IP \(bu 2
\fI\%TXT Input Options\fP
.IP \(bu 2
\fI\%AZW3 Output Options\fP
.IP \(bu 2
\fI\%DOCX Output Options\fP
.IP \(bu 2
\fI\%EPUB Output Options\fP
.IP \(bu 2
\fI\%FB2 Output Options\fP
.IP \(bu 2
\fI\%HTML Output Options\fP
.IP \(bu 2
\fI\%HTMLZ Output Options\fP
.IP \(bu 2
\fI\%LIT Output Options\fP
.IP \(bu 2
\fI\%LRF Output Options\fP
.IP \(bu 2
\fI\%MOBI Output Options\fP
.IP \(bu 2
\fI\%OEB Output Options\fP
.IP \(bu 2
\fI\%PDB Output Options\fP
.IP \(bu 2
\fI\%PDF Output Options\fP
.IP \(bu 2
\fI\%PML Output Options\fP
.IP \(bu 2
\fI\%RB Output Options\fP
.IP \(bu 2
\fI\%RTF Output Options\fP
.IP \(bu 2
\fI\%SNB Output Options\fP
.IP \(bu 2
\fI\%TCR Output Options\fP
.IP \(bu 2
\fI\%TXT Output Options\fP
.IP \(bu 2
\fI\%TXTZ Output Options\fP
.UNINDENT
.INDENT 0.0
which is just noise when appearing in a manpage...
The OPTIONS header has a confusing set of [brackets] around it.
calibre's help system doesn't really have the information about what type of <parameters> each --flag accepts anyway, so the fact that the manpages don't have that either isn't really a problem.

Other than that, I'd use the manpages as-is. It's certainly useful right now!

(Now I would like a way to generate it as part of python2 setup.py resources, then install it during the install phase. Pretty please?)

Last edited by eschwartz; 07-04-2017 at 01:44 AM.
eschwartz is offline   Reply With Quote