def METHOD_NAME(folder):
    print(f"[*] Applying transforms to {folder}")
    # links_dict = {}
    for root, dirname, filenames in os.walk(folder):
        if len(filenames):
            files = Path(root).glob('*.md')
            for file in files:
                file_text = file.read_text()
                links = extract_markdown_links(file_text)
                # relative_path = file.relative_to(".").as_posix()
                # links_dict[relative_path] = [link.__dict__ for link in links if link.external is False]
                internal_links = []
                external_links = []
                new_text = file_text  # start with the original file text
                for link in links:
                    if link.external is False:
                        new_text = new_text.replace(link.raw, link.raw_new)
                        internal_links.append(link.raw_new)
                    else:
                        external_links.append(link.raw)
                resources_section = ""
                if len(internal_links) > 0:
                    internal_links = sorted(list(set(internal_links)))
                    # add - to each link
                    internal_links = [f"- {link}" for link in internal_links]
                    internal_links_text = "\n".join(internal_links)
                    internal_links_text = f"\n\n### Internal\n\n{internal_links_text}"
                    resources_section += internal_links_text
                # if len(external_links) > 0:
                #     external_links = sorted(list(set(external_links)))
                #     # add - to each link
                #     external_links = [f"- {link}" for link in external_links]
                #     external_links_text = "\n".join(external_links)
                #     external_links_text = f"\n\n### External\n\n{external_links_text}"
                #     resources_section += external_links_text
                if resources_section != "":
                    new_text += "\n## Resources" + resources_section + "\n"
                file.write_text(new_text) 