12-16-2016, 10:35 AM | #1 |
Enthusiast
Posts: 45
Karma: 93476
Join Date: Jun 2016
Location: Sweden
Device: Kobo Glo HD, Kobo Aura One LE
|
[Plugin] KePub Output
This output plugin adds kobo spans in all xhtml files, to every sentence. This is to make to the Kobo reader remember how far you've read into a chapter and it also enables annotating and bookmarking.
When you've ran the plugin, it asks where you want to save it. Save as .kepub.epub! It's based code from the Calibre KePub Output Plugin, all credit goes to jgoguen. I modified it to work in Python 3 since that is what Sigil uses. I have only tried it with one story (EPUB3) on Linux, so it might not work for all! Example Spoiler:
You can also check out my helper tool epubmake, which is a Makefile and includes epubcheck, kindlegen and kepubify support. It lets you keep your books in version control! It can watch your current epub file that you're editing and run epubmake on save. Version 0.0.2 Source code on github Last edited by djazz; 12-16-2016 at 07:26 PM. |
12-16-2016, 10:44 AM | #2 |
Grand Sorcerer
Posts: 28,040
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Thanks for the contribution to improve the Sigil experience! I'll see it gets added to the plugin index.
|
Advert | |
|
01-10-2017, 01:22 PM | #3 |
Wizard
Posts: 1,035
Karma: 11227259
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Each time I run the plugin, I get this error:
Code:
TypeError: sequence item 1: expected a bytes-like object, str found Error: sequence item 1: expected a bytes-like object, str found Did I misunderstand something? Sigil v. 0.9.7, Windows 10, 32 bit. |
01-10-2017, 01:53 PM | #4 | |
Grand Sorcerer
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
1. Locate the Kepub Plugin folder (Edit > Preferences > Peferences Location). 2. Open kepubify.py and locate the following line: Code:
root = re.sub(b'<p[^>/]*/>', '<p></p>', root).decode('utf-8') Code:
root = re.sub(b'<p[^>/]*/>', b'<p></p>', root).decode('utf-8')
Last edited by Doitsu; 01-10-2017 at 03:52 PM. |
|
01-10-2017, 02:57 PM | #5 |
Resident Curmudgeon
Posts: 76,432
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Have a look at the Calibre plugin that converts to kepub and make sure your works the same.
|
Advert | |
|
01-10-2017, 03:49 PM | #6 |
Wizard
Posts: 1,035
Karma: 11227259
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
@Doitsu: Works! Great! Thank you!
@JSWolf: What I wanted to have a look at is whether the plugin renders a "real" kepub with the effect that the kepub specialities would be assigned to the book, but this the plugin doesn't seem to afford. Adding it to Calibre renders an epub as input format; substantial changes seem not to take place. |
01-10-2017, 04:15 PM | #7 |
null operator (he/him)
Posts: 20,998
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Leonatus - JSWolf presumably had this calibre plugin in mind ==>> [Conversion Output] KePub Output Plugin
According to the first post for this plugin, it is based on that calibre plugin, which could mean it inherits from the calibre plugin, or the calibre plugin was hacked to create this plugin. The calibre plugin was last updated on June 26 2016, this plugin went to air in December of 2016 . . . BR |
01-11-2017, 03:20 AM | #8 | |
Wizard
Posts: 1,035
Karma: 11227259
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Quote:
|
|
01-11-2017, 04:10 AM | #9 | |
Grand Sorcerer
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
I coudn't hurt to convert some of your books with KevinH's epub3 output plugin and test them on a Kobo (after changing the file extension to .kepub.epub). If the rendering is mostly OK, you could do some research to find out what needs to be changed for Kobo readers and report your findings to the Calibre/Sigil Kepub plugin developers. If it's only minor cosmetic changes that won't invalidate the epub3, KevinH might even be willing to add a Kobo postprocessing option to his epub3 plugin. |
|
01-11-2017, 05:27 AM | #10 |
Wizard
Posts: 1,035
Karma: 11227259
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Thank you for your hints! In fact, I'm not thus keen on rendering my epubs as kepubs. there are advantages of the kepub mode - there are people who don't even like them, though - but there are also some problems that normally leave me to remain at the epub format. For example the hyphenation feature of Kobo doesn't work - at least for me, very reliable, there are many errors, whereas the epub-plugin of SauliusP (Calibre) is very good.
It was mere curiosity that lead me to test the new plugin. |
01-11-2017, 06:25 AM | #11 | |
Resident Curmudgeon
Posts: 76,432
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
So if you don't want kepub,why are you in this thread trying out the plugin to convert to kepub? |
|
01-11-2017, 06:34 AM | #12 | |
Grand Sorcerer
Posts: 24,905
Karma: 47303822
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
Quote:
|
|
01-11-2017, 01:20 PM | #13 | |
Wizard
Posts: 1,035
Karma: 11227259
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
|
Quote:
@Davifor: I made the experience that for example fonts that I had added in the epub (and there showed correctly) did not show on the device after converting the epub to kepub under Calibre. But this was a time ago, and things might have changed meanwhile. I'll give it a try once more, now that all deny my own experience. |
|
01-11-2017, 05:26 PM | #14 | |
Resident Curmudgeon
Posts: 76,432
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
01-11-2017, 05:48 PM | #15 |
Grand Sorcerer
Posts: 6,224
Karma: 16536676
Join Date: Sep 2009
Location: UK
Device: Kobo: KA1, ClaraHD, Forma, Libra2, Clara2E. PocketBook: TouchHD3
|
@Leonatus,
There is another problem you might be running into. By default the Kobo has some internal CSS override code for kepubs which is different from the override used for standard epubs, Code:
* { font-family: %1 !important; } The Kobo Patcher does have a 'fix' for this (patch_name = `Un-Force user font-family in KePubs`) for those (I'm one of them) who dislike the heavy-handed default override. There are 3 alternative replacements to choose from.
|
Tags |
kepub, kobo, sigil plugin |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Conversion Output] KePub Output Plugin | jgoguen | Plugins | 567 | 10-19-2024 06:20 PM |
Kepub Output: get the cover into Table of Contents | jiembe | Kobo Developer's Corner | 0 | 11-03-2016 11:27 AM |
Kepub plugin update not working | Chocky | Calibre | 0 | 12-10-2015 05:35 AM |
Help with KePub plugin | MandyMill | Plugins | 5 | 01-08-2015 04:14 PM |
Plugin not customizable: Plugin: HTML Output does not need customization | flyingfoxlee | Conversion | 2 | 02-24-2012 03:24 AM |