import jinja2  # noqa: WPS433


def generate_text(config: dict, user_data: dict) -> str:
    """Generate out a Text format document."""
    template = config.get('jinja2', 'template')
    with open(template, 'r') as template_file:
        return jinja2.Template(template_file.read()).render(data=user_data)