View Single Post
Old 01-06-2025, 05:41 PM   #836
kiwidude
Calibre Plugins Developer
kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.kiwidude ought to be getting tired of karma fortunes by now.
 
Posts: 4,733
Karma: 2197770
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
Generate Cover v2.3.5

Release Notes
https://github.com/kiwidude68/calibr...e_cover-v2.3.5

Special thanks to @chaley on this one for finding the issue when also taking the time to respond to a user query. Full details can be found on the issue thread here:
https://github.com/kiwidude68/calibr...ins/issues/101

TLDR - a user wanted to include the comments field in their cover, but stripping out any html around it first. This can be done use a python template for the formatter, once a blocking issue in the plugin was corrected. If anyone else needs the same functionality, you can paste this into the custom text field:
Code:
python:
def evaluate(book, context):
	from qt.core import QTextEdit
	from calibre.gui2.comments_editor import fix_html

	e = QTextEdit()
	e.setHtml(book.comments)
	e.setHtml(fix_html(e.toHtml(), e.toPlainText()))
	return e.toPlainText()
kiwidude is offline   Reply With Quote