MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Plugins (https://www.mobileread.com/forums/forumdisplay.php?f=268)
-   -   kindlegen plugin for Sigil (https://www.mobileread.com/forums/showthread.php?t=248629)

Hendrixxxxxxxx 11-13-2015 10:17 AM

Question
 
Would installing X11 (iMac running El Capitan, Sigil 0.9.0) affect the ability to run this plugin?

I downloaded the plugin to my downloads folder, and followed the instructions above to the letter...all was well, and the plugin worked as advertised.

I then separately downloaded Kindle Previewer to view the results, but in order to get Kindle Previewer to run, I had to update Java, and download X11, per the instructions here - http://www.amazon.com/forum/kindle%2...x2KDW3X9NV83MC

Again, all was good - Kindle Previewer ran as advertised.

I then uninstalled the plugin, and moved the zip file to its final resting place (in a folder in the Applications folder, rather than in the downloads folder) and reinstalled it, but now I can't get it to run.

Plugins-->Output-->KindleGen brings up the Plugin Runner window as it should. Clicking Start brings up the window (I notice the "Application" menu at the top of the screen changes from Sigil to Python) the to select the Kindlegen location (I want to select the Kindlegen_v0.2.2.zip file here, correct, or am I being an idiot?). I select this, click on "Open" and nothing happens (I left it for 30 mins just in case things were running incredibly slow). This window stays open. Selecting it a second time, and clicking Open again results in some text flashing in the Plugin Runner window, but much too fast for me to be able to read it, and then
Status: success
KindleGen not selected
Press OK to close the Plugin Runner Window

I checked the ini file and there has been no path to the Kindlegen executable written (I don't know if running the plugin the first time writes the path in here or not), and I also checked the permissions for the folder to ensure it was able to be written to.

The only thing that changed between the first time I ran it (when it was in the downloads folder) and the second time was the location of the Kindlegen.zip, and the fact that I updated Java and installed X11.

I have tried starting from scratch a few times now, removing all plugins (I have FlightCrew as well, which runs OK), quitting out of Sigil, restarting my machine, and trying to install again, all with the same outcome.

Am I being an idiot somewhere, or do I have genuine issue? If the former, I apologise. If the latter does anyone have any idea where, and how to fix it please?

Doitsu 11-13-2015 10:40 AM

In order run KindleGen, you only need the kindlegen binary, which comes with KindlePreviewer and is also available as a separate download. kindlegen itself doesn't require Java; it's only needed for KindlePreviewer

By default the Plugin looks for the KindleGen binary (kindlegen) in:

Code:

/Applications/Kindle Previewer.app/Contents/MacOS/lib/kindlegen
Of course the kindlegen binary can be in any folder.

Quote:

Originally Posted by Hendrixxxxxxxx (Post 3205141)
I then uninstalled the plugin, and moved the zip file to its final resting place (in a folder in the Applications folder, rather than in the downloads folder) and reinstalled it, but now I can't get it to run.

The plugin zip file doesn't contain the kindlegen binary. You can delete it from your Mac after you've installed the plugin.

Quote:

Originally Posted by Hendrixxxxxxxx (Post 3205141)
Plugins-->Output-->KindleGen brings up the Plugin Runner window as it should. Clicking Start brings up the window (I notice the "Application" menu at the top of the screen changes from Sigil to Python) the to select the Kindlegen location (I want to select the Kindlegen_v0.2.2.zip file here, correct, or am I being an idiot?).

No, you'll need to select a file called kindlegen (without any extensions), which should be in /Applications/Kindle Previewer.app/Contents/MacOS/lib/kindlegen if you've installed Kindle Previewer in the default folder.

I'd recommend the following:

1. Select Plugins > Manage Plugins and delete the Kindlegen plugin and reinstall it.

2. Download the standalone OSX kindlegen version and unzip it to a folder of your choice.
(You only need to extract one file: kindlegen.)

3. Run the KindleGen plugin and select the kindlegen file that you extracted in step 2.

Hendrixxxxxxxx 11-13-2015 11:12 AM

Worked a treat.

Awesome.

Thank you Doitsu.

dhdurgee 11-18-2015 05:04 PM

I have now used the kindlegen plugin on over 100 documents and would up tweaking the plugin.py just a little more to remove more characters from the title for the filename:

# replace unwanted characters in book title
title = re.sub('[/|\u2019|\u201C|\u201D|\u2024|\u2025|\u2026|\?|<|>| \\\\|:|;|\.|,|\+|=|!|&|\*|\||\"|\^|\'|\s]+', '_', dc_title.group(1))
title = title.strip("_")

You might want to consider updating your script as well, and you can probably improve on my tweaks. I was surprised by the unicode in some of the document titles and think there might be a better way to deal with this, perhaps using ranges to remove non-alphabetics? In fact, I am starting to wonder if perhaps the best bet might be to invert the sense and define a list of permitted characters and translate/trim anything else.

Dave

Doitsu 11-18-2015 06:06 PM

Quote:

Originally Posted by dhdurgee (Post 3208115)
I have now used the kindlegen plugin on over 100 documents and would up tweaking the plugin.py just a little more to remove more characters from the title for the filename:

Thanks for your suggestions. When I originally designed the plugin I had a look at lists of invalid characters in Windows, Linux and OSX file names and I believe that the plugin as it is right now generates valid file names for all three operating systems.

I'll have a closer look at your suggestions and might add a couple of characters to be removed from file names. For example, even though spaces are valid in Windows/Linux/OSX file names they usually need to be escaped.
OTOH, typographical quotation marks shouldn't cause any problems.

JSWolf 11-18-2015 06:09 PM

Quote:

Originally Posted by Doitsu (Post 3200811)
You may want to make sure that all books that you want to convert with KindleGen pass ePubCheck and/or FlightCrew,

You don't want to use FlightCrew to validate. It doesn't catch enough errors. FlightCrew has needed updating for some time.

KevinH 11-18-2015 06:23 PM

JSWolf,

Quote:

Originally Posted by JSWolf (Post 3208142)
You don't want to use FlightCrew to validate. It doesn't catch enough errors. FlightCrew has needed updating for some time.

This is really getting old.

It certainly can not hurt to run anything through Flightcrew. Please stop injecting this comment each time after flightcrew is mentioned anyplace in Sigil. In fact FlightCrew will catch many types of common errors and provide a nicer error code many times to help the user.

Then instead of just complaining about things ... file an actual bug report at the new Flightcrew github site and include a clear test case that Flightcrew calls wrong when it is not, or a clear test case of something it misses completely that it should catch that epubcheck 2 actually catches.

KevinH

JSWolf 11-18-2015 06:34 PM

Ok, I'll have a go at FC and see what it missed that ePubcheck 4 catches.

DiapDealer 11-18-2015 07:35 PM

Quote:

Originally Posted by JSWolf (Post 3208158)
Ok, I'll have a go at FC and see what it missed that ePubcheck 4 catches.

Do us a favor and don't bring your findings back here. It's not really relevant to this discussion. Start your own thread or file an issue with Flightcrew's issue tracker on github please.

dhdurgee 11-25-2015 05:01 PM

I have a puzzle related to this plugin I am trying to sort out. I used this plugin to create a mobi file from an epub and loaded that file onto my Kindle 3 WiFi. I am having no problems reading the book, but if I hit "Goto" there is no table-of-contents available despite there being one in the original epub. In order to see if this was somehow left out by kindlegen I used the companion kindleimport plugin on the mobi file and was a bit surprised to see the table of contents was imported!

So it seems as if there is something peculiar about the generated mobi file that my K3 doesn't like even though the plugins have no problems with it. Obviously I can read the book without the table of contents, but it is annoying.

Dave

Doitsu 11-25-2015 05:28 PM

Quote:

Originally Posted by dhdurgee (Post 3212410)
I am having no problems reading the book, but if I hit "Goto" there is no table-of-contents available despite there being one in the original epub.

You'll need to mark the HTML TOC via Add Semantics > Table of Contents.

This will add the following line to the opf <guide> section:

Code:

<reference  type="toc" title="Table Of Contents" href="Text/TOC.xhtml"/>

Hendrixxxxxxxx 12-24-2015 02:12 AM

Question
 
Doitsu,

Just a question.

Each time I run the Kindlegen plugin, I notice this error - "Info(pagemap):I8000: No Page map found in the book" - in the output, no matter what the book is or what I have done to it..

It's not a major, because as far as I can see, it doesn't seem to affect anything, but just wondering what this pertains to, and whether there is something else I should be doing in Sigil. I can't see any page map generation option in Sigil.

I am asking purely for my edification.

Doitsu 12-24-2015 02:38 AM

Quote:

Originally Posted by Hendrixxxxxxxx (Post 3229432)
Each time I run the Kindlegen plugin, I notice this error - "Info(pagemap):I8000: No Page map found in the book" - in the output, no matter what the book is or what I have done to it..

That message comes directly from KindleGen; you can ignore it, unless you're trying to generate a Kindle book with "real page numbers" from an epub with either an Adobe pagemap or an NCX pagelist in it.

Hendrixxxxxxxx 12-24-2015 08:45 AM

Quote:

Originally Posted by Doitsu (Post 3229437)
That message comes directly from KindleGen; you can ignore it, unless you're trying to generate a Kindle book with "real page numbers" from an epub with either an Adobe pagemap or an NCX pagelist in it.

Understand. I HAVE been ignoring it - but then I started wondering what it was.

Makes sense.

Thanks.

dhdurgee 02-09-2016 05:32 PM

I'm encountering a problem with the output of this plugin on my Kindle (KT2) running 5.6.5 firmware. Now that the jailbreak is available for that release I have done so and installed the screensaver hack. This is working fine with the .mobi output of the plugin, but the .azw3 output is not operating properly.

The author of the screensaver hack has determined the problem, but it will need to be addressed here as it involves missing information in the file. Please see the thread:

https://www.mobileread.com/forums/sho...postcount=1829

Help.

Dave


All times are GMT -4. The time now is 08:25 PM.

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