08-17-2015, 02:42 PM | #16 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
I would go through the CSS and delete each useless line there. Anything that is only adding a font, or repetitively setting the line-height, margins, default font-size, etc. can probably be deleted.
Once you have cleaned up the CSS, calibre's CSS cleanup tool (but not Sigil's, IIRC) will delete both unused CSS style rules, and do-nothing CSS styles in the text. Use this, and you will end up with just a bunch of: Code:
<p><span>lorem ipsum</span> <span>lorem ipsum</span> <span>lorem ipsum</span> <span>lorem ipsum</span></p> The final stage will be to use Diapealer's "Diaps Editing Toolbag" plugin for calibre, which has a tool to delete empty span tags (ones which have no style). Last edited by eschwartz; 08-17-2015 at 02:45 PM. |
08-17-2015, 04:45 PM | #17 | |
Bookworm
Posts: 975
Karma: 768585
Join Date: Aug 2010
Location: Netherlands
Device: Sony prs-650, Kobo Glo HD (2x), Kobo Glo
|
Quote:
So a class or paragraph have not the same value in the next html, so it isn't that you can delete all of a certain class in all html files because in the next one it has other values.. |
|
Advert | |
|
08-17-2015, 05:07 PM | #18 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Inline CSS is still CSS.
I am pretty sure calibre is smart enough to find those rules as well. Thus my suggestion remains valid. |
08-17-2015, 05:23 PM | #19 |
Grand Sorcerer
Posts: 6,248
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
|
I don't use sigil but calibre editor, and you can clean something like that easily with diapdealer's plugin, removing all span/class/dict-007 (no regex needed, and it cares of beginning and end of span tag.
|
08-17-2015, 05:47 PM | #20 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Terisa -- I know Diap's plugin can handle removing styled spans too, but I would personally prefer double-checking all styles before bulldozing over them.
|
Advert | |
|
08-17-2015, 06:02 PM | #21 |
Grand Sorcerer
Posts: 12,203
Karma: 73448616
Join Date: Nov 2007
Location: Toronto
Device: Nexus 7, Clara, Touch, Tolino EPOS
|
I'd almost suggest returning the original epub to whence it came and buying a better version. It sounds like it's been through a lot PDF to epub conversion.
|
08-17-2015, 06:17 PM | #22 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Who says there is a better version somewhere else?
|
08-17-2015, 07:06 PM | #23 | |
Resident Curmudgeon
Posts: 74,287
Karma: 129333566
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
Quote:
|
|
08-18-2015, 02:50 AM | #24 |
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
The add-in can actually import an ePUB directly. No need to convert it first.
|
08-18-2015, 05:29 AM | #25 | |
Bookworm
Posts: 975
Karma: 768585
Join Date: Aug 2010
Location: Netherlands
Device: Sony prs-650, Kobo Glo HD (2x), Kobo Glo
|
Quote:
/* Styles for document saved to a stream */ /* Generated by Aspose.Words for Java 11.11.0.0 */ So I know it is made by that Aspose. *All other, I will try the suggestions for sure but until now the new version of Sigil (0.8.7.) does do a lot. It is almost clean,but now left with a lot of blanc lines. A lot of the <p class="dlct-000"> (from 000 till 972) contains margins like margin:12pt 0pt 3pt 5.5pt; but they are renumbered in every html so removing the values of margin:12pt 0pt 3pt 5.5pt; does help but also destroy whitespaces where they do belong. So I am now trying to find html for html if there is one "dclt" that stands for a true paragraph so I can at least replace them for a </br> to maintain the real paragraphs,before removing them all. If I remove all code for .css, rather in the html of as separate file, there is no way I can find and keep some of the original page lay-out. For now the first part of the suggestion made by rubeus to use the search and replace with <span class="dlct-\d\d\d"> worked the most, then the auto repair of Sigil did the rest. Only there are now more then 100 different values for <p class="dlct-000"> As far as I know there is no "warranty" for an epub,it is coming from a small publisher, I can't ask a webshop "i want to buy this book,but can I see the code first" so if I buy it somewhere else it is no guarantee that I don't get exactly the same one. For sure I want to try the plugin suggestions and cleanup but the internal editor works more different then the Sigil and I am used to that. I do gonna use it but I try with Sigil first rather then to learn to use another editor. Once I cleaned with Sigil I gonna import the "damaged" books into Calibre and start again there to see if it produces beter and work faster, so I do gonna use all the given options,because then I can learn it for future use. *But I want to ask you kindly, for someone with my type of dislection, using 2 editors next to each other or learn to work with a new one is not so easy, that is why I use only one filemanager (Total commander) one mail program, one usenet program because if I am not i am overwhelmed by the new look and my brain will reset and I have only one year english lessons so sometimes I need a bit more then a oneliner,have some patient with me. At the end, I could do 2 things,delete the books and say sorry to the girl,or give it to someone that will do it for me,but then..I will not learn. Last edited by Nick_1964; 08-18-2015 at 05:35 AM. |
|
08-18-2015, 05:34 AM | #26 | |
Gnu
Posts: 1,222
Karma: 15625359
Join Date: Jul 2009
Location: UK
Device: BeBook,JetBook Lite,PRS-300-350-505-650,+ran out of space to type
|
Quote:
Do an epub to epub conversion in calibre on the original epub, then clean up in sigil if you want (After the calibre conversion the book can be read at a reasonable speed in an ereader IIRC). |
|
08-18-2015, 09:27 AM | #27 |
Banned
Posts: 272
Karma: 1224588
Join Date: Sep 2014
Device: Sony PRS 650
|
The latest Sigil Version 087 still has the tidy option available.
|
08-18-2015, 09:40 AM | #28 | |
Bookworm
Posts: 975
Karma: 768585
Join Date: Aug 2010
Location: Netherlands
Device: Sony prs-650, Kobo Glo HD (2x), Kobo Glo
|
Quote:
The old way to use it, control-d, now results in a delete.. Last edited by Nick_1964; 08-18-2015 at 09:42 AM. |
|
08-18-2015, 10:16 AM | #29 | ||
Wizard
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Quote:
Quote:
Now, for Tidy in Sigil. Although I do not recommend it and advise to use extreme caution, it is still there, but not as 'standalone'. Edit --> Preferences --> Clean Source --> HTML Tidy. Again, use it at your own peril... |
||
08-18-2015, 12:59 PM | #30 | ||
Bookworm
Posts: 975
Karma: 768585
Join Date: Aug 2010
Location: Netherlands
Device: Sony prs-650, Kobo Glo HD (2x), Kobo Glo
|
Quote:
Quote:
See Attachments. No wonder I could not find it... (if it is the right option..) Thank you for pointing it out,or we would end in oneliners again |
||
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Create / Optimize Cbz files for Kobo (software inside) | satsuki_yatoshi | Kobo Reader | 20 | 06-22-2022 04:23 PM |
conversion problem? - cleaning up epub | potestus | Calibre | 1 | 05-31-2011 01:28 PM |
Stop Automatic Code cleaning in Sigil | ericp20 | Sigil | 11 | 05-27-2011 08:52 AM |
questions on epub and lrf and cleaning up book | Janette55 | Sony Reader | 1 | 03-11-2011 09:25 AM |
Unutterably Silly A pug cleaning the inside of your monitor! | Dusty Bottoms | Lounge | 4 | 05-03-2010 10:06 AM |