You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
1.2 KiB
29 lines
1.2 KiB
from pptx.dml.color import RGBColor
|
|
|
|
from run import default
|
|
# 模板配置
|
|
model_dict = {
|
|
# 对于通用模板的相关配置,其它的模板未进行正确配置
|
|
"通用": {
|
|
'model_name': 'default-model', # 模板名称
|
|
'other_rgb': RGBColor(208, 206, 206), # 默认的文字颜色
|
|
'current_rgb': RGBColor(66, 85, 108), # 当前的文字颜色
|
|
'content_number_rgb': RGBColor(255, 255, 255), # 内容序号的颜色
|
|
'second_title_rgb': RGBColor(66, 85, 108) # 二级标题的颜色
|
|
}
|
|
}
|
|
|
|
|
|
# 开始生成ppt
|
|
def generate(model_name, out_file_path, md_file_path):
|
|
default.gen_ppt_default(model_dict[model_name]['model_name'], # 模板名称
|
|
out_file_path, # 输出文件路径
|
|
md_file_path, # md文件路径
|
|
'.', # 项目路径
|
|
model_dict[model_name]['other_rgb'], # 默认文字颜色
|
|
model_dict[model_name]['current_rgb'], # 当前文字颜色
|
|
model_dict[model_name]['content_number_rgb'], # 内容序号的颜色
|
|
model_dict[model_name]['second_title_rgb']) # 二级标题的颜色
|
|
|
|
|