View Single Post
Old 07-24-2023, 09:00 AM   #4
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,363
Karma: 20212733
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
I use the same basic procedure as BeckyEbook. However, I use the ReworkChapterHeads plug-in. That will automatically insert incremental IDs into a header tag.

Then, run a regex to incorporate the image into the header:

Code:
With:
<h3>1 (2, 3, 4, etc)</h3>
<p class="textbreak"><img src="../images/00003.jpeg" alt="" /></p>


Find: <h3>(\d+)</h3>\s*<p class="textbreak"><img src="../images/00003.jpeg" alt="" /></p>

Replace: <h3 title="\1"><img src="../images/00003.jpeg" alt="" /></h3>
I’d even rename the image file to something I could understand just by reading it eg. img_ChHd.jpg or something.

If your reading device is at all modern, and supports CSS, then you could even trim that down with:

Code:
Replace: <h3 title="\1"></h3>
and add css to incorporate the image as a background of the header tag; or even insert the image before the header tag. That is certainly not necessary, but it cleans up your code a little bit.

For example:
Code:
h3 {
display: block; 
background-image: url("../Images/img_ChHd.jpg"); 
background-size:2em 1em; 
width:2em; 
height:1em; 
margin:1em auto; 
content:""}

* set sizes as needed for the image
EDIT: added css example code

Last edited by Turtle91; 07-24-2023 at 10:04 AM.
Turtle91 is offline   Reply With Quote