Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 10-01-2010, 03:18 PM   #1
crutledge
eBook FANatic
crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.crutledge ought to be getting tired of karma fortunes by now.
 
crutledge's Avatar
 
Posts: 18,301
Karma: 16071131
Join Date: Apr 2008
Location: Alabama, USA
Device: HP ipac RX5915 Wife's Kindle
Sigil Style Sheets

This may have been covered before but I haven't found it. The following is an excerpt from a sigil header.

Code:
<head>
  <meta content="HTML Tidy for Windows (vers 14 February 2006), see www.w3.org" name="generator" />
...
...

  <link rel="stylesheet" type="text/css" href="../Styles/main.css" />
  <meta content="MSHTML 8.00.7600.16625" name="GENERATOR" />
  
<style type="text/css">
i.sgc-2 {font-weight: bold}
  p.sgc-1 {text-align: center}
</style>
</head>
The style sheet seems to bear little relation to the content of the main.css. Where does this style sheet come from?
crutledge is offline   Reply With Quote
Old 10-01-2010, 04:27 PM   #2
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: 29,689
Karma: 54369090
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 crutledge View Post
This may have been covered before but I haven't found it. The following is an excerpt from a sigil header.

Code:
<head>
  <meta content="HTML Tidy for Windows (vers 14 February 2006), see www.w3.org" name="generator" />
...
...

  <link rel="stylesheet" type="text/css" href="../Styles/main.css" />
  <meta content="MSHTML 8.00.7600.16625" name="GENERATOR" />
  
<style type="text/css">
i.sgc-2 {font-weight: bold}
  p.sgc-1 {text-align: center}
</style>
</head>
The style sheet seems to bear little relation to the content of the main.css. Where does this style sheet come from?
Anytime yo use a Sigil "styling button": B,UL,It, Center...
Sigil will construct (could be a compound of styles) a style.
Not that the same style may not be present in another page (which is why a simple copY of a working, styled block may not work as expected... The stylesheet was not there.

Moral: If you use Sigil to create a Style, copy the code part and add it to your Stylesheet with your naming (not sure what Sigil would do if SGC# appeared in the CSS), then replace the SGC# usage with you name in the document (I believe Sigil will tidy up unused selectors).
theducks is offline   Reply With Quote
Advert
Old 10-04-2010, 07:57 PM   #3
Ahmad Samir
Zealot
Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!Ahmad Samir , Klaatu Barada Niktu!
 
Posts: 114
Karma: 5246
Join Date: Jul 2010
Device: none
I've seen Sigil add those .sgc-# styles when I open e.g. an HTML file. I think Sigil (via libtidy?) examines the file and adds those css classes to the relevant paragraphs and at the top of the html file (like the ones you posted).

Usually Sigil gets it right with those styles, i.e. i.sgc-2 from your example is actually bold in the original file. And sometimes it adds a .sgc-# for just one line in the whole file.. So it looks like this falls under the uncontrollable-things-tidy-does-to-an-epub-sometimes, (IIRC Valloric said he'll offer an option to turn that behaviour off).
Ahmad Samir is offline   Reply With Quote
Old 10-06-2010, 08:48 AM   #4
DTM
Intentionally Left Blank
DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.DTM ought to be getting tired of karma fortunes by now.
 
DTM's Avatar
 
Posts: 172
Karma: 300106
Join Date: Feb 2006
Location: Royal Oak, MI, USA
Device: Nook STR
Quote:
Originally Posted by Ahmad Samir View Post
I think Sigil (via libtidy?) examines the file and adds those css classes to the relevant paragraphs and at the top of the html file (like the ones you posted).
I'm sure that's it. I was recently working on a book in which I happened to mark an entire paragraph as italic (I do just about everything in code view):

<p><i>Lorem ipsum, blah, blah</i></p>

Switched to book view and back to code, and it had eliminated the <i></i> tags, created a new style at the top for an italic normal paragraph, and applied it there.

I agree with theducks; when you see this, create a new style in your CSS, apply that and get rid of the one Sigil/Tidy created.
DTM is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mobi TOC style vs ePub style? phearlez Kindle Formats 3 04-11-2010 06:35 AM
Sigil et la feuille de style roger64 Software 3 03-30-2010 09:23 PM
music sheets on cybook? triwy Bookeen 4 04-24-2009 09:55 AM
Reference Lie, Hakon & Bos, Bert: Cascading Style Sheets, level 1. IMP. v1.0 4 Sept 2007 DaleDe IMP Books (offline) 0 09-04-2007 02:12 PM


All times are GMT -4. The time now is 05:07 PM.


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