Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 09-02-2020, 04:26 PM   #1
beber75
Member
beber75 began at the beginning.
 
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
beber75 is offline   Reply With Quote
Old 09-02-2020, 06:47 PM   #2
beber75
Member
beber75 began at the beginning.
 
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}
beber75 is offline   Reply With Quote
Advert
Old 09-02-2020, 10:31 PM   #3
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,906
Karma: 47303748
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'))
	)
I have to say it is ugly.
davidfor is offline   Reply With Quote
Old 09-03-2020, 10:38 AM   #4
beber75
Member
beber75 began at the beginning.
 
Posts: 10
Karma: 10
Join Date: Sep 2020
Device: boox
You're the man !!!

Thanks a lot it works.
beber75 is offline   Reply With Quote
Reply

Tags
editor, syntax, template


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 09:45 PM.


MobileRead.com is a privately owned, operated and funded community.