mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-12-19 02:07:27 +08:00
Adding doctest for md_prefix function in build_directory_md.py (#12874)
* Adding doctests for md_prefix function in build_directory_md.py * Update build_directory_md.py * Update build_directory_md.py * Update build_directory_md.py --------- Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
This commit is contained in:
@@ -18,8 +18,20 @@ def good_file_paths(top_dir: str = ".") -> Iterator[str]:
|
||||
yield os.path.join(dir_path, filename).lstrip("./")
|
||||
|
||||
|
||||
def md_prefix(i):
|
||||
return f"{i * ' '}*" if i else "\n##"
|
||||
def md_prefix(indent: int) -> str:
|
||||
"""
|
||||
Markdown prefix based on indent for bullet points
|
||||
|
||||
>>> md_prefix(0)
|
||||
'\\n##'
|
||||
>>> md_prefix(1)
|
||||
' *'
|
||||
>>> md_prefix(2)
|
||||
' *'
|
||||
>>> md_prefix(3)
|
||||
' *'
|
||||
"""
|
||||
return f"{indent * ' '}*" if indent else "\n##"
|
||||
|
||||
|
||||
def print_path(old_path: str, new_path: str) -> str:
|
||||
|
||||
Reference in New Issue
Block a user