View Single Post
Old 02-27-2023, 09:12 AM   #2842
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,476
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Katja_hbg View Post
I already saw that. Now I will have a deeper look into it but maybe I am overwhelmed.
Here is a template that removes all tags bracketed by [] and all tags listed in the variable tags_to_ignore.

Code:
program:
# Remove any tag bracketed by []
	tags = list_re($tags, ',', '^[^\[].*[^\]]$', '');
# Remove tags listed in tags_to_ignore
	tags_to_ignore = 'AA.BBF.CCC, onDevice';
	list_join(':@:', list_difference(tags, tags_to_ignore, ','), ',')
Example: if a book has the tags
Code:
[PBook], Science Fiction, allbooks.foo, Fiction, Fantasy, General, Epic, AA.BBF.CCC, onDevice
and tags_to_ignore is
Code:
	tags_to_ignore = 'AA.BBF.CCC, onDevice';
then the template result is
Code:
allbooks.foo:@:Epic:@:Fantasy:@:Fiction:@:General:@:Science Fiction
chaley is offline   Reply With Quote