Quote:
Originally Posted by llasram
Create an OPF file, add //guide/reference tags, and convert the OPF file instead of the source HTML directly? That is supposed to work, although I don't have the code open in front of me ATM.
|
That's what I'm talking about -- I do all my conversions that way, because you get much better control over the final output if you work from the OPF file manually.
mobigen reads all the //guide/reference tags in the OPF file and creates the corresponding //head/guide/reference entries in the Mobipocket markup in the output file, such as converting the OPF file's entries:
Code:
<guide>
<reference type="title-page" title="Title Page" href="generic_file.xhtml" />
<reference type="toc" title="Table of Contents" href="generic_file.xhtml#toc" />
<reference type="copyright-page" title="Copyright Page" href="generic_file.xhtml#copyright" />
</guide>
into the following in the Mobipocket markup in the .mobi file:
Code:
<reference title="Title Page" type="title-page" filepos=0000000681 /><reference title="Table of Contents" type="toc" filepos=0000002434 /><reference title="Copyright Page" type="copyright-page" filepos=0000001140 />
But with
ebook-convert, the //guide/reference tags seem to be ignored if they aren't of type toc, because the only //head/guide/reference entity is Table of Contents.
Edited: Hmm, I've actually been misinterpreting it. I just noticed that the //head/guide/reference entry that
ebook-convert creates is to the automatically generated Table of Contents link at the end of the file, rather than to the existing Table of Contents link in the OPF file. So it's really completely ignoring the //guide/reference tags in the source OPF.
Edited again:: I just noticed that calibre 0.5.14's
oeb2mobi command does, in fact, translate the //guide/reference tags properly. So the problem must be with
ebook-convert not realizing it should read and use those tags instead of generating its own Table of Contents. Or maybe there's a way to disable Table of Contents generation that I haven't figured out? I tried using the --chapter=/ option to disable chapter detection, but that didn't work.