From 4005b8e502924caffbb8add3d10c7f49cf877407 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 29 Oct 2013 09:51:13 +0530 Subject: [PATCH] Use

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) --- src/calibre/ebooks/oeb/transforms/htmltoc.py | 2 +- src/calibre/ebooks/pdf/render/toc.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/oeb/transforms/htmltoc.py b/src/calibre/ebooks/oeb/transforms/htmltoc.py index 0e1b2b5f10..c7a0cfce94 100644 --- a/src/calibre/ebooks/oeb/transforms/htmltoc.py +++ b/src/calibre/ebooks/oeb/transforms/htmltoc.py @@ -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) diff --git a/src/calibre/ebooks/pdf/render/toc.py b/src/calibre/ebooks/pdf/render/toc.py index 6534248d86..f1a812ce6f 100644 --- a/src/calibre/ebooks/pdf/render/toc.py +++ b/src/calibre/ebooks/pdf/render/toc.py @@ -9,7 +9,7 @@ __copyright__ = '2013, Kovid Goyal ' 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(), ) )