From 89e7bfe4ed0ae2dd431f2205b3a5922b2e99e2ee Mon Sep 17 00:00:00 2001 From: diya94 Date: Fri, 1 Aug 2025 21:33:03 +0530 Subject: [PATCH 1/4] Adding doctests for md_prefix function in build_directory_md.py --- scripts/build_directory_md.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/build_directory_md.py b/scripts/build_directory_md.py index aa95b95db4b5..cf981a48a690 100755 --- a/scripts/build_directory_md.py +++ b/scripts/build_directory_md.py @@ -19,6 +19,21 @@ def good_file_paths(top_dir: str = ".") -> Iterator[str]: def md_prefix(i): + """ + Markdown prefix based on level for bullet points + + >>> md_prefix(0) + '\\n##' + + >>> md_prefix(1) + ' *' + + >>> md_prefix(2) + ' *' + + >>> md_prefix(3) + ' *' + """ return f"{i * ' '}*" if i else "\n##" From 155884df3dcaf4f3f7010caa85acc2046d8ca907 Mon Sep 17 00:00:00 2001 From: Maxim Smolskiy Date: Sun, 24 Aug 2025 14:15:52 +0300 Subject: [PATCH 2/4] Update build_directory_md.py --- scripts/build_directory_md.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/scripts/build_directory_md.py b/scripts/build_directory_md.py index cf981a48a690..13060bd1992d 100755 --- a/scripts/build_directory_md.py +++ b/scripts/build_directory_md.py @@ -18,19 +18,16 @@ def good_file_paths(top_dir: str = ".") -> Iterator[str]: yield os.path.join(dir_path, filename).lstrip("./") -def md_prefix(i): +def md_prefix(indent: int) -> str: """ - Markdown prefix based on level for bullet points + Markdown prefix based on indent for bullet points >>> md_prefix(0) '\\n##' - >>> md_prefix(1) ' *' - >>> md_prefix(2) ' *' - >>> md_prefix(3) ' *' """ From 69c92c9a09d8a7bba9c0ff86a14878e9b4528279 Mon Sep 17 00:00:00 2001 From: Maxim Smolskiy Date: Sun, 24 Aug 2025 14:17:05 +0300 Subject: [PATCH 3/4] Update build_directory_md.py --- scripts/build_directory_md.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_directory_md.py b/scripts/build_directory_md.py index 13060bd1992d..ef9a8a625a6b 100755 --- a/scripts/build_directory_md.py +++ b/scripts/build_directory_md.py @@ -31,7 +31,7 @@ def md_prefix(indent: int) -> str: >>> md_prefix(3) ' *' """ - return f"{i * ' '}*" if i else "\n##" + return f"{indent * ' '}*" if i else "\n##" def print_path(old_path: str, new_path: str) -> str: From 6ffa0437a62306063c7d46a3e3816537d4281324 Mon Sep 17 00:00:00 2001 From: Maxim Smolskiy Date: Sun, 24 Aug 2025 14:18:30 +0300 Subject: [PATCH 4/4] Update build_directory_md.py --- scripts/build_directory_md.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build_directory_md.py b/scripts/build_directory_md.py index ef9a8a625a6b..bdad7686c7e3 100755 --- a/scripts/build_directory_md.py +++ b/scripts/build_directory_md.py @@ -31,7 +31,7 @@ def md_prefix(indent: int) -> str: >>> md_prefix(3) ' *' """ - return f"{indent * ' '}*" if i else "\n##" + return f"{indent * ' '}*" if indent else "\n##" def print_path(old_path: str, new_path: str) -> str: