![]() |
Help! Newbie having problems converting HTML/CSS files
I'm pretty new to ebooks, HTML and the PRS-505 so I wonder if someone could help or point me in the right direction. I am very much in the explore-and-find-out-what-works stage at the moment.
To tidy up MSWord's generated HTML, I wanted to extract all the style info into a re-usable CSS file. The HTML plus linked CSS loads fine in my browser. When I upload to calibre the HTML and CSS file get zipped into a single file in the normal way. However, when I convert to LRF or EPUB the styling in the CSS doesn't seem to be used. :blink: Could one of you experts please tell me whether this is what you would expect or make a suggestion what I might be doing wrong? I can force the CSS to be used by using the ConvertEbooks/Look&Feel/ExtraCSS option to point at a copy of the CSS file on my C: disk but I had hoped to use this option as a style 'tweaker' rather than for the whole lot. FYI I have tried unzipping calibre's zip file to make sure the HTML and CSS still function as a pair after the upload. They seem fine. I've also tried copying the CSS content back into the HTML file and re-uploading that as a single file. That works fine as well. I also know I could forget about HTML/CSS and just upload the MSWord file as RTF. I don't do this because of the formatting which seems to be lost using RTF (centre- & right-alignment, line breaks etc), and anyway where would be the fun in that! Any enlightenment would be appreciated. Who knows, one of these days I might actually get round to reading a book on my shiny new SonyReader!:) |
The first place to look is the conversion log in calibre. Click the rotating hourglass icon and the click job details. If the CSS file is not being picker up for some reason, there should be a warning about it in the log.
|
Further testing ...
2 Attachment(s)
Thanks for your reply Kovid.
I have done as you suggest. This is the job detail output from an LRF conversion:- Convert book 1 of 1 (Verse_css) Processing archive... InputFormatPlugin: HTML Input running on c:\docume~1\jackies\locals~1\temp\calibre_0.6.12_u s924a_plumber\content.opf Parsing all content... Manifest item 'toc.ncx' not found Parsing Verse_css.htm ... Parsing jsebook.css ... Generating default TOC from spine... Merging user specified metadata... Detecting structure... Detected chapter: Centred verse Detected chapter: Right-aligned verse Auto generated TOC with 2 entries. Inserting metadata into book... Flattening CSS and remapping font sizes... Source base font size is 12.00000pt Cleaning up manifest... Trimming unused files from manifest... Parsing stylesheet.css ... Creating LRF Output... Unable to find serif family None Unable to find sans family None Unable to find mono family None Processing 'c:\\docume~1\\jackies\\locals~1\\temp\\calibre_0. 6.12_bmm3z6_lrf_output\\jacket.xhtml' Parsing HTML... Written preprocessed HTML to c:\docume~1\jackies\locals~1\temp\html2lrf-verbose.html Converting to BBeB... Processing 'c:\\docume~1\\jackies\\locals~1\\temp\\calibre_0. 6.12_bmm3z6_lrf_output\\Verse_css.htm' Parsing HTML... Written preprocessed HTML to c:\docume~1\jackies\locals~1\temp\html2lrf-verbose.html Converting to BBeB... Could not read stylesheet: jsebook.css Rationalizing font sizes... LRF output written to c:\docume~1\jackies\locals~1\temp\calibre_0.6.12_m gf9_l.lrf I can see that it did not like the CSS file but I'm not sure why. I also did an EPUB conversion with all the same conversion parameters. This was the job output:- Convert book 1 of 1 (Verse_css) Processing archive... InputFormatPlugin: HTML Input running on c:\docume~1\jackies\locals~1\temp\calibre_0.6.12_e q6hja_plumber\content.opf Parsing all content... Manifest item 'toc.ncx' not found Parsing Verse_css.htm ... Parsing jsebook.css ... Generating default TOC from spine... Merging user specified metadata... Detecting structure... Detected chapter: Centred verse Detected chapter: Right-aligned verse Auto generated TOC with 2 entries. Inserting metadata into book... Flattening CSS and remapping font sizes... Source base font size is 12.00000pt Cleaning up manifest... Trimming unused files from manifest... Parsing stylesheet.css ... Creating EPUB Output... Splitting on page-break Splitting on page-break Looking for large trees in Verse_css.htm... No large trees found Split into 2 parts Looking for large trees in jacket.xhtml... No large trees found Removing anchor from TOC href: Verse_css_split_0.htm#calibre_toc_2 Removing anchor from TOC href: Verse_css_split_1.htm#calibre_toc_3 EPUB output written to c:\docume~1\jackies\locals~1\temp\calibre_0.6.12_j s1crb.epub I'm not sure what this tells me. Viewing both LRF and EPUB via the ebook/lrf-viewers shows the formatting has not been used. Viewing the ZIP via the ebook-viewer shows the formatting as OK. To an expert eye, there may be something very obviously wrong with the CSS or HTML file. Have I missed some kind of header(s)? I'm going to feel such an idiot when I find out what it is! I've attached the small HTML and CSS files I used. If you could spare any time to have a look I'd be very grateful. Regards, Jackie |
Attach the calibre created ZIP file.
|
Adding zip file as requested
1 Attachment(s)
That was quick.
|
The first thing to change is in your header where you have
rel="Stylesheet" change that to rel="stylesheet" (In the next release of calibre I'll have it ignore case for this). |
Well that seems to have done the trick. Thank you so much, Kovid.
I just knew I was going to feel like an idiot!! |
| All times are GMT -4. The time now is 06:09 PM. |
Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.