07-03-2017, 03:03 AM | #16 |
Zealot
Posts: 140
Karma: 82382
Join Date: Jan 2013
Device: Kindle Paperwhite, Kobo Glo, Kobo GloHD
|
Thanks, that is an option. The other is generating man pages for the sub commands via help2man for calibredb <subcommand>, an approach that is taken by several applications. Or, combination of both ;-)
|
07-03-2017, 06:23 AM | #17 |
creator of calibre
Posts: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
If you decide to do that, please do not hard code the list of sub-commands. Otherwise we will be having a similar discussion with somebody else in a few years.
|
07-03-2017, 03:09 PM | #18 | ||||||||
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Thanks for fixing the downstream manpages.
Note that you should probably be getting the command list the same way calibre's build process gets them. With that in mind, the following shell command prints out a newline-separated list of binaries calibre installs to /usr/bin: Code:
cd /path/to/calibre-sourcecode/ printf "import sys, os; sys.path.insert(0, os.path.abspath('.')); import setup; setup.initialize_constants(); \nfor i in setup.basenames['gui'] + setup.basenames['console']: print(i);" | python2 Quote:
I already do all that as a contributing *user* in Arch Linux, plus I don't really grok Debian much. Quote:
Downloading and extracting calibre_3.1.1+dfsg-1_all.deb:data.tar.xz -- what do I see? Those aren't the desktop files calibre installs, they have different content from the four desktop files shipped in calibre's codebase (or technically, the install target of calibre's python build system will generate them programmatically from the codebase, making use of e.g. an up-to-date list of gui_scripts and associated supported mimetypes): Code:
/usr/share/applications/calibre-ebook-edit.desktop /usr/share/applications/calibre-ebook-viewer.desktop /usr/share/applications/calibre-gui.desktop /usr/share/applications/calibre-lrfviewer.desktop A good policy would be to always rely on upstream desktop files, to save on duplication of effort (unless upstream supplies not desktop files, in which case oops). Additionally, /usr/share/pixmaps/calibre.png is sourced from manual/resources/logo.png which is wrong, especially because calibre doesn't ship any pixmaps file at all, and instead ships a set of various icons (both application icons for the three distinct GUI applications, and for various ebook mimetypes) in various sizes, in /usr/share/icons/hicolor Also missing from the debian package is /usr/share/mime/packages/calibre-mimetypes.xml (since Debian provides their own /usr/share/mime/packages/calibre.xml which contains unique content that calibre does not have, so I have no idea why it exists at all or where it came from). Quote:
And the update notifier in calibre is not AFAIK split out between the plugin update notifier and the calibre release update notifier, but either way there are patches in the Debian sources that seem to be trying to wholly get rid of the plugin indexer/installer/updater as well... I admit I haven't tested those patches but merely depended on my reading of the description/patched code. I am also in part reacting to the perceived attitude of the downstream Debian person who filed a debian-specific, non-upstreamed security bug about the plugin system and decided the best thing was to silently disable things which to most people here are a large part of why calibre is so useful. So, mea culpa. Quote:
Quote:
Quote:
I do see what you mean though. Quote:
Quote:
Last edited by eschwartz; 07-03-2017 at 03:13 PM. |
||||||||
07-03-2017, 08:30 PM | #19 | ||||
Zealot
Posts: 140
Karma: 82382
Join Date: Jan 2013
Device: Kindle Paperwhite, Kobo Glo, Kobo GloHD
|
Hi
thanks for all your detailed answers. [QUOTE=eschwartz;3547545]the following shell command prints out a newline-separated list of binaries calibre installs to /usr/bin:[/QUODE] thanks. BTW, the text for the web site/help, can it be also programmatically extracted so that I can generate man pages from it? Indeed, I checked and see that the installation does not work out, as mime type and desktop files are not installed. The error is happening in the desktop-integration install process, and xdg-icon-resource breaks. I was suprised because --root (--staging-root) is passed to the install, and it wasn't forwarded to the desktop integration install code. Reading through setupp/install.py I also see a comment that one needs to set XDG_DATA_DIRS, which I did, without any change. I will try to fix this so that the correct desktop files are installed. Quote:
Quote:
Quote:
is not patched out, works well! Using it. Quote:
Thanks again for your suggestions, I will work on fixing as much as I can together with Martin. All the best Norbert |
||||
07-03-2017, 08:31 PM | #20 | |
Zealot
Posts: 140
Karma: 82382
Join Date: Jan 2013
Device: Kindle Paperwhite, Kobo Glo, Kobo GloHD
|
Quote:
Thanks Norbert |
|
07-03-2017, 09:27 PM | #21 | |
Zealot
Posts: 140
Karma: 82382
Join Date: Jan 2013
Device: Kindle Paperwhite, Kobo Glo, Kobo GloHD
|
Quote:
I have fixed that now locally in my repo by changing the linux.py installation routine for debian to use 'install' instead of xdg-mime/xdg-desktop-menu for the debian builds. Best Norbert |
|
07-03-2017, 10:48 PM | #22 |
creator of calibre
Posts: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The user manual sections on the command line interface are all programmatically generated. See manual/custom.py
You are welcome to submit a patch to refactor that code to make it easily useable for generating man pages as well, if you want. Probably the best way to do that, is to run sphinx-build with the man output type and just take the man pages for the CLI aprt from there. |
07-03-2017, 11:23 PM | #23 |
creator of calibre
Posts: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
And with this commit
https://github.com/kovidgoyal/calibr...d8947eda602072 You can simply run cd manual && sphinx-build2 -b man . /tmp/man to generate the man pages in /tmp/man Last edited by kovidgoyal; 07-03-2017 at 11:26 PM. |
07-04-2017, 12:46 AM | #24 |
Zealot
Posts: 140
Karma: 82382
Join Date: Jan 2013
Device: Kindle Paperwhite, Kobo Glo, Kobo GloHD
|
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 |
07-04-2017, 01:16 AM | #25 |
creator of calibre
Posts: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You need to have calibre installed on the machine where you are running sphinx-build2. The calibre installation process installs init_calibre.py into your system python path.
|
07-04-2017, 01:39 AM | #26 | ||
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
XDG_DATA_DIRS= works fine, though you will first have to create some directories by hand because xdg-utils is a very buggy collection of tools. Quote:
|
||
07-04-2017, 01:40 AM | #27 | |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
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 … 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 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. |
|
07-04-2017, 02:12 AM | #28 | ||
Zealot
Posts: 140
Karma: 82382
Join Date: Jan 2013
Device: Kindle Paperwhite, Kobo Glo, Kobo GloHD
|
Quote:
Quote:
Thanks Norbert |
||
07-04-2017, 02:30 AM | #29 |
creator of calibre
Posts: 43,859
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
@Eli: I'm not going to add a dependency on sphinx to the calibre build process. I will create a separate command to build the man pages conveniently, but that's about it.
As for formatting of the man pages -- that's upto sphinx, I'm not going to spend time debugging it. |
07-04-2017, 02:32 AM | #30 |
Zealot
Posts: 140
Karma: 82382
Join Date: Jan 2013
Device: Kindle Paperwhite, Kobo Glo, Kobo GloHD
|
Ok, after installing init_calibre.py, and moving it from the instal location in /usr/lib/pyton2.7/site-packages/ (which is not searched here) to one level up, I could run the sphinx-build command successfully.
This generated calibre.1, but not man pages for other, like calibredb. But the calibre.1 man page is great, thanks! |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Glo Where's Debian GNU/Linux image for Kobo Glo?哪里有Kobo Glo的Debian GNU/Linux镜像? | zaoqi | Kobo Developer's Corner | 0 | 04-09-2017 02:33 AM |
update error in Debian 8 Linux | SilverBear | Devices | 5 | 01-03-2016 04:03 AM |
Installing calibre 1.26 in linux debian with no sudo | Nix Hard | Calibre | 5 | 03-02-2014 10:47 PM |
viewing RAR on Linux | tlc | Calibre | 5 | 05-22-2011 06:13 PM |
Problem inserting rar'd html - on linux | hairybiker | Calibre | 6 | 10-12-2009 10:31 AM |