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] = escape(val)
|
||||||
args[key+'_label'] = escape(display_name)
|
args[key+'_label'] = escape(display_name)
|
||||||
except:
|
except:
|
||||||
|
# if the val (custom column contents) is None, don't add to args
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if False:
|
if False:
|
||||||
|
@ -3252,17 +3252,22 @@ Author '{0}':
|
|||||||
|
|
||||||
def formatPrefix(self,prefix_char,soup):
|
def formatPrefix(self,prefix_char,soup):
|
||||||
# Generate the HTML for the prefix portion of the listing
|
# Generate the HTML for the prefix portion of the listing
|
||||||
spanTag = Tag(soup, "span")
|
# Kindle Previewer doesn't properly handle style=color:white
|
||||||
if prefix_char is None:
|
# MOBI does a better job allocating blank space with <code>
|
||||||
spanTag['style'] = "color:white"
|
if self.opts.fmt == 'mobi':
|
||||||
spanTag.insert(0,NavigableString(self.defaultPrefix))
|
codeTag = Tag(soup, "code")
|
||||||
# 2e3a is 'two-em dash', which matches width in Kindle Previewer
|
if prefix_char is None:
|
||||||
# too wide in calibre viewer
|
codeTag.insert(0,NavigableString(' '))
|
||||||
# minimal visual distraction
|
else:
|
||||||
# spanTag.insert(0,NavigableString(u'\u2e3a'))
|
codeTag.insert(0,NavigableString(prefix_char))
|
||||||
|
return codeTag
|
||||||
else:
|
else:
|
||||||
|
spanTag = Tag(soup, "span")
|
||||||
|
if prefix_char is None:
|
||||||
|
spanTag['style'] = "color:white"
|
||||||
|
prefix_char = self.defaultPrefix
|
||||||
spanTag.insert(0,NavigableString(prefix_char))
|
spanTag.insert(0,NavigableString(prefix_char))
|
||||||
return spanTag
|
return spanTag
|
||||||
|
|
||||||
def generateAuthorAnchor(self, author):
|
def generateAuthorAnchor(self, author):
|
||||||
# Strip white space to ''
|
# Strip white space to ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user