Quote:
Originally Posted by morgon
Hi,
I would like to convert a plain (ascii) text file to epub and generate a toc.
As this is a text file xpath does not make much sense (at least to me), but I can construct a regext that allows chapters to be detected.
How can I teach calibre to use this regex to detect chapters when converting plain text to epub?
many thanks!
|
I
think the controlling factor is any line of text that does NOT end with a period, or other sentence ender, will generate a bolded chapter title line on a fresh page and an entry in the auto-generated TOC
I
know the above is true for lines consisting only of a number, or the word Chapter or Part followed by a single word or a number.
If the last character of such a line is a period it is treated as any other sentence in the text.