Changing the Django template system to do what you want would be extremely difficult; if you want to do that, start by completely understanding the django.template module. Frankly, I wouldn't recommend creating a tag that used a different way of handling parameters than all of the other existing tags -- it would prove confusing to the users that have to work with the tags.
But if you insist on doing this anyways, you just need to have your custom template tag parse its parameters individually to provide the service. Something like this should do the trick:
def fixit( argument ):
"""Strip off any leading 'word=' noise words from argument"""
result = argument.split('=')[-1]
if result[0] == '"' and result[-1] == '"':
result = result[1:-2]
return result
@register.inclusion_tag('bouts/fighter/_fighter_bout_list.html')
def fighter_bout_list(list, header, fighter, has, empty):
return {
'list' : fixit(list),
'header': fixit(header),
'fighter': fixit(fighter),
'has' : fixit(has),
'empty' : fixit(empty),
}
Edited
This code is still positional -- I'm not suggesting that you can use this to do true keyword arguments. I added code to deal with the presence of quotes, but I still haven't tested this -- it's just a suggestion.
Again, I'd strongly recommend against this approach. The point behind a template tag is to do something that can't be done easily with the existing template tags, but it's still part of a template, and is really there to be a tool for someone technical enough to use an HTML editor. I'm trying to picture a use case for your proposed tag where it will be used more than a couple of times in a site. A little documentation and an example would be a lot cheaper than trying to implement keyword arguments for a template tag in a system that doesn't use keyword arguments.