View Single Post
Old 09-21-2021, 12:29 PM   #92
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by RbnJrg View Post
By the way, by pure chance anyone knows about a tool to consolite stylesheets? Because I noted that there are many styles, that are equals, but they are in different sheets with different names.
Calibre EPUB->EPUB conversion.

It's what I do when I export individual chapters as InDesign EPUBs.

So let's say there's 26 different chapters, 26 different EPUBs, all have almost-the-same-but-slightly-different CSS, all with conflicting class names.

I merge all EPUBs together (using Calibre's EPUBMerge plugin), then a Calibre EPUB->EPUB.

This will convert each unique CSS into 1 class.

So these matching classes:

Spoiler:
CSS #1:

Code:
span.CharOverride-3 {
	font-family:"Adobe Garamond Pro Regular", sans-serif;
	font-size:1.181em;
	font-style:normal;
	font-variant:small-caps;
	font-weight:normal;
	text-transform:none;
}
CSS #2:

Code:
span.CharOverride-4 {
	font-family:"Adobe Garamond Pro Regular", sans-serif;
	font-size:1.181em;
	font-style:normal;
	font-variant:small-caps;
	font-weight:normal;
	text-transform:none;
}


will convert into a single "charoverride3".

Side Note: If you've used human-readable names for CSS, you'll probably get a big mess in your HTML, since Calibre will convert everything to the very first matching name:

Code:
<p class="first">This is a first line.</p>
<p class="noindent">This is a typical no indent paragraph.</p>
Code:
p.first {
	text-indent: 0;
}

p.noindent {
	text-indent: 0;
}
after Calibre EPUB->EPUB conversion would turn into:

Code:
<p class="first">This is a first line.</p>
<p class="first">This is a typical no indent paragraph.</p>
But if you already have a giant spaghetti mess of auto-generated classes, it'll make it infinitely easier.

Last edited by Tex2002ans; 09-21-2021 at 01:52 PM.
Tex2002ans is offline   Reply With Quote