-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
FX
committed
Aug 10, 2024
1 parent
792c973
commit 05e4ad4
Showing
2 changed files
with
65 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Directory Structure | ||
|
||
- **[.]** | ||
- help.md | ||
- readme.md | ||
- **[Arrays]** | ||
- Arrays.md | ||
- **[Advanced]** | ||
- readme.md | ||
- **[DataTypes]** | ||
- readme.md | ||
- **[Composite (Non-Primitive) Data Types]** | ||
- readme.md | ||
- **[Primitive Data Types]** | ||
- readme.md | ||
- **[Methods]** | ||
- readme.md | ||
- **[array-methods]** | ||
- usage.md | ||
- **[date-method]** | ||
- usage.md | ||
- **[math-method]** | ||
- usage.md | ||
- **[number-method]** | ||
- usage.md | ||
- **[object-methods]** | ||
- usage.md | ||
- **[promise-method]** | ||
- usage.md | ||
- **[string-methods]** | ||
- course.md | ||
- examples.md | ||
- **[Operators]** | ||
- Operators.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import os | ||
|
||
def generate_directory_structure(directory): | ||
structure = [] | ||
|
||
for root, dirs, files in os.walk(directory): | ||
# Exclude the .git directory | ||
dirs[:] = [d for d in dirs if d != '.git'] | ||
|
||
# Build the directory path | ||
path_parts = root.replace(directory, '').strip(os.sep).split(os.sep) | ||
indent = ' ' * len(path_parts) | ||
if dirs or files: | ||
structure.append(f'{indent}- **[{os.path.basename(root)}]**') | ||
|
||
# Add Markdown files within this directory | ||
for f in files: | ||
if f.endswith('.md'): | ||
file_indent = ' ' * (len(path_parts) + 1) | ||
structure.append(f'{file_indent}- {f}') | ||
|
||
return '\n'.join(structure) | ||
|
||
directory = '.' # Replace with the path to your directory | ||
structure = generate_directory_structure(directory) | ||
output = f'# Directory Structure\n\n{structure}' | ||
|
||
with open('help.md', 'w') as f: | ||
f.write(output) | ||
|
||
print(output) |