View Single Post
Old 10-24-2014, 03:34 PM   #1
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Kindlegen plugin for Sigil

[Plugin] KindleGen - Simple KindleGen wrapper

Updated: August 8, 2023
Current Version: "0.6.9"

This plugin is a very simple kindlegen wrapper for converting epubs to mobi files with kindlegen. (If you're a macOS user or using Sigil 0.9.8 or higher, please download KindleGenQt_v0.6.9.zip, otherwise download KindleGen_v0.5.5.zip.)

Disclaimer: Even though it's unlikely that the plugin will somehow corrupt the epub that you're working on or crash Sigil, you might want to save your ePub in Sigil before running this plugin.

Credits: This plugin uses code originally written by KevinH, nickredding and other KindleUnpack developers. It also uses jhowell's Calibre KFX Output plugin.

System requirements

This plugin requires the Kindlegen binary or Kindle Previewer, which comes with KindleGen. If you uncheck the Use Bundled Python option, you'll also need to install Python, bs4, lxml and Pillow.

Linux users will need to download the kindlegen binary from the Internet Archive and unzip it to a /bin folder.

Installation

1. Select Manage Plugins from the Plugins menu. Select Use Bundled Python to use the bundled interpreter.
If you haven't updated to Sigil 0.9.0 (or higher) click one of the Auto buttons to detect the path or Set to manually select the Python interpreter path. You also might need to install bs4, Pillow and lxml.
2. Click Add Plugin and select KindleGen_v0.6.8.zip. This will install the kindlegen plugin, which you can select via Plugins > Output > KindleGenQt.
If you want to generate KFX files, you'll also need to install Kindle Previewer and jhowell's Calibre KFX Output plugin.
Since the Calibre KFX Output plugin doesn't support Linux, you can't generate KFX files with the Linux version of Sigil.

When you run the plugin for the first time, you'll need to select the kindlegen location, unless you have installed Kindle Previewer in the default folder. Select either kindlegen.exe (Windows) or kindlegen (macOS, Linux).

Settings

By default, the plugin will generate .mobi files using the same parameters as Kindle Previewer (master mobi file, no compression, attached source files).

There are two groups of settings:

1. KindleGen settings that are passed on to the KindleGen binary and allow you to:
  • Prevent KindleGen from attaching the source files.
  • Change the compression factor (0 = no compression, 2 = maximum compression).
  • Display verbose messages.
  • Force Windows-1252 output.
  • Convert .jpg images to .gif files.
  • Change the language used to display KindleGen messages.
2. Postprocessing options that allow you to:
  • Add a fake ASIN number (using DualMetaFix).
  • Split the master mobi file into azw3 and mobi7 components (using KindleUnpack).
  • Generate a KFX file with jhowell's Calibre KFX Output plugin (Windows und macOS only).
  • Generate a thumbnail image for eink Kindles.
  • Change the output folder (default = Desktop).
If you select any of the post-processing options, you can't upload the AZW3/MOBI7/KFX files generated by the plugin to KDP!

The plugin will also check for the presence of the following recommended guide/landmarks/metadata items:
  • SRL = Start Reading Location*
  • TOC = HTML TOC
  • Cover = cover metadata entry

Advanced Settings

* According to the Kindle Publishing Guidelines, the SRL has been deprecated. (If you don't use the SRL, edit KindleGen.json and change "check_srl": true to "check_srl": false.)

License: GNU General Public License v3 (GPL-3)
Attached Thumbnails
Click image for larger version

Name:	KindleGen.png
Views:	1753
Size:	12.5 KB
ID:	165883  
Attached Files
File Type: zip KindleGen_v0.5.5.zip (26.9 KB, 2646 views)
File Type: zip KindleGenQt_v0.6.9.zip (37.8 KB, 569 views)

Last edited by Doitsu; 08-05-2023 at 02:22 AM. Reason: Updated for Qt 6.5.2 and Python 3.11.3
Doitsu is offline   Reply With Quote