![]() |
#1 |
Member
![]() Posts: 10
Karma: 10
Join Date: Sep 2020
Device: boox
|
Calibre Template editor syntax help
Hi,
I've received my ebook reader recently and I'm quite happy with it. When I synchronize my eboks with my device, they are all saved inside the same folder. After digging a little bit with the software, I figured that I should play with : Device / Configure this device option and play with the template editor I like the following syntax: {author_sort[0]}/{author_sort}/{title} for single books When it concern book series, I prefer this one: {|| __Series__}/{series}/{series_index:0>2s|| - }{title|| - }{author_sort} Switching the rule manually is a pain and I pretty sure there is a better way to do it. I'm wondering if it's possible to have something like that (I don’t know how to translate it to the template editor): if {series} is empty then use "{author_sort[0]}/{author_sort}/{title}" else use "{|| __Series__}/{series}/{series_index:0>2s|| - }{title|| - }{author_sort}" Thanks in advance to those who are better skilled than me on this part. PS: sorry for my English, I'm French. Regards |
![]() |
![]() |
![]() |
#2 |
Member
![]() Posts: 10
Karma: 10
Join Date: Sep 2020
Device: boox
|
PS: The Syntax for series is a little bit different (my mistake) and should be like this:
__Series__/{series}/{series_index:0>2s|| - }{title} - {author_sort} |
![]() |
![]() |
![]() |
#3 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
|
The following should work:
Code:
program: test( field('series'), strcat('__Series__/',field('series'),'/',format_number(field('series_index'),'{0:02d}'),' - ',field('title'),' - ',field('author_sort')), strcat(substr(field('author_sort'),0,1),'/',field('author_sort'),'/',field('title')) ) |
![]() |
![]() |
![]() |
#4 |
Member
![]() Posts: 10
Karma: 10
Join Date: Sep 2020
Device: boox
|
You're the man !!!
Thanks a lot it works. |
![]() |
![]() |
![]() |
Tags |
editor, syntax, template |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calibre command line syntax | RobertWHayes | Calibre | 9 | 03-21-2020 06:22 PM |
Need help in Custom Columns, template syntax, and rounding numbers | dennocoil | Calibre | 0 | 07-10-2017 03:24 PM |
Template editor | Jellby | Calibre | 4 | 08-23-2014 03:10 AM |
Is there a way to change the editor's background colour and syntax colouring? | nicciglen | Editor | 3 | 01-15-2014 07:20 PM |
template editor error | lrui | Calibre | 2 | 11-06-2012 10:07 AM |