(top_dir: str = ".")
| 43 | |
| 44 | |
| 45 | def print_directory_md(top_dir: str = ".") -> None: |
| 46 | old_path = "" |
| 47 | for filepath in sorted(good_file_paths(top_dir)): |
| 48 | filepath, filename = os.path.split(filepath) |
| 49 | if filepath != old_path: |
| 50 | old_path = print_path(old_path, filepath) |
| 51 | indent = (filepath.count(os.sep) + 1) if filepath else 0 |
| 52 | url = f"{filepath}/{filename}".replace(" ", "%20") |
| 53 | filename = os.path.splitext(filename.replace("_", " ").title())[0] |
| 54 | print(f"{md_prefix(indent)} [{filename}]({url})") |
| 55 | |
| 56 | |
| 57 | if __name__ == "__main__": |
no test coverage detected