mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
GwR catalog revisions wip
This commit is contained in:
parent
966a9c4ffb
commit
463a95cb26
@ -4321,14 +4321,14 @@ class EPUB_MOBI(CatalogPlugin):
|
|||||||
_soup = BeautifulSoup('')
|
_soup = BeautifulSoup('')
|
||||||
genresTag = Tag(_soup,'p')
|
genresTag = Tag(_soup,'p')
|
||||||
gtc = 0
|
gtc = 0
|
||||||
for tag in book.get('tags', []):
|
for (i, tag) in enumerate(book.get('tags', [])):
|
||||||
aTag = Tag(_soup,'a')
|
aTag = Tag(_soup,'a')
|
||||||
if self.opts.generate_genres:
|
if self.opts.generate_genres:
|
||||||
aTag['href'] = "Genre_%s.html" % re.sub("\W","",tag.lower())
|
aTag['href'] = "Genre_%s.html" % re.sub("\W","",tag.lower())
|
||||||
aTag.insert(0,escape(NavigableString(tag)))
|
aTag.insert(0,escape(NavigableString(tag)))
|
||||||
genresTag.insert(gtc, aTag)
|
genresTag.insert(gtc, aTag)
|
||||||
gtc += 1
|
gtc += 1
|
||||||
if gtc < len(book['tags']):
|
if i < len(book['tags'])-1:
|
||||||
genresTag.insert(gtc, NavigableString(' %s ' % MIDDOT))
|
genresTag.insert(gtc, NavigableString(' %s ' % MIDDOT))
|
||||||
gtc += 1
|
gtc += 1
|
||||||
genres = genresTag.renderContents()
|
genres = genresTag.renderContents()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user