Source code for lightmlboard.templates
"""
About templates.
:githublink:`%|py|5`
"""
import os
[docs]def get_template(name):
"""
Get a template name.
:param name: template name
:return: content
:githublink:`%|py|14`
"""
this = os.path.dirname(name)
tm = os.path.join(this, name)
if not os.path.exists(tm):
raise FileNotFoundError("Unable to find template '{0}'.".format(name))
with open(tm, "r", encoding="utf-8") as f:
return f.read()