def METHOD_NAME(self, template_name, output_name, context):
    """Render the template into output_name using context."""
    if jinja2 is None:
        req_missing(['jinja2'], 'use this theme')
    template = self.lookup.get_template(template_name)
    data = template.render(**context)
    if output_name is not None:
        makedirs(os.path.dirname(output_name))
        with io.open(output_name, 'w', encoding='utf-8') as output:
            output.write(data)
    return data