Files
group_xinghuo_jinrong/docs/course/build_all.py
T
zhanghongyu_0626 6f222f1c56 feat(course): Add course assembly script and module structure for advisor training
- Introduced `build_all.py` script to automate the assembly of course modules into a single `index.html` file.
- Created `index.html` for the main course overview, featuring a structured layout and navigation for various modules.
- Developed `_base.html` and `_footer.html` templates for the advisor module, ensuring consistent styling and structure.
- Added `build.sh` script for individual module assembly, enhancing modularity and ease of updates.
- Implemented multiple module HTML files detailing specific training scenarios and functionalities for advisors, including interactive elements and quizzes.

This update significantly enhances the course delivery framework, providing a comprehensive and interactive learning experience for advisors.
2026-09-09 23:22:59 +08:00

20 lines
692 B
Python

#!/usr/bin/env python3
"""Assemble all module courses from _base + modules/*.html → index.html"""
from pathlib import Path
ROOT = Path(__file__).parent
def build(course_dir: Path) -> None:
parts = [course_dir / "_base.html"]
parts.extend(sorted((course_dir / "modules").glob("*.html")))
parts.append(course_dir / "_footer.html")
out = "".join(p.read_text(encoding="utf-8") for p in parts)
(course_dir / "index.html").write_text(out, encoding="utf-8")
print(f"Built {course_dir.name}/index.html")
if __name__ == "__main__":
for d in sorted(ROOT.glob("jinrong-*")):
if d.is_dir() and (d / "_base.html").exists():
build(d)
print("Done.")