docs: def process_output(meta_file, outfile_name, code_links):
      '''Create a markdown format documentation file.
  
      Args:
          meta_file (dict): Dictionary with documentation metadata.
          outfile_name (str): Markdown file to write to.
      '''
  
      # Markdown title line
      doc_str = '# ' + meta_file['header'] + '\n'
      doc_str += 'Generated by [py2md](https://github.com/gbowerman/py2md) on '
      doc_str += strftime("%Y-%m-%d %H:%M:%S ") + '\n\n'
  
      # Create a table of contents if more than one module (i.e. more than one
      # source file)
      if len(meta_file['modules']) > 1:
          doc_str += "## Contents\n"
          chapter_num = 1
          for meta_doc in meta_file['modules']:
              chapter_name = meta_doc['summary_comment']
              chapter_link = chapter_name.lstrip().replace('.', '').replace(' ', '-').lower()
              doc_str += str(chapter_num) + \
                  '. [' + chapter_name + '](#' + chapter_link + ')\n'
              chapter_num += 1
  
  
      # Document each meta-file
      for meta_doc in meta_file['modules']:
          doc_str += '## ' + meta_doc['summary_comment'] + '\n'
          doc_str += '[source file](' + meta_doc['source_file'] + ')' + '\n'
          for function_info in meta_doc['functions']:
              doc_str += '### ' + function_info['name'] + '\n'
              doc_str += function_info['definition'] + '\n\n'
              if 'comments' in function_info:
                  doc_str += '```\n' + function_info['comments'] + '\n```\n\n'
  
      # write the markdown to file
      print('Writing file: ' + outfile_name)
      out_file = open(outfile_name, 'w')
      out_file.write(doc_str)
      out_file.close()