![]() |
#1 |
binomial: homo legentem
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.) |
![]() |
![]() |
![]() |
#2 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
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. |
![]() |
![]() |
![]() |
#3 |
binomial: homo legentem
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#4 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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?
|
![]() |
![]() |
![]() |
#5 | |
binomial: homo legentem
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,061
Karma: 25222222
Join Date: Feb 2010
Location: Alabama, USA
Device: iriver Story HD; Archos 80 G9
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#6 |
binomial: homo legentem
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#7 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
Could you post the css file (the whole file) as an attachment for testing?. |
|
![]() |
![]() |
![]() |
#8 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,909
Karma: 60358908
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"> Code:
<p class="chapter center"> |
![]() |
![]() |
![]() |
#9 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#10 | |
binomial: homo legentem
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,061
Karma: 25222222
Join Date: Feb 2010
Location: Alabama, USA
Device: iriver Story HD; Archos 80 G9
|
Quote:
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 |
|
![]() |
![]() |
![]() |
#11 | |
binomial: homo legentem
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,061
Karma: 25222222
Join Date: Feb 2010
Location: Alabama, USA
Device: iriver Story HD; Archos 80 G9
|
Quote:
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"... |
|
![]() |
![]() |
![]() |
#12 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,358
Karma: 203720150
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! |
![]() |
![]() |
![]() |
#13 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,909
Karma: 60358908
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 ![]() |
![]() |
![]() |
![]() |
#14 | |
binomial: homo legentem
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,061
Karma: 25222222
Join Date: Feb 2010
Location: Alabama, USA
Device: iriver Story HD; Archos 80 G9
|
Quote:
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. |
|
![]() |
![]() |
![]() |
#15 | |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,909
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
00 - 99 just be aware that YOU CAN RUN ACROSS naming rules that require a Alpha for the first char ( ![]() ![]() |
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |