code: def read_rst_and_process(fname, line_process=lambda line: line):
    
    with open(fname, "r") as f:
      data = f.read().splitlines()
    first_idx = next(idx for idx, line in enumerate(data) if line.strip())
    if data[first_idx].strip() == "..":
      next_idx = first_idx + 1
      first_idx = next(idx for idx, line in enumerate(data[next_idx:], next_idx)
                           if line.strip() and not line.startswith(" "))
    return "\n".join(map(line_process, data[first_idx:]))
docs: The reStructuredText string in file ``fname``, without the starting ``..``
    comment and with ``line_process`` function applied to every line.