Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Recipes

Notices

Reply
 
Thread Tools Search this Thread
Old 07-15-2017, 06:52 PM   #1
AlanRoberts
Member
AlanRoberts began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Jan 2014
Device: Android tablet + FBReader
Beginner extra_css question

Newbie trying to build my first recipe. Content from CSM Daily (using their "print" URL), has a construct:
Code:
<h2 id="summary" class="eza-summary">
<p>A 25-day march and rally days before Turkish President Erdoğan marks the coup anniversary were an emotional show of strength for his foes. But a charismatic leader is needed to unify their ranks.</p></h2>
The paragraph inside the H2 seems strange to me, but the problem I'd like to solve is rendering this this "leader" text in italic, so I tried adding extra_css to my recipe:
Code:
    extra_css = '.eza-summary p { font-style: italic; }'
without any result.

When I run a test ebook-convert and look at the verbose logging, it reports: 'extra_css': None. Looking at the generated output, I don't see any sign of my extra CSS in stylesheets or inline in the article's HTML. The structure of this bit of content has been rewritten as:
Code:
<h2 id="summary" class="eza-summary">
</h2><p class="calibre7">A 25-day march and rally days before Turkish President ErdoÄŸan marks the coup anniversary were an emotional show of strength for his foes. But a charismatic leader is needed to unify their ranks.</p>
So Calibre seems to have restructured to put the leader paragraph outside of the H2, and decided to class it with the internally-generated calibre7 class.

Am I doing something obviously wrong with my extra_css statement within the recipe, or is this something more complex related to the paragraph-within-H2?

Any suggestions will be appreciated.
Alan
AlanRoberts is offline   Reply With Quote
Old 07-16-2017, 01:28 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,252
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
<p> is not allowed inside <h2>. There it will be automatically moved after it. The selctor you want is

.eza-summary + p { ... }
kovidgoyal is offline   Reply With Quote
Advert
Old 07-16-2017, 08:53 AM   #3
AlanRoberts
Member
AlanRoberts began at the beginning.
 
Posts: 19
Karma: 10
Join Date: Jan 2014
Device: Android tablet + FBReader
Thanks Kovid, that CSS is getting the behavior I was looking for.
AlanRoberts is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Stupid beginner question blackxacto Sigil 43 04-21-2014 07:20 PM
Beginner's question on conversion jbacinti Conversion 7 01-02-2014 02:17 PM
beginner question Pogzy Development 1 02-13-2013 10:34 PM
beginner question Pogzy Plugins 1 02-05-2013 04:54 PM
PRS-T1 Beginner Question re: compatibility jeolive Sony Reader 15 01-18-2013 05:02 AM


All times are GMT -4. The time now is 10:02 AM.


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