KF8 Output: Add the css passed in throught the extra css conversion option to the generated inline ToC. Fixes #1052343 (full justification in TOC)

This commit is contained in:
Kovid Goyal 2012-10-02 14:52:57 +05:30
parent 1c7330d465
commit db13abc1d5

View File

@ -22,9 +22,10 @@ TEMPLATE = '''
li {{ list-style-type: none }}
a {{ text-decoration: none }}
a:hover {{ color: red }}
{extra_css}
</style>
</head>
<body>
<body id="calibre_generated_inline_toc">
<h2>{title}</h2>
<ul>
</ul>
@ -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: