Skip to content
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
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
docs/
docs/
__pycache__/
14 changes: 14 additions & 0 deletions 02-专业基础课/数字系统设计实验/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
## 一、课程内容
待补充

## 二、考核方式
待补充

## 三、修读攻略
202X级XXX:

- 待补充
- 待补充

## 四、注意事项
待补充
26 changes: 26 additions & 0 deletions hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pathlib import PurePosixPath


def on_files(files, config):
for file in files:
src_uri = file.src_uri

# docs/index.md 在 MkDocs 内部通常表现为 index.md
# 目标:/edit/main/README.md
if src_uri == "index.md":
file.edit_uri = "README.md"
continue

path = PurePosixPath(src_uri)

# 生成页:
# 01-基础必修课/C++编程基础.md
#
# 原始源文件:
# 01-基础必修课/C++编程基础/README.md
if path.suffix == ".md" and len(path.parts) >= 2:
course_group = path.parts[0]
course_name = path.stem
file.edit_uri = f"{course_group}/{course_name}/README.md"

return files
6 changes: 5 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
site_name: 华南理工未来技术学院课程攻略
theme: readthedocs
repo_url: https://github.com/OpenFuTech/SCUT-FT-Guide
repo_url: https://github.com/OpenFuTech/SCUT-FT-Guide
edit_uri: edit/main/

hooks:
- hooks.py