code: def convert_md_to_rst(md_path, rst_temp_path):
      
      # Pandoc uses the UTF-8 character encoding for both input and output.
      command = "pandoc --write=rst --output=%s %s" % (rst_temp_path, md_path)
      print("converting with pandoc: %s to %s\n-->%s" % (md_path, rst_temp_path,
                                                         command))
  
      if os.path.exists(rst_temp_path):
          os.remove(rst_temp_path)
  
      os.system(command)
  
      if not os.path.exists(rst_temp_path):
          s = ("Error running: %s\n"
               "  Did you install pandoc per the %s docstring?" % (command,
                                                                   __file__))
          sys.exit(s)
  
      return read(rst_temp_path)
docs: Convert the contents of a file from Markdown to reStructuredText.
  
      Returns the converted text as a Unicode string.
  
      Arguments:
  
        md_path: a path to a UTF-8 encoded Markdown file to convert.
  
        rst_temp_path: a temporary path to which to write the converted contents.