View Single Post
Old 09-21-2021, 05:08 PM   #95
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 phillipgessert View Post
There’s surely a more elegant way, but I’d just pull em all out via unzip and concatenate them outside of Sigil, go back to Sigil to trash all 206 within it, pull in the new megastylesheet, and finally run a find/replace on all the xhtml files to repair the now-broken stylesheet link/s in the head.
Be very careful, that wouldn't work with conflicting class names:

class="blockquote" in CSS#1

might not be the same as

class="blockquote" in CSS#2.

The Calibre EPUB->EPUB approach would thoroughly go through all HTML+CSS and merge/rename everything for you.

If the two classes are exactly the same, great.

If the two classes are same name, but different CSS, Calibre will merge/create a new class + make sure to properly update the HTML too:

Spoiler:
Before:

Book #1:

Code:
<blockquote>
<p class="blockquote">This is an example.</blockquote>
</blockquote>
Code:
p.blockquote {
	margin-top: 1em;
	margin-bottom: 1em;
	margin-left: 5%;
	margin-right: 5%;
}
Book #2:

Code:
<blockquote>
<p class="blockquote">This is a second example.</blockquote>
</blockquote>
Code:
p.blockquote {
	margin-left: 5%;
}
After:

Book #1:

Code:
<blockquote>
<p class="blockquote">This is an example.</blockquote>
</blockquote>
Book #2:

Code:
<blockquote>
<p class="blockquote2">This is a second example.</blockquote>
</blockquote>
Code:
p.blockquote {
	margin-top: 1em;
	margin-bottom: 1em;
	margin-left: 5%;
	margin-right: 5%;
}

p.blockquote2 {
	margin-left: 5%;
}


Side Note: Similar logic applies to "Removing Unused Styles". You have to pay very close attention to what's happening with edge cases.

In 2021: "Indesign-epub-kindle formatting problem: footnotes export with massive indent", I also explained a more "surgical" approach + discussed a few things to look out for (like accidentally stripping important/busted font information).
Tex2002ans is offline   Reply With Quote