def METHOD_NAME(path, origpath, extra, outpath):
    title = title_from_path(path, origpath, extra)
    rstfn = rstfn_from_title(title, outpath)
    print(f"Creating {rstfn} from {path}")
    with open(rstfn, "w") as rstfile:
        heading = title_to_heading(title)
        rstfile.write(f"{heading}\n{'=' * len(heading)}\n")
        output_readme(rstfile, path)
        rstfile.write(".. code-block:: python\n")
        rstfile.write("    :linenos:\n\n")
        with open(path, "r") as pyfile:
            for line in pyfile.read().split('\n'):
                rstfile.write(f"    {line}\n")