01-12-2016, 10:38 AM | #1 |
Wizard
Posts: 1,085
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Template Language
I was reading several post about the powerful template language, so I thought I'd try some of the features. Works well for the basic stuff I was experimenting with to add custom columns
1. Would it be possible to validate a template prior to saving it and restarting Calibre? I made a deliberate mistake ( as opposed to my normal ones) and left off a closing brace to see what would happen. It wasn't until it restarted that the error was caught. If it had been validated when I tried to exit, it would have been handier so I could fix it right away 2. Would it be possible to show a preview of the results of the template on the selected book in the template dialog while building it so the user could get a feel for the results? Might be helpful for the new or occasional template creator. 3. After Calibre restarts, the Virtual Library I had open before restarting, is no longer open, and it defaults to All. If I had a VL open when I closed, could (option maybe) the same VL be selected when I come back? Last edited by phossler; 01-12-2016 at 10:43 AM. |
01-12-2016, 11:01 AM | #2 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Double-click a custom column, the normal column editing paradigm.
If it is a column built from other columns (template column) it will pop up the template editing dialog. Which has a live preview of the results for the current book record. It doesn't require a restart. No need to go digging in the Preferences for the column creation dialog. Which does require a restart, since it is much more powerful and is meant to modify the column itself, not just the default template. |
Advert | |
|
01-12-2016, 11:58 AM | #3 |
Wizard
Posts: 1,085
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Actually I tried that with my custom 'MyTitle' (testing) column and all it did was reverse the sort direction when DC the header, and open Edit Metadata when DC a book. No dialog.
Ran out of places to DC. (Dell XPS 8700, Win10) |
01-12-2016, 01:01 PM | #4 | |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Tweak: Control behavior of the book list Quote:
Anyway, the F2 key allows you to edit in cell view no matter who you are. And thus to edit the custom column template. |
|
01-12-2016, 02:51 PM | #5 | |
Wizard
Posts: 1,085
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
My tweak is set to edit metadata on DC since I find I use that a lot more that the internal viewer or other choices
doubleclick_on_library_view = 'edit_metadata' Quote:
Just to further embarrass myself, was that in the manual? I like the instant error messages and the preview ... very nice But if I was using it to make a plugboard or something other than a custom column, is there an 'instant error' and preview capability? Say, something like the XPath wizard maybe? Last edited by phossler; 01-12-2016 at 03:01 PM. Reason: Accidently deleted some text |
|
Advert | |
|
01-12-2016, 03:10 PM | #6 | |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Yes the F2 trick is in the manual: http://manual.calibre-ebook.com/gui....oard-shortcuts
Quote:
Testing templates elsewhere... sure. You can generally right-click an input box and use "Open Template Editor". You can also use the Template Tester by clicking a row in the main spreadsheet view, and using the shortcut key CTRL+T (or adding the appropriate toolbar icon wherever you want). Last edited by eschwartz; 01-12-2016 at 06:44 PM. |
|
01-12-2016, 03:50 PM | #7 |
Wizard
Posts: 1,085
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Thanks again
BTW, I see the user manual was updated to v2.48 on Jan 10 |
01-12-2016, 04:19 PM | #8 |
Grand Sorcerer
Posts: 12,014
Karma: 7257321
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
The other possibility is to use the built-in "template tester". It lets you run arbitrary templates on a book of your choice, immediately seeing the results without changing anything in your library.
For convenience I added it to the context menu of the library. EDIT: ninja'ed by eschwartz because I didn't read beyond the question. |
01-12-2016, 04:37 PM | #9 | |
Wizard
Posts: 1,085
Karma: 412718
Join Date: Jan 2009
Location: Valley Forge, PA, USA
Device: Kindle Paperwhite
|
Quote:
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Template language uses title_sort instead of title | eMole | Calibre | 2 | 03-11-2014 07:22 AM |
Help needed with template language | Mamaijee | Devices | 12 | 02-19-2013 01:52 AM |
Help with template language | Pepin33 | Calibre | 8 | 11-11-2012 08:32 AM |
Template language question | BookJunkieLI | Library Management | 7 | 02-02-2012 06:55 PM |
Stupid question about calibre language template | Cammagno | Calibre | 1 | 01-08-2011 08:00 AM |