minor changes in format of DIRECTORY.md (#1461)

This commit is contained in:
Ankur Chattopadhyay
2019-10-25 23:03:24 +05:30
committed by Christian Clauss
parent 3ea0992dc7
commit a61b05b10c
2 changed files with 446 additions and 409 deletions

View File

@ -17,7 +17,7 @@ def good_filepaths(top_dir: str = ".") -> Iterator[str]:
def md_prefix(i):
return f"{i * ' '}*" if i else "##"
return f"{i * ' '}*" if i else "\n##"
def print_path(old_path: str, new_path: str) -> str:
@ -37,7 +37,7 @@ def print_directory_md(top_dir: str = ".") -> None:
old_path = print_path(old_path, filepath)
indent = (filepath.count(os.sep) + 1) if filepath else 0
url = "/".join((URL_BASE, filepath, filename)).replace(" ", "%20")
filename = os.path.splitext(filename.replace("_", " "))[0]
filename = os.path.splitext(filename.replace("_", " ").title())[0]
print(f"{md_prefix(indent)} [{filename}]({url})")