lesson_plan.py 使用说明
简介
lesson_plan.py 是一个用于将 Markdown 文件转换为格式化 Word 文档(.docx)的 Python 脚本。它主要用于生成教学教案文档,支持从 Markdown 文件中提取内容并按照预定义的模板格式化输出。
功能
- 从 Markdown 文件中提取内容。
- 将提取的内容填充到 Word 文档模板中。
- 支持自定义输出文件名。
- 支持复杂的表格格式,包括单元格合并、字体样式、背景颜色等。
依赖库
python-docx: 用于创建和修改 Word 文档。re: 用于正则表达式操作。
使用方法
- 准备一个 Markdown 文件,文件名格式为
ja_{number}.md,其中{number}是一个数字。 - 准备一个 Word 文档模板
lesson_template.docx。 - 运行脚本:
python lesson_plan.py
输入文件结构
Markdown 文件应包含以下部分:
- 项目名称
- 授课类型
- 授课周次
- 授课学时
- 知识目标
- 能力目标
- 素质目标
- 学情分析
- 教学重点
- 教学难点
- 教学方法
- 教材资源
- 课前:教学内容
- 课前:学生活动
- 课前:教师活动
- 课前:设计意图
- 项目导入:教学内容
- 项目导入:学生活动
- 项目导入:教师活动
- 项目导入:设计意图
- 内容展开:教学内容
- 内容展开:学生活动
- 内容展开:教师活动
- 内容展开:设计意图
- 课堂小结:教学内容
- 课堂小结:学生活动
- 课堂小结:教师活动
- 课堂小结:设计意图
- 课后:教学内容
- 课后:学生活动
- 课后:教师活动
- 课后:设计意图
- 教学反思:教学效果
- 教学反思:诊断
- 教学反思:改进
输出文件
生成的 Word 文档将保存在当前目录下,文件名格式为 {number}-{project_name}-教案.docx,其中 {number} 是从 Markdown 文件名中提取的编号,{project_name} 是从 Markdown 文件中提取的项目名称。
注意事项
- 确保 Markdown 文件和 Word 模板文件路径正确。
- 确保 Markdown 文件内容格式正确,避免解析错误。
- 脚本中使用了复杂的表格格式化功能,确保
python-docx版本支持这些功能。
作者
Yongshun Song
许可证
MIT License
Metadata
Release files for ciit-lesson-plan 0.2.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| ciit_lesson_plan-0.2.2.tar.gz | 10.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ciit_lesson_plan-0.2.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.0 kB
Release files / ciit_lesson_plan-0.2.2.tar.gz
| Download URL | ciit_lesson_plan-0.2.2.tar.gz |
|---|---|
| Size | 10.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ffbe217a61767e2c8f7909d99e947b5532ba377029dd3df4c315c570367bc1e8
|
|
BLAKE2b-256 checksum How to use checksums |
eba63ac03b974960a51e91e9abcabdfce8ea766c5182d5c1e80c55b4207f825d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / ciit_lesson_plan-0.2.2-py3-none-any.whl
| Download URL | ciit_lesson_plan-0.2.2-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ca95b1d60e6563a9865cfd9f3d1f541752bc34e1c76c169469044da5b7868ddc
|
|
BLAKE2b-256 checksum How to use checksums |
df36a1bcfe3b8be300028ac6aa8c1ee1903e1235c8b9ffadc1ceb5a23edbbf59
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Security for ciit-lesson-plan 0.2.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.