Skip to content

Commit

Permalink
Add front matter comments to documentation files and update index cre…
Browse files Browse the repository at this point in the history
…ation logic
  • Loading branch information
russhustle committed Feb 24, 2025
1 parent 3e0cac7 commit 08538d5
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 6 deletions.
4 changes: 4 additions & 0 deletions docs/blind75/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
---
comments: True
---

# Blind 75
4 changes: 4 additions & 0 deletions docs/company/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
comment: True
---

# Company Wise

- [liquidslr/leetcode-company-wise-problems](https://github.com/liquidslr/leetcode-company-wise-problems)
4 changes: 4 additions & 0 deletions docs/graph_theory/index.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
---
comment: True
---

# Graph Theory

## Resources
Expand Down
4 changes: 4 additions & 0 deletions docs/grind75/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
---
comments: True
---

# Grind 75
4 changes: 4 additions & 0 deletions docs/leetpattern/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
---
comments: True
---

# LeetPattern
4 changes: 4 additions & 0 deletions docs/neetcode150/index.md
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
---
comments: True
---

# Neetcode 150
10 changes: 7 additions & 3 deletions docs/sql50/index.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
---
comment: True
---

# SQL 50

- List: [LeetCode SQL 50](https://leetcode.com/studyplan/top-sql-50/) | [高频 SQL 50 题(基础版)](https://leetcode.cn/studyplan/sql-free-50/)
- YouTube Playlist: [SQL 50 Series by Everyday Data Science](https://youtube.com/playlist?list=PLtfxzVLWb-B-aQ1U1AaOA8LBrCoE-3TX2&si=w6jfUlHL1EZK2ajn)

![inner join](https://www.w3schools.com/sql/img_inner_join.png)

![left join](https://www.w3schools.com/sql/img_left_join.png)

![right join](https://www.w3schools.com/sql/img_right_join.png)

![full join](https://www.w3schools.com/sql/img_full_outer_join.png)

- List: [LeetCode SQL 50](https://leetcode.com/studyplan/top-sql-50/) | [高频 SQL 50 题(基础版)](https://leetcode.cn/studyplan/sql-free-50/)
- YouTube Playlist: [SQL 50 Series by Everyday Data Science](https://youtube.com/playlist?list=PLtfxzVLWb-B-aQ1U1AaOA8LBrCoE-3TX2&si=w6jfUlHL1EZK2ajn)
6 changes: 3 additions & 3 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ def create(config_path: str) -> str:
src = os.path.join("src")
docs = os.path.join("docs")
folder = os.path.join(docs, cfg.dir)
comments = "---\ncomments: True\n---\n\n"
if not os.path.exists(folder):
os.makedirs(folder)
index_md_path = os.path.join(folder, "index.md")
if not os.path.exists(index_md_path):
with open(index_md_path, "w") as f:
f.write(f"# {cfg.name}\n\n")
f.write(comments + f"# {cfg.name}\n\n")

df = pd.read_parquet(os.path.join("utils", "questions.parquet"))

Expand All @@ -56,8 +57,7 @@ def create(config_path: str) -> str:

mkdocs += f" - {topic}: {cfg.dir}/{md_path_name}\n"

content = "---\ncomments: True\n---\n\n"
content += f"# {topic}\n\n"
content = comments + f"# {topic}\n\n"
problems = cfg.topics[topic]

for idx in problems:
Expand Down

0 comments on commit 08538d5

Please sign in to comment.