09-29-2014, 08:32 PM | #16 |
Sigil Developer
Posts: 7,637
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi JSWolf,
I decided it was better to fix this in mobi_header.py alongside where we fixed the same problem with CoverOffset values. So I have attached a new mobi_header.py.zip. Use it to replace its namesake in kindleunpack/lib/ inside KindleImport and in KindleUnpack_v0.75/lib/ as well. Be careful to zip up the KindleImport zip exactly as it had been so that it still works as a plugin. If it works, please let me know and I will add it for the next KindleUnpack release. Thanks, Kevin |
09-29-2014, 10:36 PM | #17 |
Resident Curmudgeon
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
OK, I've tried the test version of mobi_header.py and it didn't work. Different error this time.
Code:
Status: failed Traceback (most recent call last): File "C:\Program Files\Sigil\plugin_launchers\\python\launcher.py", line 137, in launch self.exitcode = target_script.run(container) File "C:\Users\Jon\AppData\Local\sigil-ebook\sigil\plugins\KindleImport\plugin.py", line 113, in run epub = qe.makeEPUB() File "C:\Users\Jon\AppData\Local\sigil-ebook\sigil\plugins\KindleImport\quickepub.py", line 51, in makeEPUB xhtmlstr, css, cssname = ml2html.processml() File "C:\Users\Jon\AppData\Local\sigil-ebook\sigil\plugins\KindleImport\mobiml2xhtml.py", line 219, in processml htmlstr += self.processtag(taginfo) File "C:\Users\Jon\AppData\Local\sigil-ebook\sigil\plugins\KindleImport\mobiml2xhtml.py", line 445, in processtag styles.append('font-size: %s' % size_to_em_map[sz]) KeyError: 'normal' Error: 'normal' |
Advert | |
|
09-29-2014, 11:02 PM | #18 |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Actually, it looks like Kevin's fix worked on the KindleUnpack side of things. Your new error is squarely back in the hands of my KindleImport plugin. I'll try to take a peek tomorrow. I know I should stop being surprised by what finds its way into mobi markup, but ... dang! A font size attribute value of "normal"? That's a new one on me.
|
09-30-2014, 05:44 AM | #19 |
Junior Member
Posts: 9
Karma: 166666
Join Date: Aug 2014
Device: Kindle PW2
|
Ugh. It's most likely produced by CSS flattening tools--I've seen many big-name publisher stylesheets sporting "font-size: normal;" stanzas. And since some seem to run a preprocessor on the source markup before feeding it to kindlegen, it infects the output as well. kindlegen does warn about this, but allows it through regardless, and people ignore warnings when they seem to cause no ill effects at first. Arguably a kindlegen bug, but, well...
Incidentally, you might want to prepare yourself for "vertical-align: sup" instead of "super" as well |
09-30-2014, 07:09 AM | #20 | |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
I'm not trying to fix everything prior to opening in Sigil. But the <font> tags (in mobi-only, html 3.2ish markup) were one thing I wanted to try to "fix up" (since it's so prevalent). I'll just have to make allowances for size attribute values other than [+/-]1-7, and x[x[x]]-small|medium|large. Getting some of those messy mobis (non-KF8) open in Sigil isn't going to be doing users any huge favors in some cases. They're still going to have their work cut out for them getting them cleaned up. Last edited by DiapDealer; 09-30-2014 at 07:12 AM. |
|
Advert | |
|
09-30-2014, 09:49 AM | #21 |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
@KevinH
Unrelated to (and regardless of) what I decide to do for the newly opened epub's temporary name, I think we need to examine KindleUnpack's file naming methods for mobi-only kindlebooks. We're technically creating invalid OPF/NCX files whenever the original file name has an ampersand in it. Which means I'm, in turn, creating an invalid container.xml file when trying to man-handle KindleUnpack's output into an epub structure with this plugin. It's either that, or I need to sanitize all filenames with my plugin (when unpacking mobi-only kindlebooks) and replace all references to them in all the KindelUnpack-produced files with those sanitized versions. A thought I don't really relish, needless to say. The KF8 portions of Kindlebooks, don't suffer this file naming "problem." Last edited by DiapDealer; 09-30-2014 at 09:51 AM. |
09-30-2014, 10:27 AM | #22 | |
Sigil Developer
Posts: 7,637
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi DiapDealer's,
Yes, I am never a fan of using titles as file names because of all that nonsense. I will go grab a file name sanitizer routine. Also, I agree with you in changing the base name of the file to match what we do with KF8 to prevent these difficulties in the first place. Feel free to fix those in KindleUnpack any way you like (as well as any other related changes you need) and I will add them to the next KindleUnpack release to keep things in sync. Thanks, KevinH Quote:
|
|
09-30-2014, 03:01 PM | #23 | ||
actually it is /var/log
Posts: 341
Karma: 2994236
Join Date: Sep 2012
Location: usually Europa
Device: prs t1
|
Quote:
Quote:
Original file name would be second choice for me. This would be in most cases unique but not necessarily meaningful. Both of them would be optimal but, as I've mentioned, somehow overkill. |
||
09-30-2014, 03:29 PM | #24 |
Resident Curmudgeon
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Before you get your proper filename, I'd just like to get the eBook.
|
09-30-2014, 04:04 PM | #25 |
actually it is /var/log
Posts: 341
Karma: 2994236
Join Date: Sep 2012
Location: usually Europa
Device: prs t1
|
|
09-30-2014, 06:57 PM | #26 | |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
@varlog I'm not convinced that something might not break with the filename experimentation I've done (it's actually incomplete on the KF8 side of things in this beta), but let me know what you think. |
|
09-30-2014, 08:31 PM | #27 |
Sigil & calibre developer
Posts: 2,488
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
|
That is correct. You should have been clearer about the reason for the patch. The patch itself would still have been rejected. You shouldn't check for special dir names in the path. The proper solution is to expose a clear_save_name function from MainWindow and have plugin runner call this after loading the book.
|
09-30-2014, 10:25 PM | #28 |
Resident Curmudgeon
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Yes it worked. Now, would it be possible to split the HTML at the chapter stops? That would make things much easier to deal with. With the entire eBook as a single HTML males Sigil very slow.
|
09-30-2014, 10:39 PM | #29 |
Sigil Developer
Posts: 7,637
Karma: 5433388
Join Date: Nov 2009
Device: many
|
Hi,
I think you can insert Sigil split markers using Sigil's find and replace regular expressions and then split the file into all chapters at one time. Since chapter starting points may change formats across ebooks, using a custom regular expression in Sigil is probably the best approach. KevinH |
09-30-2014, 11:10 PM | #30 | |
Grand Sorcerer
Posts: 27,547
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
epubcheck plugin for Sigil | Doitsu | Plugins | 502 | 02-20-2024 06:58 AM |
kindlegen plugin for Sigil | Doitsu | Plugins | 169 | 02-16-2024 06:48 AM |
[Plugin] PunctuationSmarten Sigil plugin | DiapDealer | Plugins | 138 | 07-11-2023 11:22 AM |
[Plugin] ePub3-itizer - epub3 output plugin for Sigil | KevinH | Plugins | 435 | 01-19-2023 09:46 PM |
smoothRemove_v010 plugin for Sigil | kbanelas | Plugins | 15 | 01-27-2017 05:51 PM |