mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
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:
parent
1c7330d465
commit
db13abc1d5
@ -22,9 +22,10 @@ TEMPLATE = '''
|
|||||||
li {{ list-style-type: none }}
|
li {{ list-style-type: none }}
|
||||||
a {{ text-decoration: none }}
|
a {{ text-decoration: none }}
|
||||||
a:hover {{ color: red }}
|
a:hover {{ color: red }}
|
||||||
|
{extra_css}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body id="calibre_generated_inline_toc">
|
||||||
<h2>{title}</h2>
|
<h2>{title}</h2>
|
||||||
<ul>
|
<ul>
|
||||||
</ul>
|
</ul>
|
||||||
@ -64,7 +65,7 @@ class TOCAdder(object):
|
|||||||
self.log('\tGenerating in-line ToC')
|
self.log('\tGenerating in-line ToC')
|
||||||
|
|
||||||
root = etree.fromstring(TEMPLATE.format(xhtmlns=XHTML_NS,
|
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 = XPath('//h:ul')(root)[0]
|
||||||
parent.text = '\n\t'
|
parent.text = '\n\t'
|
||||||
for child in self.oeb.toc:
|
for child in self.oeb.toc:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user