View Single Post
Old 08-20-2013, 09:28 PM   #1
jgoguen
Generally Awesome Person
jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.jgoguen ought to be getting tired of karma fortunes by now.
 
Posts: 1,061
Karma: 2178845
Join Date: Jan 2013
Location: /dev/kmem
Device: Kobo Clara HD, Kindle Oasis
[Conversion Output] KePub Output Plugin

THIS PLUGIN IS BEING INTERMITTENTLY DEVELOPED! FEATURE REQUESTS AND BUG REPORTS MAY TAKE A FEW DAYS TO BE REPLIED TO.

This plugin allows creating KePub files without requiring a Kobo device to be connected.Converted books are saved to the calibre library as the 'KEPUB' format. ePub books processed with this plugin and sent to a modern Kobo device will be rendered using Kobo's internal kepub renderer instead of the standard ePub renderer.

Please see the README file for the most current details. I will try to keep this post up to date, but the README is always up to date.

WARNING: THE CONVERSION OUTPUT FORMAT PLUGIN GENERATES FILES WHOSE INTERNAL STRUCTURE IS STILL UNDER DEVELOPMENT. THE KEPUB FILE STRUCTURE IS NOT YET FULLY UNDERSTOOD. DO NOT, UNDER ANY CIRCUMSTANCES, DELETE THE FILES FOR THE SOURCE FORMAT. ALWAYS HAVE A NON-KEPUB FORMAT FOR YOUR BOOKS.

The main benefits of using the kepub renderer (which some may prefer not to have) are:
  • Page numbers show the number of page turns remaining in the current chapter instead of the estimated number of pages for the entire book.
    • If you don't want this, there is an option in the driver settings to force full-book page numbers.
  • Reading statistics (time left in this chapter, time for the next chapter, time to complete the book)
  • The book title is shown at the top of each page.
  • The chapter title, if any, is shown at the bottom of each page with the page numbers.

You are encouraged to install these two plugins as well, to ensure KePub metadata is correctly processed:

Usage
To use this plugin after installing:
  • Select the book(s) you want to convert.
  • Select the KEPUB output format
  • Choose your settings
  • Convert the books

WARNING: THE CONVERSION OUTPUT FORMAT PLUGIN GENERATES FILES WHOSE INTERNAL STRUCTURE IS STILL UNDER DEVELOPMENT. THE KEPUB FILE STRUCTURE IS NOT YET FULLY UNDERSTOOD. DO NOT, UNDER ANY CIRCUMSTANCES, DELETE THE FILES FOR THE SOURCE FORMAT. ALWAYS HAVE A NON-KEPUB FORMAT FOR YOUR BOOKS.

Special Notes
  • This plugin requires calibre 5.0.0 or later!
  • This device plugin enables access to Kobo features that are written with the expectation that only unmodified Kobo-purchased books will be used. Do not approach Kobo for support unless you see the exact same issue with a book purchased from Kobo and synced to your device via Kobo Desktop or direct wireless download.
  • Conversion defaults can be set in Preferences -> Output

Installation Directions

Open Preferences -> Plugins -> Get new plugins and install the 'KePub Output' plugin. You may also download the attached zip file and install the plugin manually, then restart calibre as described in the Introduction to Plugins thread.

Contributing

Decided you want to contribute to the development of this plugin? Awesome! If you want to contribute to the development of this plugin, you have many options:
  • Contribute code, whether for existing bug reports, for new bugs that you found, or for new features that you really want to see implemented. To contribute code, you may fork the repository and send a pull request, or you may send me a PM here with a Git patch file.
  • Submit bug reports on GitHub. Although I'm happy to discuss the plugin here, I may still ask you to create a bug report; this is so I actually remember to investigate your request!
  • Test pre-released code from GitHub. Between releases, new code is committed and may be installed using directions provided in the README file. Based on your testing, you may submit bug reports, provide feedback, think of new feature requests, or just generally enjoy early access (and not necessarily stable code!) to upcoming versions of the plugin.
  • Translate the plugin on the plugin's Transifex page.


Although I'm generally perfectly happy to discuss possible issues here, any issues sent to me through any means other than the Github bug tracker (including email, PM, etc.) may be silently ignored. This is not because I don't care! It's because I have a terrible memory, the Github issue tracker is my "to-do list" for this plugin, and there's been instances where I've seen a post or PM here and promptly forgotten all about it until I happened to stumble across the post again later. If you aren't sure if you have an issue, feel free to post here and we can work together to decide if you need to make a new Github issue or not. If you are sure you have an issue, or if you have an error or exception from calibre, post a new issue. It isn't necessary to post here when you make a new issue, I get notified of all new bugs and I check the list regularly. The worst that could possibly happen on Github is the same that could happen here: I'll tell you that it's not a bug and you'll have the opportunity to convince me otherwise!

Version History

Spoiler:

Version 3.6.6 - 2023-09-20
Update translations for Spanish (es_ES)
Version 3.6.5 - 2023-08-15
Update translations for Portuguese (Brazil) and Italian
Version 3.6.4 - 2023-07-17
Fix a timeout error that may occur when processing a large number of books.
Version 3.6.3 - 2022-07-31
Fix issues with threading and with calibre 6/QT6 (thanks davidfor!)
Version 3.6.0 - 2022-06-06
Keeping in sync with KoboTouchExtended conversion code
Version 3.5.3 - 2021-08-13
Use calibre smartyPants for punctuation smartening
Version 3.5.2 - 2021-07-17
Fix issue with exceptions being thrown in subprocesses
Version 3.5.1 - 2021-07-04
No longer compatible with Python 2
Use a process pool to avoid starting too many threads on massive books (https://github.com/jgoguen/calibre-k...ver/issues/135)
Version 3.4.4 - 2021-01-11
Hopefully fix random disappearing spaces between some words
Version 3.4.3 - 2021-01-05
Fix for non-English locales on Windows failing to load or install the plugin
Version 3.4.2 - 2020-12-30
Fix from davidfor to properly reset the paragraph counter when uploading multiple files
Version 3.4.1 - 2020-10-11
Fix a bug with duplicating koboSpan IDs within a file.
Add options to control hyphenation settings (word length, characters before and after).
Python 2 testing removed.
Version 3.3.0 - 2020-10-09
Make the KePub conversion multi-threaded.
Remove obsolete CSS hyphenation properties.
Version 3.2.15 - 2020-08-21
Skips <svg> tags and children when adding Kobo spans.
Version 3.2.13 - 2020-07-04
Fix HTML cleanup in the container and exception string processing
Version 3.2.12 - 2020-06-22
Fixes from davidfor for adding a closing </p> in the wrong place
Version 3.2.11 - 2020-06-20
Stop stripping whitespace from the left of each text chunk.
Version 3.2.10 - 2020-06-17
Fix from NiLuJe for more Unicode processing and some misplaced KEPubContainer references.
Version 3.2.9 - 2020-06-17
Fix issue with the logger object not being callable and the conversion adding stray <br> tags
Version 3.2.7 - 2020-05-16
Fix Windows issues with Unicode strings.
Version 3.2.3 - 2020-05-11
Fix logging issue with non-ASCII characters on Windows
Version 3.2.2 - 2020-05-10
Python 3 compatibility - Plugin loads in both calibre and Python 3 calibre beta
Version 3.1.4 - 2019-05-05
Fix exception seen when saving settings (but did not block saving)
Version 3.1.2 - 2019-04-30
Fix bad preference migration seen by some people
Version 3.1.0 - 2019-04-21
Remove code to replace the book language, now handled by the base Kobo driver when sending the file to a device.
Version 3.0.0 - 2017-10-30
Imported to BitBucket, made small bugfix and formatting changes, new translations
Version 2.7.1 - 2016-06-26
Spanish (es_ES) translation update
Version 2.7.0 - 2016-06-25
Code cleanup from new driver code, no-op functionally
[B]Version 2.6.2 - 2016-05-16
Fix exceptions raised when the spine has files not actually in the book (a.k.a., fixing what the publisher should be fixing)
[B]Version 2.6.1 - 2016-04-13
Fix spaces being removed from some tags
[B]Version 2.6.0 - 2016-04-09
Be more Kobo-like in KePub generation (whitespace between sentences goes at the beginning of the following span)
Version 2.5.3 - 2015-09-30
Fix problem preventing the cover image from being set properly with unusually-set OPF IDs
Version 2.5.1 - 2015-08-05
Fix issues with file names not being handled properly
Version 2.3.3 - 2015-02-02
Update style-hacks.css to remove everything except the padding rules
Version 2.3.2 - 2015-01-30
Update to wrap the book text in divs matching Kobo KePubs, with accompanying CSS changes
Version 2.2.20 - 2014-08-14
Fix indentation issue from last update
Version 2.2.19 - 2014-08-13
Fix an issue with text after empty tags being duplicated
Version 2.2.18 - 2014-07-16
Fix an issue with prefs pane not loading properly in calibre beta
Version 2.2.17 - 2014-07-09
Compatibility with upcoming calibre 2
Version 2.2.16 - 2014-05-30
Bug #1324884 - Image tags need to be wrapped in koboSpan tags
Version 2.2.15 - 2014-05-01
Bug #1310967 - properly decode content files when they aren't UTF-8
Version 2.2.14 - 2013-12-20
Translations update
Version 2.2.13 - 2013-11-26
Bug #1252050 - Do not translate the plugin name.
Version 2.2.12 - 2013-11-08
Bug #1246505 - Stop adding spaces around em-dashes
Add translation support and initial translations
Version 2.2.10 - 2013-10-13
Minor improvements from KoboTouchExtended development
Version 2.2.5 - 2013-08-25
Bug #1216504: Properly handle Processing Instruction and Comment nodes
Version 2.2.3 - 2013-08-20
Initial release. Version set to remain in sync with KoboTouchExtended.
Attached Files
File Type: zip KePub Output.zip (42.2 KB, 13908 views)

Last edited by jgoguen; 09-20-2023 at 10:25 AM.
jgoguen is offline   Reply With Quote