mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 08:43:10 +02:00
[SNBOutput] The conetent in html before the first bookmark should also be outputted.
This commit is contained in:
parent
8fd3f0ebaa
commit
0c387834f4
1 changed files with 9 additions and 3 deletions
|
|
@ -133,9 +133,6 @@ def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
|||
oeb_book.toc.add(_('Start'), first.href)
|
||||
|
||||
for tocitem in oeb_book.toc:
|
||||
ch = etree.SubElement(tocBody, "chapter")
|
||||
ch.set("src", ProcessFileName(tocitem.href) + ".snbc")
|
||||
ch.text = tocitem.title
|
||||
if tocitem.href.find('#') != -1:
|
||||
item = string.split(tocitem.href, '#')
|
||||
if len(item) != 2:
|
||||
|
|
@ -145,6 +142,11 @@ def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
|||
outputFiles[item[0]].append((item[1], tocitem.title))
|
||||
else:
|
||||
outputFiles[item[0]] = []
|
||||
if not "" in outputFiles[item[0]]:
|
||||
outputFiles[item[0]].append(("", _("Start")))
|
||||
ch = etree.SubElement(tocBody, "chapter")
|
||||
ch.set("src", ProcessFileName(item[0]) + ".snbc")
|
||||
ch.text = _("Start")
|
||||
outputFiles[item[0]].append((item[1], tocitem.title))
|
||||
else:
|
||||
if tocitem.href in outputFiles:
|
||||
|
|
@ -152,6 +154,10 @@ def convert(self, oeb_book, output_path, input_plugin, opts, log):
|
|||
else:
|
||||
outputFiles[tocitem.href] = []
|
||||
outputFiles[tocitem.href].append(("", tocitem.title))
|
||||
ch = etree.SubElement(tocBody, "chapter")
|
||||
ch.set("src", ProcessFileName(tocitem.href) + ".snbc")
|
||||
ch.text = tocitem.title
|
||||
|
||||
|
||||
etree.SubElement(tocHead, "chapters").text = '%d' % len(tocBody)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue