File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -200,14 +200,17 @@ def parse_cli_markdown(file_path):
200
200
201
201
def recursive_parse_directory (root_dir ):
202
202
""" Recursively parses all markdown files in the directory. """
203
- for dirpath , dirnames , filenames in os .walk (root_dir ):
203
+ paths = []
204
+ for dirpath , _dirnames , filenames in os .walk (root_dir ):
204
205
for filename in filenames :
205
- if filename .lower ().endswith ('.md' ) or filename .lower ().endswith ('.mdx' ):
206
- file_path = os .path .join (dirpath , filename )
207
- if 'cli' in dirpath .lower () or 'cli' in filename .lower ():
208
- parse_cli_markdown (file_path )
209
- else :
210
- parse_markdown_file_to_json (file_path )
206
+ lower_filename = filename .lower ()
207
+ if lower_filename .endswith ('.md' ) or lower_filename .endswith ('.mdx' ):
208
+ paths .append (os .path .join (dirpath , filename ))
209
+ for file_path in paths :
210
+ if 'cli' in dirpath .lower () or 'cli' in filename .lower ():
211
+ parse_cli_markdown (file_path )
212
+ else :
213
+ parse_markdown_file_to_json (file_path )
211
214
212
215
if __name__ == "__main__" :
213
216
setup_repositories ()
You can’t perform that action at this time.
0 commit comments