Returns the code to be translated by Zotero.
    Usage:
        {% zotero_tags
            object=object
            vocabulary=vocabulary
            output_method=output_method %}
    Example:
        {% zotero_tags object=document1 vocabulary="dc" output_method="meta" %}

def zotero_tags(parser, token):
    """
    Returns the code to be translated by Zotero.
    Usage:
        {% zotero_tags
            object=object
            vocabulary=vocabulary
            output_method=output_method %}
    Example:
        {% zotero_tags object=document1 vocabulary="dc" output_method="meta" %}
    """
    default = {
        'object': u'',
        'vocabulary': u'dc',
        'output_method': u'meta'
    }
    
    letters = ['zero', 'one', 'two', 'three', 'four', 'five', 'six', 'seven']
    min_args = 1
    max_args = len(default)
    if min_args == 1:
        min_pl = ''
    else:
        min_pl = 's'
    if max_args == 1:
        max_pl = ''
    else:
        max_pl = 's'
    args = token.split_contents()
    length = len(args)
    if length < min_args + 1:
        raise TemplateSyntaxError('%s requires at least %s argument%s.' %
                                  (args[0], letters[min_args], min_pl))
    elif length > max_args + 1:
        raise TemplateSyntaxError('%s requires %s or less argument%s.' %
                                  (args[0], letters[max_args], max_pl))
    
    for arg in args[1:length]:
        i = arg.find('=')
        if i == -1:
            raise TemplateSyntaxError('%s syntax error: %s.' % (args[0], arg))
        else:
            key = arg[:i]
            val = arg[i + 1:]
            if not key in default.keys():
                raise TemplateSyntaxError('%s invalid argument: %s.' %
                                          (args[0], key))
            else:
                default[key] = val
    
    return ZoteroTagsNode(default)