import jinja2


def render(path, variables={}):
    """Render the given template using the given variables."""
    env = jinja2.Environment(
        loader=jinja2.PackageLoader('gutenberg'),
        trim_blocks=True,
        lstrip_blocks=True)

    template = env.get_template(path)
    return template.render(variables)