chore: 将网页入口迁移至项目根目录
This commit is contained in:
1 parent
f1e45178d2
commit
c8642ede02
5 files changed
+29
-8
No files matched your search
@@ -13,7 +13,8 @@ from html.parser import HTMLParser
|
||||
from pathlib import Path
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[1]
|
||||
OUTPUT = ROOT / "outputs/index.html"
|
||||
OUTPUT = ROOT / "index.html"
|
||||
MATERIAL_OUTPUT = ROOT / "outputs/培训练习材料.zip"
|
||||
|
||||
|
||||
class Markup(HTMLParser):
|
||||
@@ -156,7 +157,8 @@ def main():
|
||||
temp = args.output.with_suffix(".html.tmp")
|
||||
temp.write_text(result, encoding="utf-8")
|
||||
temp.replace(args.output)
|
||||
(args.output.parent / "培训练习材料.zip").write_bytes(material)
|
||||
MATERIAL_OUTPUT.parent.mkdir(parents=True, exist_ok=True)
|
||||
MATERIAL_OUTPUT.write_bytes(material)
|
||||
print(f"已生成 {count} 页:{args.output}")
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user