code: def write(self, file_path, template, context={}, preserve=False, force=False):
          
          if not file_path or not template:
              click.secho('source or target missing for document')
              return
          if not context:
              context = self.context
          error = False
          try:
              self._write(file_path, template, context, preserve, force)
          except TemplateSyntaxError as exc:
              message = '{0}:{1}: error: {2}'.format(exc.filename, exc.lineno, exc.message)
              click.secho(message, fg='red', err=True)
              error = True
          except TemplateNotFound as exc:
              message = '{0}: error: Template not found'.format(exc.name)
              click.secho(message, fg='red', err=True)
              error = True
          except TemplateError as exc:
              # Just return with an error, the generic template_error_handler takes care of printing it
              error = True
  
          if error and Generator.strict:
              sys.exit(1)
docs: Using a template file name it renders a template
             into a file given a context