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 @@ -199,14 +199,17 @@ def parse_cli_markdown(file_path):
199
199
200
200
def recursive_parse_directory (root_dir ):
201
201
""" Recursively parses all markdown files in the directory. """
202
- for dirpath , dirnames , filenames in os .walk (root_dir ):
202
+ paths = []
203
+ for dirpath , _dirnames , filenames in os .walk (root_dir ):
203
204
for filename in filenames :
204
- if filename .lower ().endswith ('.md' ) or filename .lower ().endswith ('.mdx' ):
205
- file_path = os .path .join (dirpath , filename )
206
- if 'cli' in dirpath .lower () or 'cli' in filename .lower ():
207
- parse_cli_markdown (file_path )
208
- else :
209
- parse_markdown_file_to_json (file_path )
205
+ lower_filename = filename .lower ()
206
+ if lower_filename .endswith ('.md' ) or lower_filename .endswith ('.mdx' ):
207
+ paths .append (os .path .join (dirpath , filename ))
208
+ for file_path in paths :
209
+ if 'cli' in dirpath .lower () or 'cli' in filename .lower ():
210
+ parse_cli_markdown (file_path )
211
+ else :
212
+ parse_markdown_file_to_json (file_path )
210
213
211
214
if __name__ == "__main__" :
212
215
setup_repositories ()
You can’t perform that action at this time.
0 commit comments