Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 05-09-2021, 12:16 PM   #76
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,023
Karma: 10963125
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
O. k. Thank you! I meant the plugin only to produce an epub by a different way. Besides, I'll try to use it on my 64 bit computer anyway.
Leonatus is offline   Reply With Quote
Old 05-09-2021, 03:45 PM   #77
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Given that we've had a report of an old version of Sigil that's using Tidy caused significant code loss, I would stay away from any plugin that uses Tidy.
JSWolf is offline   Reply With Quote
Old 05-09-2021, 04:10 PM   #78
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Tidy itself is an excellent tool and has been completely revamped for html5. But that happened after we had already chosen to go with Google's gumbo parser. So I would not compare the old Tidy used in really old versions of Sigil with Tidy that is available today.
KevinH is offline   Reply With Quote
Old 05-09-2021, 05:49 PM   #79
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,983
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by KevinH View Post
Tidy itself is an excellent tool and has been completely revamped for html5. But that happened after we had already chosen to go with Google's gumbo parser. So I would not compare the old Tidy used in really old versions of Sigil with Tidy that is available today.
What version of Tidy is bundled with the plugin? Is it a new enough version?
JSWolf is offline   Reply With Quote
Old 05-09-2021, 06:11 PM   #80
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Don't worry about it, Jon.
DiapDealer is offline   Reply With Quote
Old 05-09-2021, 06:22 PM   #81
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
This error is more than likely just a missing C/C++ runtime (MSVCR100.dll). Both of the tidy.dll files included in this plugin are dependent on the MS Visual C/C++ 2010 runtime. Which Microsoft stopped shipping by default with Windows 10. Yay! Many programs might install it along the way, but sometimes a Windows 10 machine can avoid getting it installed altogether if older programs are never installed on it.

The handy-dandy Windows OS error stating that win32/tidy.dll could not be found is actually the same exact error you get when a dependency of win32/tidy.dll cannot be found (in this case: MSVCR100.dll). Handy, I know.

Make sure you get the x86 version of the redistributable runtime for Visual Studio 2010: https://support.microsoft.com/en-us/...f-95f26a218cc0 and you should be up and running.

Or even more directly: https://www.microsoft.com/en-us/down....aspx?id=26999

Last edited by DiapDealer; 05-09-2021 at 06:53 PM.
DiapDealer is offline   Reply With Quote
Old 05-10-2021, 06:26 AM   #82
Leonatus
Wizard
Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.Leonatus ought to be getting tired of karma fortunes by now.
 
Leonatus's Avatar
 
Posts: 1,023
Karma: 10963125
Join Date: Mar 2013
Location: Guben, Brandenburg, Germany
Device: Kobo Clara 2E, Tolino Shine 3
@DiapDealer: Yes, that was the problem. Now that I installed Visual C/C++ runtime, both the CustomCleaner++ and the Html2Epub plugin work well.
One has to check for updates of Visual C/C++ manually, I suppose?

I think I'll use the plugins frequently, as they produce an epub as I like. Thanks to all!
Leonatus is offline   Reply With Quote
Old 05-10-2021, 09:18 AM   #83
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,549
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by Leonatus View Post
@DiapDealer: Yes, that was the problem. Now that I installed Visual C/C++ runtime, both the CustomCleaner++ and the Html2Epub plugin work well.
One has to check for updates of Visual C/C++ manually, I suppose?

I think I'll use the plugins frequently, as they produce an epub as I like. Thanks to all!
There's not likely to be any more updates for the 2010 Visual C/C++ runtime. And starting with Visual Studio 2015, any programs compiled with Visual Studio 2015-2019 will work with the same runtime that comes pre-installed. They seem to have gotten their act together in that regard (finally).

So except for the rare program that needs the Visual 2010 or 2013 runtime, you should be good to go. And most program installers will tell you explicitly what you're lacking. It's only this rare case of including dlls with a python script where something might fall through the cracks. It used to be that Sigil itself would have provided the 2010 runtime for you. But that was back when Sigil was using VS2010 and VS2013 runtimes.

I try to cross compile dlls for scripts like this with MinGW wherever possible to remove any dependencies upon a specific MSVCR version for precisely this reason. But I've ever tried building the newer libtidy-html5, so I don't know if that's easily doable. Glad its working for you now!
DiapDealer is offline   Reply With Quote
Old 05-08-2022, 03:10 PM   #84
tamaracks
Connoisseur
tamaracks began at the beginning.
 
tamaracks's Avatar
 
Posts: 53
Karma: 10
Join Date: Jun 2021
Device: Onyx Boox Nova3
This plugin seems to mess up any pseudo-class or pseudo-element selectors by putting spaces after every colon in CSS files.

For instance

Code:
p::first-letter {
becomes

Code:
p: : first-letter {
Unless I'm doing something wrong?
tamaracks is offline   Reply With Quote
Old 05-08-2022, 03:19 PM   #85
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Not sure if this is the reason or not but ..

::first-letter is css3 specific and thus epub3 not epup2.

Under css 2.1 this would be just :first-letter
KevinH is offline   Reply With Quote
Old 05-08-2022, 11:54 PM   #86
tamaracks
Connoisseur
tamaracks began at the beginning.
 
tamaracks's Avatar
 
Posts: 53
Karma: 10
Join Date: Jun 2021
Device: Onyx Boox Nova3
That's good to know about the difference in CSS, but p:first-letter also turns into p: first-letter, so I don't think that's the reason?
tamaracks is offline   Reply With Quote
Old 05-09-2022, 08:34 AM   #87
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Is this in an external but linked stylesheet or inside a style tag in the xhtml head tag? If the latter, have you tried converting it to an external stylesheet where it may not be parsed.

Perhaps the html parser being used does not grok pseudo classes. Again just a guess.
KevinH is offline   Reply With Quote
Old 05-09-2022, 09:57 AM   #88
tamaracks
Connoisseur
tamaracks began at the beginning.
 
tamaracks's Avatar
 
Posts: 53
Karma: 10
Join Date: Jun 2021
Device: Onyx Boox Nova3
It is an external stylesheet.


Sent from my iPhone using Tapatalk
tamaracks is offline   Reply With Quote
Old 05-09-2022, 10:35 AM   #89
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,644
Karma: 5433388
Join Date: Nov 2009
Device: many
Its a bug in cutils2.py in the removeBadAttributesfromCSS(wdir, file) routine.

It does not properly skip over the selector line in the css and instead treats every line in the css file like an "property: value;" line and near the end of that routine does the following:

Code:
            else:
                if 'a:link' not in line and 'a:visited' not in line:
                    if ':' in line:
                        if ': ' in line:
                            pass
                        else:
                            line = line.replace(':', ': ')                        
                outfp.write(line)
The list of exclusions should be greatly extended to skip things if this is a selector line or to at least skip all know pseudo elements and pseudo classes.

Perhaps you can help the author of this plugin by making a list of all legal pseudo classes and psuedo elements so that a proper set of exclusions from applying this rule can be more easily added.

Or alternatively, the author could use the python css-parser module that is part of every Sigil plugin environment, to screen things to only apply to

property : value;

lines of a selector and not the selector itself.

Last edited by KevinH; 05-09-2022 at 10:39 AM.
KevinH is offline   Reply With Quote
Old 05-09-2022, 05:47 PM   #90
tamaracks
Connoisseur
tamaracks began at the beginning.
 
tamaracks's Avatar
 
Posts: 53
Karma: 10
Join Date: Jun 2021
Device: Onyx Boox Nova3
Quote:
Originally Posted by KevinH View Post
Its a bug in cutils2.py in the removeBadAttributesfromCSS(wdir, file) routine.
Thanks for tracking down the location! I tried to look up what pseudo selectors/elements would be valid, but I'm not sure if I know where to find the right answer at the moment. And also, even if there's a pseudo-selector that isn't approved for EPUB, a simple exception list doesn't cover it, because you *still* wouldn't want to break up the colons, I think. Because you're just making it less valid.

I took a different tack and rewrote that whole if statement to only make a change if a : and ; are detected in the line. Which I think should help in most cases. I'm sure there's a flaw there too, if this code is covering both HTML and CSS files, but I think it errs on the side of not changing a thing instead of breaking it. I'm not entirely sure what this part of the code is intended to fix, to be honest. Just to make it look more readable/uniform? If that's the case, it's not taking into account the ' : ' I just saw in one book's CSS, so it's incomplete anyway. Which is fine, it just makes me not feel bad about my change being incomplete, haha.

I think you're right that using a css parser would be the way to go, but my python skills are quite nascent, so I don't have the time to work it out. However I've noticed that Sigil has a 'ReformatCSSMultipleLines' command in Automate Lists that seems to do a pretty decent job. Interestingly, I can only find it in Automate lists, not as a menu command somewhere else, unless I'm missing something. Can a plugin call those commands?

For now, this is what I ended up with for that section of code:
Code:
            else:
                if ':' in line and ';' in line:
                    if ': ' in line:
                        pass
                    else:
                        line = line.replace(':', ': ')
                else:
                    pass    
                outfp.write(line)
tamaracks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[FileType Plugin] YVES Bible Plugin ClashTheBunny Plugins 27 01-16-2023 01:25 AM
Problem with my ScrambleEbook plugin and the Plugin Updater tool jackie_w Development 14 01-19-2017 10:49 PM
Plugin not customizable: Plugin: HTML Output does not need customization flyingfoxlee Conversion 2 02-24-2012 02:24 AM
[GUI Plugin] Plugin Updater **Deprecated** kiwidude Plugins 159 06-19-2011 12:27 PM
New Plugin Type Idea: Library Plugin cgranade Plugins 3 09-15-2010 12:11 PM


All times are GMT -4. The time now is 07:33 PM.


MobileRead.com is a privately owned, operated and funded community.