View Single Post
Old 01-21-2017, 07:08 AM   #5
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,454
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by PERSISTENCE View Post
Hi chaley -
Sorry, I guess I'm too much of a noob to fully understand your advice. I'd be glad to do this, but need some help..could you help me get started (with syntax)? If I have some assistance to get started I can go from there...I just need a helping hand.
Thanks, in advance...I'll await word.
-Persistence
I am traveling and cannot do much for a few weeks, and in any event I don't want to write the function for you.

Custom functions are written in pure python, using the editor available from Preferences / Template Functions. The dialog provides some help for setting things up.

Here is a sample template function that returns the first word of a series if there is one, the empty string otherwise.
Code:
def evaluate(self, formatter, kwargs, mi, locals):
	series = mi.get('series')
	if series:
		return series.split()[0]
	return ''
chaley is offline   Reply With Quote