code: def read_file(file_path):
          
          with open(file_path, 'r', encoding='utf-8') as f:
              whole = f.read().strip()
  
          if whole.startswith('---'):
              # may has yaml meta info, so we try to split it out
              sp = re.split(r'-{3,}', whole.lstrip('-'), maxsplit=1)
              if len(sp) == 2:
                  # do have yaml meta info, so we read it
                  return yaml.load(sp[0]), sp[1].lstrip()
          return {}, whole
docs: Read yaml head and raw body content from a file.
  
          :param file_path: file path
          :return: tuple(meta, raw_content)