<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_md_file(string, filename, out_path="."):
 """Import a module path and create an api doc from it Args: string (str):
 string with line breaks to write to file. filename (str):
 filename without the .md out_path (str):
 The output directory """

    md_file = "%s.md" % filename
    with open(os.path.join(out_path, md_file), "w") as f:
        f.write(string)
    print("wrote {}.".format(md_file))