Fix title overflow in EPUB catalog

This commit is contained in:
Kovid Goyal 2010-01-22 15:40:21 -07:00
parent d4c862ba94
commit 4153a4e647
3 changed files with 10 additions and 4 deletions

View File

@ -67,6 +67,9 @@
- title: "Fix bug in OEBWriter that could cause writing out of resources in subdirectories with URL unsafe names to fail" - title: "Fix bug in OEBWriter that could cause writing out of resources in subdirectories with URL unsafe names to fail"
- title: "E-book viewer: Change highlight color to yellow on all platforms."
tickets: [4641]
new recipes: new recipes:
- title: Frankfurter Rundschau - title: Frankfurter Rundschau
author: Justus Bisser author: Justus Bisser

View File

@ -4,7 +4,7 @@ p.title {
text-align:center; text-align:center;
font-style:italic; font-style:italic;
font-size:xx-large; font-size:xx-large;
height:0px; border-bottom: solid black 4px;
} }
p.author { p.author {

View File

@ -2279,6 +2279,8 @@ class EPUB_MOBI(CatalogPlugin):
</html> </html>
''' '''
else: else:
title_border = '' if self.opts.fmt == 'epub' else \
'<div class="hr"><blockquote><hr/></blockquote></div>'
header = ''' header = '''
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:calibre="http://calibre.kovidgoyal.net/2009/metadata"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:calibre="http://calibre.kovidgoyal.net/2009/metadata">
@ -2289,7 +2291,7 @@ class EPUB_MOBI(CatalogPlugin):
</head> </head>
<body> <body>
<p class="title"></p> <p class="title"></p>
<div class="hr"><blockquote><hr/></blockquote></div> {0}
<p class="author"></p> <p class="author"></p>
<p class="tags">&nbsp;</p> <p class="tags">&nbsp;</p>
<table width="100%" border="0"> <table width="100%" border="0">
@ -2329,7 +2331,7 @@ class EPUB_MOBI(CatalogPlugin):
<!--p class="instructions">&#9654; Press <span style="font-variant:small-caps"><b>back</b></span> to return to list &#9664;</p--> <!--p class="instructions">&#9654; Press <span style="font-variant:small-caps"><b>back</b></span> to return to list &#9664;</p-->
</body> </body>
</html> </html>
''' '''.format(title_border)
# Insert the supplied title # Insert the supplied title
soup = BeautifulSoup(header, selfClosingTags=['mbp:pagebreak']) soup = BeautifulSoup(header, selfClosingTags=['mbp:pagebreak'])
@ -2517,6 +2519,7 @@ class EPUB_MOBI(CatalogPlugin):
def run(self, path_to_output, opts, db, notification=DummyReporter()): def run(self, path_to_output, opts, db, notification=DummyReporter()):
from calibre.utils.logging import Log from calibre.utils.logging import Log
self.opts = opts
log = Log() log = Log()
opts.fmt = self.fmt = path_to_output.rpartition('.')[2] opts.fmt = self.fmt = path_to_output.rpartition('.')[2]
@ -2549,7 +2552,7 @@ class EPUB_MOBI(CatalogPlugin):
recommendations = [] recommendations = []
if opts.fmt == 'mobi' and opts.output_profile.startswith("kindle"): if opts.fmt == 'mobi' and opts.output_profile and opts.output_profile.startswith("kindle"):
recommendations.append(('output_profile', opts.output_profile, recommendations.append(('output_profile', opts.output_profile,
OptionRecommendation.HIGH)) OptionRecommendation.HIGH))
recommendations.append(('no_inline_toc', True, recommendations.append(('no_inline_toc', True,