Source code for docdown.template_adapters.template_string

# -*- coding: utf-8 -*-
"""
Adapter to use Python string.Template to render a template
"""

from __future__ import absolute_import, unicode_literals, print_function

from string import Template


[docs]class TemplateStringAdapter(object):
[docs] def render(self, template='', context=None, *args, **kwargs): if context is None: context = {} t = Template(template) return t.substitute(**context)