Use <h2> for inserted ToC title for MOBI and PDF as well

See #1245076 ([Enhancement] Add PDF TOC Title, More Margin Options and ePub TOC Heading 1)
This commit is contained in:
Kovid Goyal 2013-10-29 09:51:13 +05:30
parent 2d69246fa5
commit 4005b8e502
2 changed files with 3 additions and 3 deletions

View File

@ -102,7 +102,7 @@ class HTMLTOCAdder(object):
href=css_href) href=css_href)
body = element(contents, XHTML('body'), body = element(contents, XHTML('body'),
attrib={'class': 'calibre_toc'}) attrib={'class': 'calibre_toc'})
h1 = element(body, XHTML('h1'), h1 = element(body, XHTML('h2'),
attrib={'class': 'calibre_toc_header'}) attrib={'class': 'calibre_toc_header'})
h1.text = title h1.text = title
self.add_toc_level(body, oeb.toc) self.add_toc_level(body, oeb.toc)

View File

@ -9,7 +9,7 @@ __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
import os import os
from lxml.html import tostring from lxml.html import tostring
from lxml.html.builder import (HTML, HEAD, BODY, TABLE, TR, TD, H1, STYLE) from lxml.html.builder import (HTML, HEAD, BODY, TABLE, TR, TD, H2, STYLE)
def convert_node(toc, table, level, pdf): def convert_node(toc, table, level, pdf):
tr = TR( tr = TR(
@ -64,7 +64,7 @@ def toc_as_html(toc, pdf, opts):
) )
), ),
BODY( BODY(
H1(opts.toc_title or _('Table of Contents')), H2(opts.toc_title or _('Table of Contents')),
TABLE(), TABLE(),
) )
) )