Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 06-25-2020, 02:46 PM   #46
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by DNSB View Post
But @mcdummy did not want the undefined classes removed. He wanted to be informed about them so he could add the required classes. For that, I thought the Report tool was an already implemented solution.
Nevertheless it would still be useful if the plugin removed them from the CSS files. As an option.

Along those lines I've had times when a book has a lot of "crud" html and it would have been nice if Sigil's Report thing would list all of the used html tags.
hobnail is offline   Reply With Quote
Old 06-25-2020, 02:48 PM   #47
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by DNSB View Post
But @mcdummy did not want the undefined classes removed. He wanted to be informed about them so he could add the required classes. For that, I thought the Report tool was an already implemented solution.
Nevertheless it would still be useful if the plugin removed undefined CSS as well as unused CSS. As an option.

Along those lines I've had times when a book has a lot of "crud" html and it would have been nice if Sigil's Report thing would list all of the used html tags.

Last edited by hobnail; 06-25-2020 at 02:50 PM.
hobnail is offline   Reply With Quote
Advert
Old 06-25-2020, 02:55 PM   #48
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,630
Karma: 5433388
Join Date: Nov 2009
Device: many
FWIW, There is no such thing as "unused" html tags. Under the html5 spec you can actually define your own tags. These can be processed using javascript as well.
KevinH is online now   Reply With Quote
Old 06-25-2020, 03:04 PM   #49
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by KevinH View Post
FWIW, There is no such thing as "unused" html tags. Under the html5 spec you can actually define your own tags. These can be processed using javascript as well.
I was thinking along the lines of the book using things like blockquote when it clearly wasn't a quote, or h5 for bolding.
hobnail is offline   Reply With Quote
Old 06-25-2020, 03:05 PM   #50
hobnail
Running with scissors
hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.hobnail ought to be getting tired of karma fortunes by now.
 
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
Quote:
Originally Posted by KevinH View Post
FWIW, There is no such thing as "unused" html tags. Under the html5 spec you can actually define your own tags. These can be processed using javascript as well.
Do you need to provide a schema?
hobnail is offline   Reply With Quote
Advert
Old 06-25-2020, 03:06 PM   #51
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,887
Karma: 128597114
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 DNSB View Post
I suppose cssRemoveUnusedSelectors plugin could be modified so undefined classes would be added to the stylesheet as a blank selector ( .whatever {} ) but not sure how much easier that would make the job. Are you volunteering to code and test this?
Thing is, there are a lot of eBooks that have nonexistent classes in the HTML. Some of those classes ae used in place of an ID. The others, I have no idea why they are there or why the CSS is missing those classes.
JSWolf is offline   Reply With Quote
Old 06-26-2020, 02:38 AM   #52
mcdummy
Connoisseur
mcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the rough
 
mcdummy's Avatar
 
Posts: 56
Karma: 7130
Join Date: Apr 2015
Device: PRS-T3
Thanks to comments by @DNSB and @hobnail.

It would be good to have both an information showing the undefined/non-existing classes and an option to remove those of them that a user does not want to keep.

A manual removal could be quite complicated, since I've seen constructions like class="class1 class2 ... classN", which makes it difficult to remove a specific class (even with regex) if it has a "conventional" name like "center" or the name of class2 (e.g., heading, author) is also a part of classN (e.g., subheading, co-author).

An option for the generation of empty classes for the ones that are kept would be the icing on the cake.

I don't know if this already exists in the plugin, but since there's a discussion about code additions.

I've seen style sheets contain class definitions two or more times. Therefore, it would be good, if these definitions were merged.

I further noticed that sometimes classes contain the same instruction several times but with different values, e.g., "text-align: left" followed later by "text-align: right". Since only the last definition will be applied, it would be advantageous to remove the first.
mcdummy is offline   Reply With Quote
Old 06-27-2020, 01:00 PM   #53
wrCisco
Enthusiast
wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.
 
Posts: 34
Karma: 467802
Join Date: Apr 2016
Device: none
Hi mcdummy,
I'd rather think about providing a different plugin that could automatically remove unmatched classes in xml/xhtml than modifying this one. That's because this plugin is designed to run as safely as possible on as many epubs out there as possible, and in doing so it changes absolutely nothing outside of css files. Adding this feature would open a whole new set of issues and edge cases to be worried about.

If (but that's a big if) I find the time in the next days I'll try to put something together (but if someone else wants to step up, please feel free to do so).

About the other suggestions, I find them interesting, and I'll think about them a bit more, although I'm not totally convinced. These are my thoughts for now.

Just showing the classes unmatched by a selector is already done by the Reports tool as DNSB pointed out.

About merging rulesets, I think that's not impossible, but that's not totally safe either:
Code:
.classA {}
.classB { color: red }
.classA { color: blue }
is not the same as
Code:
.classA { color: blue }
.classB { color: red }
for a tag like <p class="classA classB">.

Quote:
Originally Posted by mcdummy View Post
I further noticed that sometimes classes contain the same instruction several times but with different values, e.g., "text-align: left" followed later by "text-align: right". Since only the last definition will be applied, it would be advantageous to remove the first.
True, unless the rendering engine of the epub reader decides that the last property has an invalid value: in that case it will use (probably) the first one.

@hobnail: I'm not sure I understood your last posts: do you have a specific proposal or were you simply backing the request of mcdummy?
wrCisco is offline   Reply With Quote
Old 06-29-2020, 10:22 AM   #54
mcdummy
Connoisseur
mcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the roughmcdummy is a jewel in the rough
 
mcdummy's Avatar
 
Posts: 56
Karma: 7130
Join Date: Apr 2015
Device: PRS-T3
Quote:
Originally Posted by wrCisco View Post
I'd rather think about providing a different plugin that could automatically remove unmatched classes in xml/xhtml than modifying this one. That's because this plugin is designed to run as safely as possible on as many epubs out there as possible, and in doing so it changes absolutely nothing outside of css files. Adding this feature would open a whole new set of issues and edge cases to be worried about.
I'm happy with a separate plugin, if it both indicates the unmatched classes and provides an option to select those that should be deleted. Automatic deletion is a bit disadvantageous, since I often want to keep some of the classes and add the definitions to the css.

Quote:
Originally Posted by wrCisco View Post
Just showing the classes unmatched by a selector is already done by the Reports tool as DNSB pointed out.
Combining the report and deletion in one tool makes things easier.

Quote:
Originally Posted by wrCisco View Post
About merging rulesets, I think that's not impossible, but that's not totally safe either:
Code:
.classA {}
.classB { color: red }
.classA { color: blue }
is not the same as
Code:
.classA { color: blue }
.classB { color: red }
for a tag like <p class="classA classB">.
Was not aware of this problem. It would be good to be informed about double defintions either of classes or within a class. An option to merge or delete double definitions would be great.
mcdummy is offline   Reply With Quote
Old 08-22-2020, 01:24 PM   #55
wrCisco
Enthusiast
wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.wrCisco ought to be getting tired of karma fortunes by now.
 
Posts: 34
Karma: 467802
Join Date: Apr 2016
Device: none
Quote:
Originally Posted by mcdummy View Post
I'm happy with a separate plugin, if it both indicates the unmatched classes and provides an option to select those that should be deleted. Automatic deletion is a bit disadvantageous, since I often want to keep some of the classes and add the definitions to the css.
Hi, I uploaded last week the plugin you requested (here's the thread) and forgot to mention it here...

Meanwhile, I uploaded version 0.3.2 of this plugin with an icon for displaying in Sigil.
wrCisco is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[GUI Plugin] KindleUnpack - The Plugin DiapDealer Plugins 492 10-25-2022 08:13 AM
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 08:05 PM.


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