07-08-2017, 08:23 PM | #16 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Fixed cleanup issues on plugin exit(v0.1.4)
Last edited by slowsmile; 07-08-2017 at 11:26 PM. |
07-08-2017, 10:30 PM | #17 |
Hedge Wizard
Posts: 802
Karma: 19999999
Join Date: May 2011
Location: UK/Philippines
Device: Kobo Touch, Nook Simple
|
|
Advert | |
|
07-09-2017, 07:50 PM | #18 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Fixed a problem with the "Save selection" chkbutton not properly saving the current chkbutton selections in the user dialog window(v0.1.5).
|
07-10-2017, 08:05 PM | #19 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
KevinH has confirmed that there were no problems for this plugin on a Mac. He did say that the text size in the dialog was very small. Will increase the dialog text size as advised.
|
07-14-2017, 04:53 AM | #20 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Hi
I used this plugin to correct - images - suppressing divs It works great for these two items. Some books are really cluttered with lots of useless divs. Maybe there could be room for a small improvement. about divs I think that suppressing divs is not very advisable when it concerns images. It replaces the tag div with a tag p, but the second often (at least for French text) introduces a text-indent (while the former never carries one with it) and so the centering of the image is defective. about small images For the images, I remarked the creation of some inline code like Code:
style="txt-align:center" Code:
style="text-align:center" |
Advert | |
|
07-14-2017, 06:47 AM | #21 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
roger64...Regarding the 'txt-align: center' error -- thanks for spotting that mispelling. That will be corrected in the next change soon.
As regards the code that handles image tags -- this can vary. If "Remove div tags" is not selected by the user then all that's added to the image(<img) styling is 'alt=""' if it is needed. This is for epub 2 html compliance so that it will not fail Epubcheck. But if the "Remove all div tags..." is selected by the plugin user then all div lines with associated </div> tags will be removed throughout the html code. This means that div tags will also be removed from all <img> tags if they are used. Similarly if you select "Reformat smaller images..." then only the height and width values are changed or converted from pixel values to % values as inline styling within the <img> tag. Nothing else is touched or changed in the <img> tag or in any associated div tag(unless you have also chosen to remove all div tags as well). The gist of what I'm saying is that the plugin will not automatically remove or suppress divs. It will only remove divs if you choose that option. Thanks again. I'll get the change for the mispelling error out as quick as I can. Last edited by slowsmile; 07-14-2017 at 07:49 AM. |
07-14-2017, 07:48 AM | #22 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
roger64...I've removed some code to fix the problem when you use div tags to surround an <img> tag. 'Reformat smaller ebook images..." should now work without problems (provided that you do not also select "Remove all div tags...")
This fix is in v0.1.8(the current download) |
07-14-2017, 07:57 AM | #23 |
Wizard
Posts: 2,608
Karma: 3000161
Join Date: Jan 2009
Device: Kindle PW3 (wifi)
|
Wow! Flash reaction.
Thank you. |
07-18-2017, 06:06 AM | #24 |
Resident Curmudgeon
Posts: 76,424
Karma: 136564696
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Could a version of this plugin be written for the Calibre editor? Thanks.
|
07-18-2017, 06:24 AM | #25 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
@JSWolf...I'm afraid that I'm not at all experienced at writing plugins for Calibre -- never done it, though I do frequently use that app. And if I did write a cleanup plugin for Calibre it would probably take me a while to learn the Calibre way of doing things(ie the libraries). I'm currently learning PyQT5(for use with Sigil plugins), which seems much easier to use and far less cranky than Tkinter. I believe that the Calibre plugins have been using Qt for a while now. So I am interested.
But for now, I'm not saying yes or no to your request. I'll look into it first and then let you know later on this forum if I can do an equivalent cleanup plugin for Calibre. Hope this is OK. Also, just a reminder -- my Sigil plugin can cleanup both epubs and imported html docs. So what you could perhaps do is simply convert your doc to epub with Calibre, then just open your epub in Sigil and run my CustomCleanerPlus plugin. Doing this will cleanup and remove any dross html data that isn't needed in the epub html, cleanup your stylesheets and will also change or remove html data to ensure compliance with epub 2 (this helps to reduce Epubcheck validation errors later). Last edited by slowsmile; 07-18-2017 at 06:39 AM. |
10-03-2017, 02:23 AM | #26 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Update: This plugin has been updated(v0.2.8):
* Any id attribute value found to contain an illegal digit start character will be repaired by swapping out the illegal digit character and replacing it with an alpha character('x'). This check/repair only occurs in the epub's html files only. So this additional functionality should at least go part way in helping people to resolve Epubchecks infamous "colon" id error. * All excess spacing will be removed from all id values in html files only. * All internal links containing bookmarks will also be appropriately repaired and updated. Last edited by slowsmile; 10-03-2017 at 08:15 PM. |
10-19-2017, 01:04 AM | #27 |
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Plugin Update: Changes in v0.2.9:
* Fixed a problem with the version updater. * Fixed a formatting problem with the epub TOC file. |
10-19-2017, 06:18 AM | #28 |
Guru
Posts: 677
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Feature requests:
Filenames with spaces cause epubcheck to complain, and they are potentially troublesome. So an option to change all filename spaces to underscores? Quite tedious to do by hand with a few dozen files. "Mend XHTML Source Code" -- can this be made to convert Windows-1252/ANSI html files to UTF-8? HTML with that encoding that displays perfectly in a browser comes though with garbage characters if imported to Sigil normally, even if it's correctly described in the header. How about a warning if undefined classes are applied in the HTML? Often from typos or missing definitions. Also regarding these automated fixes: -- Trims the epub stylesheet(s) - removes any unneeded or redundant class properties from the css I like to snoop through interesting new stylesheets, and I can then use the Sigil tool to strip them if I want to. -- Removes all html tags that are empty or that contain just spaces These are often in a file because a linespace was intended. So after spotting these I often use them to modify the html, e.g. convert the following tag to one with "margin-top: 2em", for example. So my preference is these be reported, but fixing them be made optional. Last edited by AlanHK; 10-19-2017 at 06:31 AM. |
10-19-2017, 08:09 AM | #29 | ||||
Witchman
Posts: 628
Karma: 788808
Join Date: May 2013
Location: Philippines
Device: Android S5
|
Quote:
Quote:
Quote:
my-style { font-size: 100%; line-height: 1.2em; } The "font-size:100%" and the "line-height: 1.2em" are unnecessary because you should always go with the vendor defaults for the latter properties for standard epubs(and for Kindle mobi). This may or may not result in an empty style declaration. But if you don't remove these properties from your epub then this might also cause problems on some vendor conversions. Quote:
|
||||
10-19-2017, 11:47 AM | #30 | |||||
Guru
Posts: 677
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Quote:
Quote:
As it is, I do a bunch of S&R and convert to character entities so it all ends up as plain ASCII. Quote:
Quote:
Quote:
Again, these are not files I created, but ones I'm importing or trying to fix. Some books have a blank para between every text para. These have no significance and I will just delete. Others though have them before a section break and I will use them to insert a proper code. e.g. Search: <p></p> <p> Replace: <p class="topspace"> Or maybe <p></p><p></p> <p> or whatever. They should not be in the final epub; but if these are just filtered out I lose information. Blank paragraphs sometimes indicate a vertical space is required; sometimes they are useless side effects. So I would never want to just delete them before being sure they are bathwater and not baby. I've been in publishing for over 20 years; I gave up long ago trying to get authors to follow any formatting rules. 90% of them have no clue what a style is and do not want to know. So the files I get are never to spec and require inspection to see if the code reflects the intention. Last edited by AlanHK; 10-20-2017 at 01:50 AM. |
|||||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[FileType Plugin] YVES Bible Plugin | ClashTheBunny | Plugins | 27 | 01-16-2023 02:25 AM |
Problem with my ScrambleEbook plugin and the Plugin Updater tool | jackie_w | Development | 14 | 01-19-2017 11:49 PM |
Plugin not customizable: Plugin: HTML Output does not need customization | flyingfoxlee | Conversion | 2 | 02-24-2012 03:24 AM |
[GUI Plugin] Plugin Updater **Deprecated** | kiwidude | Plugins | 159 | 06-19-2011 01:27 PM |
New Plugin Type Idea: Library Plugin | cgranade | Plugins | 3 | 09-15-2010 01:11 PM |