Quote:
Originally Posted by RbnJrg
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.