mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Fine-tuned prefix layout for MOBI
This commit is contained in:
parent
2ac38d5eec
commit
adf0eb8e7d
@ -194,6 +194,7 @@ def render_jacket(mi, output_profile,
|
||||
args[key] = escape(val)
|
||||
args[key+'_label'] = escape(display_name)
|
||||
except:
|
||||
# if the val (custom column contents) is None, don't add to args
|
||||
pass
|
||||
|
||||
if False:
|
||||
|
@ -3252,17 +3252,22 @@ Author '{0}':
|
||||
|
||||
def formatPrefix(self,prefix_char,soup):
|
||||
# Generate the HTML for the prefix portion of the listing
|
||||
spanTag = Tag(soup, "span")
|
||||
if prefix_char is None:
|
||||
spanTag['style'] = "color:white"
|
||||
spanTag.insert(0,NavigableString(self.defaultPrefix))
|
||||
# 2e3a is 'two-em dash', which matches width in Kindle Previewer
|
||||
# too wide in calibre viewer
|
||||
# minimal visual distraction
|
||||
# spanTag.insert(0,NavigableString(u'\u2e3a'))
|
||||
# Kindle Previewer doesn't properly handle style=color:white
|
||||
# MOBI does a better job allocating blank space with <code>
|
||||
if self.opts.fmt == 'mobi':
|
||||
codeTag = Tag(soup, "code")
|
||||
if prefix_char is None:
|
||||
codeTag.insert(0,NavigableString(' '))
|
||||
else:
|
||||
codeTag.insert(0,NavigableString(prefix_char))
|
||||
return codeTag
|
||||
else:
|
||||
spanTag = Tag(soup, "span")
|
||||
if prefix_char is None:
|
||||
spanTag['style'] = "color:white"
|
||||
prefix_char = self.defaultPrefix
|
||||
spanTag.insert(0,NavigableString(prefix_char))
|
||||
return spanTag
|
||||
return spanTag
|
||||
|
||||
def generateAuthorAnchor(self, author):
|
||||
# Strip white space to ''
|
||||
|
Loading…
x
Reference in New Issue
Block a user