View Single Post
Old 04-07-2023, 04:09 PM   #9
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by haertig View Post
One thing I haven't seen mentioned in the documentation though, which would be very nice, is some way to test your templates. Something where you could manually feed the fields to your template and observe what the template will make of those. As best I have been able to determine, the only way to test your template is to make it live in Calibre, then do a real transfer to your Kindle, and then observe on the Kindle what the result was. Then change the template, and repeat the process until you achieve success. It would be handy if there were a little "test window" in Calibre so you didn't have to keep plugging in your Kindle, downloading a book, deleting that book if your template failed, then twiddle the template and download to the Kindle again. Maybe I missed something, but this somewhat cumbersome process seems to be the only way to do any testing.
Use the "Template Tester", which is a dialog that does what you want. The tester is mentioned in the documentation, but not prominently.

You select some number of books then launch the tester. It runs the template and shows you the resulting value for each book. You can set breakpoints & step through templates, use stored templates, and save/reload templates.

I use the tester so much that I added it to the context menu for a book, and also gave it a shortcut (Ctrl+Alt+t). You can do that, put it on the tool bar, put it on the menu bar, or whatever. @ownedbycats uses them enough to have requested the ability to have multiple tester dialogs open at the same time.
chaley is offline   Reply With Quote