From db13abc1d5ca2e3f62997405e55b069ed7379824 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 2 Oct 2012 14:52:57 +0530 Subject: [PATCH] KF8 Output: Add the css passed in throught the extra css conversion option to the generated inline ToC. Fixes #1052343 (full justification in TOC) --- src/calibre/ebooks/mobi/writer8/toc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/calibre/ebooks/mobi/writer8/toc.py b/src/calibre/ebooks/mobi/writer8/toc.py index 313c454535..a6a089b402 100644 --- a/src/calibre/ebooks/mobi/writer8/toc.py +++ b/src/calibre/ebooks/mobi/writer8/toc.py @@ -22,9 +22,10 @@ TEMPLATE = ''' li {{ list-style-type: none }} a {{ text-decoration: none }} a:hover {{ color: red }} + {extra_css} - +

{title}

@@ -64,7 +65,7 @@ class TOCAdder(object): self.log('\tGenerating in-line ToC') root = etree.fromstring(TEMPLATE.format(xhtmlns=XHTML_NS, - title=self.title)) + title=self.title, extra_css=(opts.extra_css or ''))) parent = XPath('//h:ul')(root)[0] parent.text = '\n\t' for child in self.oeb.toc: