code: def get_readme_as_rst(filepath):
      "open the README file and read the markdown as rst"
      try:
          fh = open(filepath)
          name, null = fh.readline().rstrip(), fh.readline()
          tag, null = fh.readline(), fh.readline()
          tag = "%s: %s" % (name, tag)
          split = "-" * (len(tag) - 1) + "\n"
          README = "".join((null, split, tag, split, "\n"))
          skip = False
          for line in fh:
              if line.startswith("["):
                  continue
              elif skip and line.startswith("    http"):
                  README += "\n" + line
              elif line.startswith("* with"):  # XXX: don't indent
                  README += line
              elif line.startswith("* "):
                  README += line.replace("* ", "    - ", 1)
              elif line.startswith("-"):
                  README += line.replace("-", "=") + "\n"
              elif line.startswith("!["):  # image
                  alt, img = line.split("](", 1)
                  if img.startswith("docs"):  # relative path
                      img = img.split("docs/source/", 1)[
                          -1
                      ]  # make is in docs
                  README += ".. image:: " + img.replace(")", "")
                  README += "   :alt: " + alt.replace("![", "") + "\n"
              # elif ')[http' in line: # alt text link (`text <http://url>`_)
              else:
                  README += line
                  skip = line.endswith(":\n")
          fh.close()
      except:
          README = ""
      return README
  
label_desc: Use image node_id 2 for calling a global function with example usage: get_readme_as_rst(filepath) and returns: README