View Single Post
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