06-25-2020, 02:46 PM | #46 | |
Running with scissors
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
|
Quote:
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. |
|
06-25-2020, 02:48 PM | #47 | |
Running with scissors
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
|
Quote:
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. |
|
Advert | |
|
06-25-2020, 02:55 PM | #48 |
Sigil Developer
Posts: 7,875
Karma: 5449552
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.
|
06-25-2020, 03:04 PM | #49 |
Running with scissors
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
|
I was thinking along the lines of the book using things like blockquote when it clearly wasn't a quote, or h5 for bolding.
|
06-25-2020, 03:05 PM | #50 |
Running with scissors
Posts: 1,552
Karma: 14325282
Join Date: Nov 2019
Device: none
|
|
Advert | |
|
06-25-2020, 03:06 PM | #51 |
Resident Curmudgeon
Posts: 75,047
Karma: 131375774
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
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.
|
06-26-2020, 02:38 AM | #52 |
Connoisseur
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. |
06-27-2020, 01:00 PM | #53 | |
Enthusiast
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 } Code:
.classA { color: blue } .classB { color: red } Quote:
@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? |
|
06-29-2020, 10:22 AM | #54 | |||
Connoisseur
Posts: 56
Karma: 7130
Join Date: Apr 2015
Device: PRS-T3
|
Quote:
Quote:
Quote:
|
|||
08-22-2020, 01:24 PM | #55 | |
Enthusiast
Posts: 34
Karma: 467802
Join Date: Apr 2016
Device: none
|
Quote:
Meanwhile, I uploaded version 0.3.2 of this plugin with an icon for displaying in Sigil. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] KindleUnpack - The Plugin | DiapDealer | Plugins | 494 | 05-18-2024 02:34 AM |
[FileType Plugin] YVES Bible Plugin | ClashTheBunny | Plugins | 27 | 01-16-2023 01:25 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 |