![]() |
#1 |
Member
![]() Posts: 14
Karma: 10
Join Date: Aug 2011
Device: Kindle, Kobo, Android Tablet
|
How NOT to use a stylesheet?
My apologizes if this has already been asked and answered. (I have done some searches but...)
I really like using Sigil for cleaning up badly converted documents. Most need very minimal formatting, leaving display decisions to the reading device, so I like to clean up using the code view. One thing that urks me is how Sigil often replaces the simple html with stylesheet references or adds code where none is needed. Is there a way to stop Sigil from doing this? Thanks. |
![]() |
![]() |
![]() |
#2 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 532
Karma: 3293888
Join Date: Oct 2011
Location: Virginia
Device: Nook Simple Touch
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Member
![]() Posts: 14
Karma: 10
Join Date: Aug 2011
Device: Kindle, Kobo, Android Tablet
|
|
![]() |
![]() |
![]() |
#4 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,352
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Turning off HtmlTidy will help in many instances, but you can't completely stop it from ever "helping." I know I don't like it when it sometimes consolidates/stacks/creates CSS classes.
I've never had it do that, myself. I most often see stuff like that in ePubs that were automatically converted from a different format. Last edited by DiapDealer; 03-01-2012 at 10:32 AM. |
![]() |
![]() |
![]() |
#5 |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 532
Karma: 3293888
Join Date: Oct 2011
Location: Virginia
Device: Nook Simple Touch
|
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 128
Karma: 238654
Join Date: Aug 2009
Device: Kobo Mini (4GB), Nook Classic wi-fi, iPod Touch (Bluefire Reader)
|
I think a lot of these issues are dependent upon the source HTML. The cleaner the HTML being imported to Sigil is, the less problems like these you will have. Unfortunately if the HTML has had any editing done in Microsoft Word, you will have a lot of wonkiness in the resulting HTML. Saving the HTML as "Web Page, Filtered" in Word can help to alleviate some of these problems.
|
![]() |
![]() |
![]() |
#7 | |
Member
![]() Posts: 14
Karma: 10
Join Date: Aug 2011
Device: Kindle, Kobo, Android Tablet
|
Quote:
Most of the <span></span> were introduced (I believe) by the original conversion process, but I also had this happening in files that I had previously "cleaned" up. Turning off HtmlTidy seems to be preventing this. *fingers crossed* |
|
![]() |
![]() |
![]() |
#8 |
Bookmaker & Cat Slave
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,503
Karma: 158448243
Join Date: Apr 2010
Location: Phoenix, AZ
Device: K2, iPad, KFire, PPW, Voyage, NookColor. 2 Droid, Oasis, Boox Note2
|
If you exported material from Word, you'll have spans everywhere that have nothing whatsoever to do with Sigil. Word outputs--as nicely as I can say it--gobbledygook--and Sigil attempts to rectify it. If you have something--ANYTHING--in a para that is odd, Sigil will attempt to span it, for lack of any other instruction.
Just cleaning your html in a plain html editor will eliminate a lot of that. If you exported your html from PDF, even with Acrobat, gods help you. You're better off, IME, exporting to XML and working from there. HTH, Hitch |
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
Exactly, that is the reason why I wrote my HTML export macro in Word to get some decent, clean HTML output. It is not perfect, but good enough.
|
![]() |
![]() |
![]() |
#10 |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 121
Karma: 5070
Join Date: Dec 2010
Device: none
|
Never saw an empty span created by Sigil. What i dislike is the transformation <p><i>...</i></p> into <p class="sgc-n">...</p>. Well i have to live with that.
|
![]() |
![]() |
![]() |
#11 |
Member
![]() Posts: 14
Karma: 10
Join Date: Aug 2011
Device: Kindle, Kobo, Android Tablet
|
Keroberos and Hitch, I didn't do the initial conversion - have no idea how it was done - although it appears to have originated from a scanned physical document. There is not much I can do about the initial state of the documents, I just want to be able to "clean" them and have them stay clean - which seems to be happening now, with DiapDealer's suggestion.
huebi, I had the same problem, but it doesn't seem to be happening now that I've turned off HtmlTidy. Rob Lister, I no longer have examples - and I'm not eager to reproduce by turning HtmlTidy back on - but one situation I saw was <p><span>...</span></p> where the ... represents plain text. I would delete, save and then have the <span>...</span> reappear when I reopened the file. Maybe I am overlooking some steps on my part that contributed to my problems, but I'm very satistfied with the solution. |
![]() |
![]() |
![]() |
#12 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 184
Karma: 2572
Join Date: Aug 2010
Device: Kindle
|
|
![]() |
![]() |
![]() |
#13 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
|
yep, an old version is up here somewhere. I'll try to find it and upload the latest version.
It can probably improved upon, but it works for me. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
conversion and stylesheet question | pckopp | Calibre | 8 | 12-26-2010 10:21 PM |
Linking Stylesheet with Text | Ephraim | Sigil | 2 | 12-07-2010 05:38 PM |
Adding Namespace to Stylesheet | ghostyjack | ePub | 0 | 12-07-2010 07:49 AM |
Stylesheet examples? | Skitzman69 | Sigil | 15 | 09-24-2010 08:24 PM |
Where is the stylesheet.css? | roger64 | Sigil | 4 | 03-23-2010 02:12 PM |