View Single Post
Old 07-28-2008, 10:16 AM   #1
acidzebra
Liseuse Lover
acidzebra ought to be getting tired of karma fortunes by now.acidzebra ought to be getting tired of karma fortunes by now.acidzebra ought to be getting tired of karma fortunes by now.acidzebra ought to be getting tired of karma fortunes by now.acidzebra ought to be getting tired of karma fortunes by now.acidzebra ought to be getting tired of karma fortunes by now.acidzebra ought to be getting tired of karma fortunes by now.acidzebra ought to be getting tired of karma fortunes by now.acidzebra ought to be getting tired of karma fortunes by now.acidzebra ought to be getting tired of karma fortunes by now.acidzebra ought to be getting tired of karma fortunes by now.
 
acidzebra's Avatar
 
Posts: 869
Karma: 1035404
Join Date: Jul 2008
Location: Netherlands
Device: PRS-505
HTML2LRF question (Chapter processing)

Hi,

I have an arbitrary HTML file. Chapters are marked as follows:
<font size="+3">Chapter 1</font>

I want to add the chapters to a TOC. However, from the Calibre manual:
Quote:
--chapter-regex
The regular expression used to detect chapter titles. It is searched for in heading tags (h1-h6). Defaults to chapter|book|appendix
This is useless to me, as it only looks in h1-h6 heading tags. (I would consider search and replace, except I have rather a lot of files).

I'm hoping --chapter-attr will allow me to build an expression to detect chapters in this format, however, looking at the manual:

Quote:
--chapter-attr
Detect a chapter beginning at an element having the specified attribute. The format for this option is tagname regexp,attribute name,attribute value regexp. For example to match all heading tags that have the attribute class=”chapter” you would use “hd,class,chapter”. Default is $,,$
I tried --chapter-attr="font,size,+3" but this crashes html2lrf. I tried --chapter-attr="font,size,3" but obviously this does not find any chapters.

Any suggestions?
acidzebra is offline   Reply With Quote