Skip to content

Commit b5938fa

Browse files
committed
build: exclude generated markdown from git, update CI/CD docs
- Update .gitignore to exclude docs/mindmaps/*.md (rule-based) - Update CI/CD to generate both Markdown and HTML mindmaps - Remove 9 generated markdown files from git tracking - Update docs/GITHUB_PAGES_SETUP.md with: - New workflow configuration - Version control summary table - Updated directory structure - Complete workflow diagram Rule-based files are now fully generated by CI/CD. Only AI-generated and manual files remain in version control.
1 parent b15d03c commit b5938fa

13 files changed

+147
-1099
lines changed

.github/workflows/deploy-pages.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,9 @@ jobs:
4040
run: |
4141
pip install -r requirements.txt
4242
43-
- name: Generate Mind Maps (HTML)
43+
- name: Generate Mind Maps (Markdown + HTML)
4444
run: |
45+
python tools/generate_mindmaps.py
4546
python tools/generate_mindmaps.py --html
4647
4748
- name: Build MkDocs site

.gitignore

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,19 @@ Thumbs.db
4545
# MkDocs build output
4646
site/
4747

48-
# Generated HTML mindmaps (use --html to regenerate)
49-
# Ignore all files in docs/pages/ except AI mindmaps
48+
# Generated mindmaps (regenerated by CI/CD)
49+
# ============================================
50+
# Rule-based mindmaps are generated from ontology data
51+
# Only AI-generated mindmaps are tracked (require API key, have cost)
52+
53+
# Ignore generated HTML mindmaps
5054
docs/pages/**
51-
# But track AI-generated mindmaps (manually generated and committed)
5255
!docs/pages/mindmaps/
5356
!docs/pages/mindmaps/neetcode_ontology_ai_*.html
54-
# Track AI mindmap Markdown files
57+
58+
# Ignore generated Markdown mindmaps
59+
docs/mindmaps/*.md
60+
!docs/mindmaps/index.md
61+
!docs/mindmaps/README.md
5562
!docs/mindmaps/neetcode_ontology_ai_*.md
5663

docs/GITHUB_PAGES_SETUP.md

Lines changed: 68 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,37 @@ This guide explains how to deploy mind maps to GitHub Pages with full interactiv
3131
neetcode/
3232
├── docs/
3333
│ ├── mindmaps/
34-
│ │ ├── index.md # Mind map index
35-
│ │ ├── pattern_hierarchy.md # Static Markdown version
36-
│ │ ├── algorithm_usage.md
34+
│ │ ├── index.md # Mind map index (tracked)
35+
│ │ ├── README.md # Documentation (tracked)
36+
│ │ ├── neetcode_ontology_ai_*.md # AI mind maps (tracked)
37+
│ │ ├── pattern_hierarchy.md # Rule-based (gitignored, CI/CD generates)
38+
│ │ ├── algorithm_usage.md # Rule-based (gitignored, CI/CD generates)
3739
│ │ └── ...
3840
│ │
39-
│ ├── pages/ # 🆕 GitHub Pages root (gitignored)
40-
│ │ ├── mindmaps/ # Interactive HTML mind maps
41-
│ │ │ ├── pattern_hierarchy.html
41+
│ ├── pages/ # GitHub Pages root (mostly gitignored)
42+
│ │ ├── mindmaps/
43+
│ │ │ ├── neetcode_ontology_ai_*.html # AI (tracked)
44+
│ │ │ ├── pattern_hierarchy.html # Rule-based (gitignored)
4245
│ │ │ └── ...
43-
│ │ └── ...
46+
│ │ └── assets/ # Shared assets (gitignored)
4447
│ │
4548
│ ├── stylesheets/ # Custom CSS
4649
│ ├── index.md # Homepage (includes README.md)
4750
│ ├── index_zh-TW.md # Homepage (Traditional Chinese)
48-
│ └── GITHUB_PAGES_SETUP.md # This file
51+
│ └── GITHUB_PAGES_SETUP.md # This file
4952
5053
├── tools/
5154
│ ├── generate_mindmaps.py # Generate from ontology
55+
│ ├── generate_mindmaps_ai.py # AI mind map generator
5256
│ ├── text_to_mindmap.py # Generate from any text
5357
│ └── generate_mindmaps.toml # Configuration
5458
5559
├── .github/
5660
│ └── workflows/
57-
│ └── deploy-pages.yml # 🆕 Auto deployment
61+
│ └── deploy-pages.yml # Auto deployment workflow
5862
5963
├── mkdocs.yml # MkDocs configuration
60-
└── site/ # 🆕 MkDocs build output (gitignored)
64+
└── site/ # MkDocs build output (gitignored)
6165
```
6266

6367
---
@@ -102,7 +106,9 @@ python tools/generate_mindmaps.py --html
102106
python tools/generate_mindmaps.py --html --autoloader
103107
```
104108

105-
**Note:** Generated HTML files are saved to `docs/pages/mindmaps/` (gitignored).
109+
**Note:** Generated files are gitignored and regenerated by CI/CD:
110+
- Markdown: `docs/mindmaps/*.md` (except `index.md`, `README.md`, AI files)
111+
- HTML: `docs/pages/mindmaps/*.html` (except AI files)
106112

107113
---
108114

@@ -287,17 +293,17 @@ The `.github/workflows/deploy-pages.yml` file handles automatic deployment:
287293

288294
```yaml
289295
# .github/workflows/deploy-pages.yml
290-
name: Deploy Documentation to GitHub Pages
296+
name: Deploy Documentation
291297

292298
on:
293299
push:
294300
branches: [main]
295301
paths:
296302
- 'docs/**'
297-
- 'mkdocs.yml'
298-
- 'requirements.txt'
299303
- 'ontology/**'
300304
- 'meta/**'
305+
- 'tools/generate_mindmaps.py'
306+
- 'mkdocs.yml'
301307
workflow_dispatch: # Allow manual trigger
302308

303309
permissions:
@@ -324,15 +330,22 @@ jobs:
324330
- name: Install dependencies
325331
run: pip install -r requirements.txt
326332

327-
- name: Generate rule-based mind maps
328-
run: python tools/generate_mindmaps.py --html
333+
- name: Generate Mind Maps (Markdown + HTML)
334+
run: |
335+
python tools/generate_mindmaps.py # Generate Markdown
336+
python tools/generate_mindmaps.py --html # Generate HTML
329337
330338
# Note: AI mindmaps are NOT generated in CI/CD
331339
# They must be manually generated and committed to the repository
332340
# See Step 3.2 for manual generation instructions
333341

334342
- name: Build MkDocs site
335-
run: python -m mkdocs build
343+
run: mkdocs build
344+
345+
- name: Copy mind map HTML files
346+
run: |
347+
cp -r docs/pages/mindmaps site/pages/mindmaps
348+
cp -r docs/pages/assets site/pages/assets 2>/dev/null || true
336349
337350
- name: Setup Pages
338351
uses: actions/configure-pages@v4
@@ -354,6 +367,17 @@ jobs:
354367
uses: actions/deploy-pages@v4
355368
```
356369
370+
### 4.2 What CI/CD Generates
371+
372+
| File Type | Generated By | Tracked in Git |
373+
|-----------|--------------|----------------|
374+
| `docs/mindmaps/*.md` (rule-based) | CI/CD | ❌ No |
375+
| `docs/pages/mindmaps/*.html` (rule-based) | CI/CD | ❌ No |
376+
| `docs/mindmaps/neetcode_ontology_ai_*.md` | Manual | ✅ Yes |
377+
| `docs/pages/mindmaps/neetcode_ontology_ai_*.html` | Manual | ✅ Yes |
378+
| `docs/mindmaps/index.md` | Manual | ✅ Yes |
379+
| `docs/mindmaps/README.md` | Manual | ✅ Yes |
380+
357381
---
358382

359383
## Step 5: Enable GitHub Pages
@@ -414,17 +438,24 @@ The README.md already includes links to interactive mind maps:
414438
415439
3. GitHub Actions automatically triggers
416440
417-
4. Generate rule-based mind maps (Markdown + HTML)
418-
python tools/generate_mindmaps.py --html
441+
4. Generate rule-based mind maps
442+
python tools/generate_mindmaps.py # Markdown
443+
python tools/generate_mindmaps.py --html # HTML
419444
420445
5. Build MkDocs site
421-
python -m mkdocs build
446+
mkdocs build
422447
423-
6. Deploy to GitHub Pages
448+
6. Copy HTML files to site/
449+
cp -r docs/pages/mindmaps site/pages/mindmaps
424450
425-
7. Visit https://yourusername.github.io/neetcode/
451+
7. Deploy to GitHub Pages
452+
453+
8. Visit https://lufftw.github.io/neetcode/
426454
```
427455
456+
> **Note**: Rule-based Markdown files (`docs/mindmaps/*.md`) are NOT tracked in Git.
457+
> They are generated fresh by CI/CD on every deployment.
458+
428459
### AI-Powered Mind Maps (Manual Process)
429460
430461
```
@@ -530,7 +561,20 @@ Both are gitignored and regenerated on build/deploy.
530561

531562
## 📝 Notes
532563

533-
- **Local Development**: Always test locally with `python -m mkdocs build` and `python -m mkdocs serve` before pushing
564+
- **Local Development**: Always test locally with `mkdocs build` and `mkdocs serve` before pushing
534565
- **Build Output**: The `site/` directory contains the complete MkDocs site and is gitignored
535-
- **Mind Maps**: HTML mind maps are generated to `docs/pages/mindmaps/` and are also gitignored
566+
- **Generated Files**: Both Markdown (`docs/mindmaps/*.md`) and HTML (`docs/pages/mindmaps/*.html`) mind maps are gitignored (except AI and manual files)
536567
- **Auto Deployment**: GitHub Actions handles generation, building, and deployment automatically
568+
- **AI Mind Maps**: Must be generated manually and committed (require API key, not in CI/CD)
569+
570+
### Version Control Summary
571+
572+
| File | Tracked | Reason |
573+
|------|---------|--------|
574+
| `docs/mindmaps/index.md` || Manual index page |
575+
| `docs/mindmaps/README.md` || Manual documentation |
576+
| `docs/mindmaps/neetcode_ontology_ai_*.md` || AI generated (costly) |
577+
| `docs/mindmaps/*.md` (others) || CI/CD generates |
578+
| `docs/pages/mindmaps/neetcode_ontology_ai_*.html` || AI generated (costly) |
579+
| `docs/pages/mindmaps/*.html` (others) || CI/CD generates |
580+
| `site/` || MkDocs build output |

docs/mindmaps/README.md

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
---
2+
title: NeetCode Mind Maps Index
3+
markmap:
4+
colorFreezeLevel: 2
5+
maxWidth: 400
6+
---
7+
8+
# Mind Maps Index
9+
10+
Visual mind maps of the NeetCode ontology and problem relationships.
11+
Use [markmap](https://markmap.js.org/) VSCode extension or web viewer.
12+
13+
## Available Mind Maps
14+
15+
### [📐 Pattern Hierarchy](pattern_hierarchy.md)
16+
17+
API Kernels → Patterns → Problems hierarchy
18+
19+
### [👨‍👩‍👧‍👦 Family Derivation](family_derivation.md)
20+
21+
Base templates and derived problem variants
22+
23+
### [⚡ Algorithm Usage](algorithm_usage.md)
24+
25+
Which algorithms are used in which problems
26+
27+
### [🏗️ Data Structure Usage](data_structure.md)
28+
29+
Data structures used across problems
30+
31+
### [🏢 Company Coverage](company_coverage.md)
32+
33+
Problems frequently asked by companies
34+
35+
### [🗺️ Learning Roadmaps](roadmap_paths.md)
36+
37+
Learning roadmap structures
38+
39+
### [🔗 Problem Relations](problem_relations.md)
40+
41+
Related problems network
42+
43+
### [🔀 Solution Variants](solution_variants.md)
44+
45+
Problems with multiple solution approaches
46+
47+
### [📊 Difficulty × Topics](difficulty_topics.md)
48+
49+
Topics organized by difficulty level
50+
51+
---
52+
53+
## How to View
54+
55+
### Option 1: VSCode Extension
56+
1. Install [markmap](https://marketplace.visualstudio.com/items?itemName=gera2ld.markmap-vscode)
57+
2. Open any `.md` file
58+
3. Click the markmap icon
59+
60+
### Option 2: Web Viewer
61+
1. Go to [markmap.js.org](https://markmap.js.org/repl)
62+
2. Paste the markdown content
63+
64+
---
65+
66+
*Auto-generated by `tools/generate_mindmaps.py`*

docs/mindmaps/algorithm_usage.md

Lines changed: 0 additions & 49 deletions
This file was deleted.

0 commit comments

Comments
 (0)