Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 07-14-2015, 12:24 PM   #1
steven522
binomial: homo legentem
steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.
 
steven522's Avatar
 
Posts: 1,061
Karma: 25222222
Join Date: Feb 2010
Location: Alabama, USA
Device: iriver Story HD; Archos 80 G9
Sigil 0.8.6 and CSS cleanup tool bug

I have a standard CSS file that I load with my html files into Sigil when creating a new ePub. Before saving my final file I will clean up by using the tools option to delete unused stylesheet classes.

Here is something I noticed:

When manually loading the CSS file (Styles - Add existing file) and manually linking the file to the html (link stylesheets) the delete unused works correctly. Only the unused classes are removed from the loaded CSS file.

However, when the CSS is referenced in the html (<link href> in the <head>) and Sigil loads the CSS automatically when you open the html with Sigil, the delete unused does not work correctly. At this point it tries to clear out almost all of the classes. The only ones I have that remain are the headers (h1, h2, etc.)
steven522 is offline   Reply With Quote
Old 07-14-2015, 01:30 PM   #2
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,752
Karma: 197700000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
I'm not near a computer right now to test, but I want to be sure I understand what you're saying.

1) add/load existing html file
2) pre-existing css is automatically pulled in/created with #1
3) immediately run "delete unused css classes"

Are those the steps that will recreate the problem?

If so, does saving the epub first (before deleting unused css classes) eliminate the problem? Or saving and reopening first? Just troubleshooting, here, I'm not suggesting those as solutions to your problem.
DiapDealer is offline   Reply With Quote
Advert
Old 07-15-2015, 11:23 AM   #3
steven522
binomial: homo legentem
steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.
 
steven522's Avatar
 
Posts: 1,061
Karma: 25222222
Join Date: Feb 2010
Location: Alabama, USA
Device: iriver Story HD; Archos 80 G9
Sorry, just now checked back.

I have a style sheet file "styles.css" that is pretty much a library of all formatting I might use.

I have it linked inside the html so that opening it within a browser has the formatting for quick visual-checks:
<head><link href="styles.css" rel="stylesheet" type="text/css"/></head>

When opening the book.html with Sigil directly, it loads the linked CSS and has it linked to the main html file. All formatting appears correct.

When you run the clean on it then all formatting with a "." is wiped and only the main "h1", "h2", "p", "hr", etc remain. All "p.center", "p.left", etc., has been removed.

Saving the loaded file as an epub and then closing/re-opening Sigil does not seem to stop the clean up from trying to clear all styles. I opened the html with sigil, saved as an epub, closed sigil, reopened the epub with sigil, and then cleaned css and all styles were still cleared.
steven522 is offline   Reply With Quote
Old 07-15-2015, 11:54 AM   #4
Toxaris
Wizard
Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.Toxaris ought to be getting tired of karma fortunes by now.
 
Toxaris's Avatar
 
Posts: 4,520
Karma: 121692313
Join Date: Oct 2009
Location: Heemskerk, NL
Device: PRS-T1, Kobo Touch, Kobo Aura
Perhaps a strange question, but you actually do use the p.center, p.left, etc in the book.html?
Toxaris is offline   Reply With Quote
Old 07-15-2015, 12:17 PM   #5
steven522
binomial: homo legentem
steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.
 
steven522's Avatar
 
Posts: 1,061
Karma: 25222222
Join Date: Feb 2010
Location: Alabama, USA
Device: iriver Story HD; Archos 80 G9
Quote:
Originally Posted by Toxaris View Post
Perhaps a strange question, but you actually do use the p.center, p.left, etc in the book.html?
Yes, CSS formatting actually used in the html file gets cleaned out along with the other unused formats.


Again, it seems like an auto-imported and linked CSS stylesheet is not being handled the same as one that you load yourself and then manually link to your html file.

This seems strange, but I am not familiar with the source code so I'm not sure what Sigil is doing behind the scenes to make an auto- and manual-linked CSS file different.

Also, you would think the act of saving the epub and then re-opening it clean would correct the problem.
steven522 is offline   Reply With Quote
Advert
Old 07-15-2015, 12:23 PM   #6
steven522
binomial: homo legentem
steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.
 
steven522's Avatar
 
Posts: 1,061
Karma: 25222222
Join Date: Feb 2010
Location: Alabama, USA
Device: iriver Story HD; Archos 80 G9
I thought I would try creating a small html and css to test and post, but it appears that a simple 20 line html linked to a css file works correctly.

If I have time I will try to see where the "breaking point" lies.
steven522 is offline   Reply With Quote
Old 07-15-2015, 12:55 PM   #7
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,752
Karma: 197700000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by steven522 View Post
Also, you would think the act of saving the epub and then re-opening it clean would correct the problem.
That's the part that stumps me. Once saved and reopened, Sigil can't possibly know whether the css was originally pulled in automatically (already linked), or manually created and linked. That kind of historical detail isn't maintained or stored anywhere.

Could you post the css file (the whole file) as an attachment for testing?.
DiapDealer is offline   Reply With Quote
Old 07-15-2015, 12:58 PM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,203
Karma: 57978778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Is this happening with a simple:
Code:
<p class="center">
or the more complex case
Code:
<p class="chapter center">
IIRC, I thought I might have seen improper clearing in these cases
theducks is offline   Reply With Quote
Old 07-15-2015, 01:10 PM   #9
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,752
Karma: 197700000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by theducks View Post
Is this happening with a simple:
Code:
<p class="center">
or the more complex case
Code:
<p class="chapter center">
IIRC, I thought I might have seen improper clearing in these cases
Oh yeah, there's definitely some situations that the cleanup tool can't handle.

Pretty easy to test if that's what's going on this case: Just remove the link to the css file from the html (before opening/importing), then open/add the html with sigil ... manually add the css file (the exact same one that was originally linked) using "Add File" ... link it to the html file and run the cleanup tool. If it still screws up, it's all down to the css file (or how the classes are defined in the html) itself. If it doesn't, then I'm confused as hell.
DiapDealer is offline   Reply With Quote
Old 07-15-2015, 01:35 PM   #10
steven522
binomial: homo legentem
steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.
 
steven522's Avatar
 
Posts: 1,061
Karma: 25222222
Join Date: Feb 2010
Location: Alabama, USA
Device: iriver Story HD; Archos 80 G9
Quote:
Originally Posted by DiapDealer View Post
Pretty easy to test if that's what's going on this case: Just remove the link to the css file from the html (before opening/importing), then open/add the html with sigil ... manually add the css file (the exact same one that was originally linked) using "Add File" ... link it to the html file and run the cleanup tool. If it still screws up, it's all down to the css file (or how the classes are defined in the html) itself. If it doesn't, then I'm confused as hell.
See original post. It works when manually adding the CSS file.

I tried opening the html with Sigil to automatically link the CSS and then under "link stylesheets" I unchecked the "include" to un-link the CSS from the html. Without closing, saving, or anything else I just turned around and re-linked the CSS and ran the check to remove unused classes and it works correctly.

The work-around would be to just uncheck/re-check the linked CSS.

Edit: Unlink, click [OK], re-link, click [OK].

Last edited by steven522; 07-15-2015 at 01:38 PM. Reason: Clarification
steven522 is offline   Reply With Quote
Old 07-15-2015, 01:45 PM   #11
steven522
binomial: homo legentem
steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.
 
steven522's Avatar
 
Posts: 1,061
Karma: 25222222
Join Date: Feb 2010
Location: Alabama, USA
Device: iriver Story HD; Archos 80 G9
Quote:
Originally Posted by DiapDealer View Post
Could you post the css file (the whole file) as an attachment for testing?.
I think I may have found the issue:

The original name for the file was "!Styles.css" so the file was always at the top of my directory listing and easier to find.

I renamed a copy of the file to "test.css" and linked the new name in the header of the html to re-test.

The new name works correctly.


So it looks like the loading of the css into Sigil automatically with the "!" as part of the name causes an issue. Inside the html in Sigil the link shows as:
<link href="../Styles/%21test.css" rel="stylesheet" type="text/css"/>

When you unlink/relink and/or load manually the name shows as:
<link href="../Styles/!test.css" rel="stylesheet" type="text/css"/>

This is causing the issue in the cleanup.

EDIT:
I guess I could rename to "AAAStyles.css"...
steven522 is offline   Reply With Quote
Old 07-15-2015, 02:29 PM   #12
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,752
Karma: 197700000
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Ah ... thanks for figuring it out. While I would never recommend using anything other than alpha numeric characters for the internal filenames of epubs, Sigil should still, at least, handle them consistently when it encounters them. We'll need to figure out why one way url escapes the exclamation mark in the file name and the other way doesn't.

Thanks again!
DiapDealer is offline   Reply With Quote
Old 07-15-2015, 03:01 PM   #13
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,203
Karma: 57978778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
How many Style sheets do you use?

A single sheet should always appear at the top of the "Styles" breakout
theducks is offline   Reply With Quote
Old 07-15-2015, 03:11 PM   #14
steven522
binomial: homo legentem
steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.steven522 ought to be getting tired of karma fortunes by now.
 
steven522's Avatar
 
Posts: 1,061
Karma: 25222222
Join Date: Feb 2010
Location: Alabama, USA
Device: iriver Story HD; Archos 80 G9
Quote:
Originally Posted by theducks View Post
A single sheet should always appear at the top of the "Styles" breakout
At the top of the "folder".

I have a work folder on my drive that holds various html, jpg, png and other misc files for different things I am working on. The "!Styles" name will have this at the top of the list so I can locate it quickly when I need to add or edit the file.

At most I have loaded two stylesheets into any epub.
steven522 is offline   Reply With Quote
Old 07-15-2015, 04:20 PM   #15
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,203
Karma: 57978778
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by steven522 View Post
At the top of the "folder".

I have a work folder on my drive that holds various html, jpg, png and other misc files for different things I am working on. The "!Styles" name will have this at the top of the list so I can locate it quickly when I need to add or edit the file.

At most I have loaded two stylesheets into any epub.
so will leading digits.
00 - 99

just be aware that YOU CAN RUN ACROSS naming rules that require a Alpha for the first char ( forget which prog had that )
theducks is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Another possible bug - Image viewer without tool bars in covers arspr Kobo Reader 6 12-05-2013 08:21 PM
Sigil 0.3.4 / Problème CSS entre Sigil et iPad Grivels Software 10 07-03-2011 09:06 AM
Tool to centralise css styles? snarkophilus ePub 7 07-01-2011 04:08 AM
Embedded font bug or CSS bug in ADE JSWolf ePub 10 06-11-2011 02:34 PM
Small html/css bug twaits Calibre 5 01-12-2010 10:26 AM


All times are GMT -4. The time now is 04:07 AM.


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