![]() |
#1 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54
Karma: 186734
Join Date: Jun 2013
Device: Samsung Galaxy Tab A9+
|
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,185
Karma: 1988646
Join Date: Aug 2015
Device: Kindle
|
Code:
{:'re(sublist($authors, 0,1,'&'), '\.', '_')'}/{title:re([—®™],_)} - {authors:re(\.\,,)} |
![]() |
![]() |
![]() |
#3 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54
Karma: 186734
Join Date: Jun 2013
Device: Samsung Galaxy Tab A9+
|
|
![]() |
![]() |
![]() |
#4 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54
Karma: 186734
Join Date: Jun 2013
Device: Samsung Galaxy Tab A9+
|
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: 12,315
Karma: 7957679
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(\.\,,)} |
|
![]() |
![]() |
![]() |
#6 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 54
Karma: 186734
Join Date: Jun 2013
Device: Samsung Galaxy Tab A9+
|
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 | 174 | 02-16-2025 06:52 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 |