Quote:
Originally Posted by cabpp
I want to create a TOC in Mobi and ePub when converting through Calibre. My chapter headings in file are images, no actual text headers.
<p class="chapter" align="right">
<img src="/Users/Desktop/book/Chapter 2.jpg" alt="Chapter 2" width="236" height="148"/></p>
This is the format in file. I am not sure how to create, or force create a TOC with images as headings. I'm using Textmate as editor.
Any thoughts would be appreciated. I've tried unsuccessfully using XPath - book starts with Chapter 7, and then list TOC as all unnamed.
Thanks
|
You want to convert and modify<p class="chapter"
to a <p class="chapter" title="\2"
I suggest the book-editor
Not tested
(REGEX)Search:
Code:
<p class="chapter" align="right">\s+(<img src="/Users/Desktop/book/.+.jpg" alt=)"(.+?)" (.+?)/>)</p>
Replace:
Code:
<p class="chapter" align="right" title="\2">\1"\2" \3</p>
The therory: Capture the Alt value, use that to construct and insert the
title=" "
Second phase is to replace the P tag pair with a H# pair
Note I would also move the align right to .chapter in the CSS
BIG NOTE:
src="/Users/Desktop
That path will break your book as soon as you move the book