docs: def write_doc(doc : MetapackDoc, mt_file=None):
      """
      Write a Metatab doc to a CSV file, and update the Modified time
      :param doc:
      :param mt_file:
      :return:
      """
  
      from rowgenerators import parse_app_url
  
      if not mt_file:
          mt_file = doc.ref
  
      add_giturl(doc)
  
      u = parse_app_url(mt_file)
  
      if u.scheme == 'file':
          doc.write(mt_file)
          return True
      else:
          return False