- 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.
20 lines
692 B
Python
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.")
|