Skip to content

update: quick update md #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 6, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ node tools/update-frontmatter.js
node tools/update-frontmatter.js algorithms/sorting-algorithms.md
```

#### Generating Table of Contents

The `generate_summary.py` script automatically creates the SUMMARY.md file:

```bash
# Run the script to generate a new table of contents
python tools/generate_summary.py
```

For more information about available tools, see the [Tools README](tools/README.md).

## 🤝 Contribution
Expand Down
9 changes: 9 additions & 0 deletions README_vi.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ node tools/update-frontmatter.js
node tools/update-frontmatter.js algorithms/sorting-algorithms.md
```

#### Tạo mục lục tự động

Script `generate_summary.py` tự động tạo file SUMMARY.md:

```bash
# Chạy script để tạo mục lục mới
python tools/generate_summary.py
```

Để biết thêm thông tin về các công cụ có sẵn, hãy xem [README của Tools](tools/README.md).

## 🤝 Đóng góp
Expand Down
1 change: 1 addition & 0 deletions SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Algorithms

- [Graph Traversal Algorithms](docs/algorithms/graph-traversal.md)
- [Sorting Algorithms](docs/algorithms/sorting-algorithms.md)

### Databases

Expand Down
34 changes: 33 additions & 1 deletion tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ A Node.js script that automatically updates the frontmatter (metadata) in all Ma

```bash
# Install dependencies if not already installed
npm install gray-matter glob
npm install

# Make the script executable
chmod +x tools/update-frontmatter.js
Expand All @@ -55,6 +55,38 @@ node tools/update-frontmatter.js algorithms/sorting-algorithms.md
# - /i18n/vi/algorithms/sorting-algorithms.md
```

### `generate_summary.py`

A Python script that automatically generates the `SUMMARY.md` file by scanning the `docs/` directory structure.

#### Features

- Creates a well-structured table of contents
- Extracts titles from Markdown files when available
- Organizes content by categories based on directory structure
- Generates clean, formatted links to all documentation files

#### Requirements

- Python 3.6+
- No external dependencies (uses only standard library)

#### Usage

```bash
# Make the script executable (first time only)
chmod +x tools/generate_summary.py

# Run the script to generate SUMMARY.md
python tools/generate_summary.py
```

The script will:
1. Scan all directories in `/docs`
2. Extract titles from Markdown files or generate them from filenames
3. Create a hierarchical table of contents
4. Write the result to `SUMMARY.md` in the project root

#### Automation

This script is configured to run automatically via GitHub Actions when:
Expand Down