View Single Post
Old 09-15-2022, 10:43 AM   #7
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,461
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by 01100001 View Post
EDIT: Unfortunately, no luck so far.

And I noticed something very important. A comma is assumed as the separator of values! So if I were to use an authors-like custom column (which I am; but simplified it for the example), where & is the separator, it gets messy. (Because values are split at commas instead of &'s when generating/identifying list items.)

I am not sure if anything can be done about this anymore. Would be great if there's a solution though.
It would help if you read the General Program Mode section of the calibre manual. There you would see that you can specify the separator to use in a for loop.

You don't say what the link text should be or where it comes from so I use "link_text" in this example.
Code:
program:
	j = '';
	for i in $#people separator '&':
	    j = j & '<li><a href="' & 'link_text' & '">' & i & '</a></li>'
	rof;
	'<ul>' & j & '</ul>'
chaley is offline   Reply With Quote