|
|
@ -1,4 +1,5 @@
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
|
|
|
|
import os
|
|
|
|
import time
|
|
|
|
import time
|
|
|
|
import uuid
|
|
|
|
import uuid
|
|
|
|
from typing import Iterator, Optional
|
|
|
|
from typing import Iterator, Optional
|
|
|
@ -8,6 +9,7 @@ from dashscope import Generation
|
|
|
|
from dashscope.api_entities.dashscope_response import DashScopeAPIResponse
|
|
|
|
from dashscope.api_entities.dashscope_response import DashScopeAPIResponse
|
|
|
|
from D_Config import *
|
|
|
|
from D_Config import *
|
|
|
|
from D2_MarkdownToPptx import *
|
|
|
|
from D2_MarkdownToPptx import *
|
|
|
|
|
|
|
|
from D3_MarkdownToDocx import *
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class MarkdownGenerator:
|
|
|
|
class MarkdownGenerator:
|
|
|
@ -152,3 +154,12 @@ if __name__ == "__main__":
|
|
|
|
print(f"PPT生成成功!保存路径:{OUTPUT_PATH}")
|
|
|
|
print(f"PPT生成成功!保存路径:{OUTPUT_PATH}")
|
|
|
|
|
|
|
|
|
|
|
|
# 生成 DOCX
|
|
|
|
# 生成 DOCX
|
|
|
|
|
|
|
|
OUTPUT_DOCX = r"D:\dsWork\QingLong\output5.docx"
|
|
|
|
|
|
|
|
convert_md_to_docx(
|
|
|
|
|
|
|
|
input_md=FIXED_MD_PATH,
|
|
|
|
|
|
|
|
output_docx=OUTPUT_DOCX,
|
|
|
|
|
|
|
|
reference_template=r"D:\dsWork\QingLong\AI\left-aligned-template.docx"
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
print(f"DOCX生成成功!保存路径:{OUTPUT_DOCX}")
|
|
|
|
|
|
|
|
# 删除FIXED_MD_PATH
|
|
|
|
|
|
|
|
os.remove(FIXED_MD_PATH)
|
|
|
|