mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
2d69246fa5
commit
4005b8e502
@ -102,7 +102,7 @@ class HTMLTOCAdder(object):
|
||||
href=css_href)
|
||||
body = element(contents, XHTML('body'),
|
||||
attrib={'class': 'calibre_toc'})
|
||||
h1 = element(body, XHTML('h1'),
|
||||
h1 = element(body, XHTML('h2'),
|
||||
attrib={'class': 'calibre_toc_header'})
|
||||
h1.text = title
|
||||
self.add_toc_level(body, oeb.toc)
|
||||
|
@ -9,7 +9,7 @@ __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>'
|
||||
import os
|
||||
|
||||
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):
|
||||
tr = TR(
|
||||
@ -64,7 +64,7 @@ def toc_as_html(toc, pdf, opts):
|
||||
)
|
||||
),
|
||||
BODY(
|
||||
H1(opts.toc_title or _('Table of Contents')),
|
||||
H2(opts.toc_title or _('Table of Contents')),
|
||||
TABLE(),
|
||||
)
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user