![]() |
#1 |
Enthusiast
![]() Posts: 46
Karma: 10
Join Date: Jun 2013
Device: Samsung Galaxy Tab A 8"
|
Template Language Question
I have a quick question for the forum about calibre template language.
When saving my epubs to disk to match Calibre Companion's template I have: {authors:sublist(0,1,&)}/{title:re([—®™],_)} - {authors:re(\.\,,)} But I noticed that if an author's name ends in a period e.g., "Jr." CC ignores the period, not even replacing with an underscore, in creating a subdirectory based on the author's name. My question is how can I use both a sublist and re when creating my subdirectory in the above template? Thanks in advance for your expertise. |
![]() |
![]() |
![]() |
#2 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,134
Karma: 1954142
Join Date: Aug 2015
Device: Kindle
|
Code:
{:'re(sublist($authors, 0,1,'&'), '\.', '_')'}/{title:re([—®™],_)} - {authors:re(\.\,,)} |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() Posts: 46
Karma: 10
Join Date: Jun 2013
Device: Samsung Galaxy Tab A 8"
|
|
![]() |
![]() |
![]() |
#4 |
Enthusiast
![]() Posts: 46
Karma: 10
Join Date: Jun 2013
Device: Samsung Galaxy Tab A 8"
|
I got it. It should be:
{authors:'re(sublist($, 0, 1, '&'), '\.$', '')'}/{title:re([—®™],_)} - {authors:re(\.$,)} Thanks! Much appreciated. Last edited by jvorzimmer; 11-20-2021 at 01:27 PM. Reason: correction |
![]() |
![]() |
![]() |
#5 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 11,911
Karma: 7076137
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
What version of calibre are you running? If it is before version 5 then you need Code:
{authors:'re(sublist($,0,1,'&'), '\.', '_')'}/{title:re([—®™],_)} - {authors:re(\.\,,)} |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 |
Enthusiast
![]() Posts: 46
Karma: 10
Join Date: Jun 2013
Device: Samsung Galaxy Tab A 8"
|
Sorry, I should have mentioned that I'm 4.23.
|
![]() |
![]() |
![]() |
Tags |
language, template, title |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Template language changes | chaley | Library Management | 133 | 07-31-2024 07:14 AM |
Template Language | phossler | Calibre | 8 | 01-12-2016 04:37 PM |
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 |