code: def render_tmplt(path, cp):
      
  
      # define filename and slug from path
      filename = os.path.basename(path)
      slug = filename.replace('.', '_')
  
      # initializations
      content = None
  
      # read file as a string
      with open(path, 'rb') as fp:
          content = fp.read()
  
      # replace all the escaped characters
      content = unescape(content, unescape_table)
  
      # render template
      template_dir = '/'.join(path.split('/')[:-1])
      env = Environment(loader=FileSystemLoader(template_dir))
      env.globals.update(setup_template_render=setup_template_render)
      env.globals.update(get_embedded_config=get_embedded_config)
      env.globals.update(path_exists=os.path.exists)
      template = env.get_template(filename)
      context = {'filename' : filename,
                 'slug'     : slug,
                 'cp'       : cp,
                 'content'  : content}
      output = template.render(context)
  
      return output
docs: Render a file as text.