code: def load_template(self, template: str) -> Template:
          
          env = dict(trim_blocks=True, lstrip_blocks=True, keep_trailing_newline=False)
          jinja2_ext = ".jinja2"
          if not template.endswith(jinja2_ext):
              self._log.error("Template file name must end with %s" % jinja2_ext)
              raise ValueError
          if not template[:-len(jinja2_ext)].endswith(".md"):
              self._log.error("Template file should be a Markdown file.")
              raise ValueError
          if not os.path.isabs(template):
              template = os.path.join(os.path.dirname(__file__), template)
          with open(template, encoding="utf-8") as fin:
              template_obj = Template(fin.read(), **env)
          template_obj.filename = template
          self._log.info("Loaded %s", template)
          return template_obj
docs: Load a Jinja2 template from the source directory.