Skip to content

Commit

Permalink
Create generate_markdown_list.py
Browse files Browse the repository at this point in the history
  • Loading branch information
diegovelezg authored Jul 3, 2024
1 parent f94775b commit 3baca7f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions generate_markdown_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import os
import yaml
import json
import pandas as pd

repo_path = '.'

markdown_files = []

for root, dirs, files in os.walk(repo_path):
for file in files:
if file.endswith('.md'):
full_path = os.path.join(root, file)
relative_path = os.path.relpath(full_path, repo_path)
markdown_files.append(relative_path)

with open('markdown_files.yaml', 'w') as yaml_file:
yaml.dump(markdown_files, yaml_file)

with open('markdown_files.json', 'w') as json_file:
json.dump(markdown_files, json_file, indent=4)

df = pd.DataFrame(markdown_files, columns=['Path'])
df.to_csv('markdown_files.csv', index=False)

0 comments on commit 3baca7f

Please sign in to comment.