Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 01-28-2016, 06:17 AM   #1
Sunfox
Junior Member
Sunfox began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2016
Device: iPad
Bug with stylesheet processing for EPUB...

I code my HTML by hand for use with both Kindlegen and Calibre, and for convenience my default stylesheet is not actually called "stylesheet.css".

In my HTML, I have the following specified as the only stylesheet:

Code:
<link rel="StyleSheet" type="text/css" href="_0-styles.css"/>
However, after converting to EPUB and running a check, despite everything looking perfect I get the following error:

Code:
The linked resource '_0-style.css' does not exist  [various files]
In looking deeper, the file _0-style.css is indeed not included in the file, because Calibre has renamed it to stylesheet.css. And in this renamed file, all of my custom styles from _0-style.css have been correctly included.

The problem is, in the resulting generated HTML, it is specifying both the NEW and the OLD, DELETED stylesheet. For example, I get this in the top of every file:

Code:
<link rel="StyleSheet" type="text/css" href="_0-styles.css"/>
<link href="stylesheet.css" rel="stylesheet" type="text/css"/>
Since Calibre is reading this file correctly and knows it won't be including the original, I don't know why it continues to include this line in all HTML.

I can work around the error either by needlessly including _0-styles.css (simplest), or by manually deleting the code from every HTML file (difficult due to splitting). Or, I suppose, by changing to using "stylesheet.css", but I name things this way to make mass coding/reuse a bit quicker and less disorganized for my workflow.
Sunfox is offline   Reply With Quote
Old 01-28-2016, 06:27 AM   #2
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,970
Karma: 128903378
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Is your CSS in the same directory as the XHTML files?
JSWolf is online now   Reply With Quote
Advert
Old 03-01-2016, 07:41 AM   #3
Sunfox
Junior Member
Sunfox began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2016
Device: iPad
Sorry for totally spacing out on responding to this!

Yes, the CSS file is in the same folder, nothing fancy going on. Calibre is reading and processing the file's contents just fine... it's just failing to NOT write a reference to the now abandoned file in the finished code.
Sunfox is offline   Reply With Quote
Old 03-01-2016, 07:56 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
conversion does not rename stylesheets. It flattens all css and the result of that flattening is put into a new stylesheet.

And to have calibre remove the link to the old stylesheet, give it a correct rel value of "stylesheet" not "StyleSheet"
kovidgoyal is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
epub not properly referencing stylesheet? topquark Conversion 7 04-13-2013 04:46 AM
Bug in web/feeds/__init__ processing feed article date nickredding Recipes 4 03-18-2013 01:48 AM
Bug in Kobo processing of epub files causing hang in "Processing content" BensonBear Kobo Reader 21 12-21-2012 05:47 AM
ePub margins : @page vs stylesheet.css Agama Calibre 1 08-16-2010 04:37 PM
EPub conversion stylesheet.css problem nycaleksey Calibre 1 03-25-2010 11:42 PM


All times are GMT -4. The time now is 02:50 AM.


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