def _from_docstring_md(doc):
def format_fn(line, status):<EOL><INDENT>"""<STR_LIT>"""<EOL>def fix_tags(line):<EOL><INDENT>def fn(match):<EOL><INDENT>found = match.group(<NUM_LIT:1>)<EOL>if found == "<STR_LIT:<>":<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT>if found == "<STR_LIT:>>":<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT>if found == "<STR_LIT:&>":<EOL><INDENT>return "<STR_LIT>"<EOL><DEDENT>return match.group(<NUM_LIT:0>)<EOL><DEDENT>return re_from_tag.sub(fn, line)<EOL><DEDENT>if re_from_data.match(line):<EOL><INDENT>line = re_from_data.sub(r"<STR_LIT>", line)<EOL>status["<STR_LIT>"] = True<EOL><DEDENT>line = re_from_defaults.sub(r"<STR_LIT>", line)<EOL>if status["<STR_LIT>"]:<EOL><INDENT>if re_from_param.match(line):<EOL><INDENT>m = re_from_param.match(line)<EOL>line = "<STR_LIT>".format(m.group(<NUM_LIT:1>), fix_tags(m.group(<NUM_LIT:3>)))<EOL><DEDENT>elif re_from_status.match(line):<EOL><INDENT>m = re_from_status.match(line)<EOL>line = "<STR_LIT>".format(m.group(<NUM_LIT:1>), fix_tags(m.group(<NUM_LIT:3>)))<EOL><DEDENT>elif re_from_item.match(line):<EOL><INDENT>line = re_from_item.sub(r"<STR_LIT>", fix_tags(line))<EOL><DEDENT>else:<EOL><INDENT>line = fix_tags(line)<EOL>line = "<STR_LIT:U+0020>" * <NUM_LIT:4> + line.lstrip()<EOL><DEDENT><DEDENT>else:<EOL><INDENT>line = fix_tags(line)<EOL><DEDENT>return line<EOL><DEDENT>return _reformat_docstring(doc, format_fn, code_newline="<STR_LIT:\n>")<EOL>
format from docstring to Markdown