Skip to content

Commit f451d75

Browse files
committed
feat: 更新PPT生成逻辑,改为并行生成幻灯片并添加统一设计风格指导
1 parent dabd26b commit f451d75

4 files changed

Lines changed: 318 additions & 242 deletions

File tree

app/api/generate-ppt-html/route.ts

Lines changed: 7 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ ${previousSlideInfo}
132132
Ensure strict consistency with the previous slide's design elements.` : ''}
133133
134134
CONTENT SIMPLICITY REQUIREMENTS (CRITICAL):
135+
!!! 如果有箭头线条等,注意使用绝对定位,防止指针偏移!!!
135136
1. **内容简洁性原则**:
136137
- 每页PPT最多包含3-4个核心要点
137138
- 每个要点用1-2句话表达,避免长段落
@@ -161,8 +162,8 @@ HTML STRUCTURE REQUIREMENTS:
161162
162163
3. **内容组织(简洁性优先)**:
163164
- CRITICAL: 内容简洁性原则:
164-
* 每页最多2个要点,避免信息过载
165-
* 每个要点控制在1句话内,突出核心信息
165+
* 避免信息过载
166+
* 突出核心信息
166167
* 使用关键词和短语,避免长段落
167168
* 优先使用图表、图标等视觉元素代替文字
168169
- 图表容器:最大高度300px,确保在分配空间内
@@ -193,49 +194,10 @@ ECHARTS INTEGRATION GUIDE (when data visualization is needed):
193194
- 雷达图: type: 'radar'
194195
6. **静态配置**: Disable all animations by setting animation: false in chart options
195196
196-
LAYOUT TEMPLATE (MUST FOLLOW THIS STRUCTURE):
197-
HTML structure must include:
198-
- body: 1280x720px with overflow:hidden
199-
- .slide-container: full size with flex column layout
200-
- .content-area: full size with 40px padding and flex column
201-
- .main-content: flex:1 for auto-sizing with margin-bottom:20px
202-
- .slide-footer: fixed 40px height for page numbers
203-
204-
205-
206-
EXAMPLE MULTI-SECTION STRUCTURE:
207-
208-
This ensures all content fits within allocated vertical space
209-
210-
CRITICAL OUTPUT REQUIREMENT:
211-
- Generate ONLY the complete HTML code following the above template structure
212-
- Start with <!DOCTYPE html> and end with </html>
213-
- No explanations, comments, or additional text
214-
- DO NOT wrap the output in code blocks (no '''html or ''' markers)
215-
- DO NOT include any markdown formatting or code block syntax
216-
- Output raw HTML code directly without any wrapper syntax
217-
- MUST use the flexbox layout structure and height allocation shown above
218-
- Body and containers MUST be exactly 1280x720px
219-
- Use .main-content with flex flex-col gap-4 for vertical sections
220-
- Use .slide-footer for page numbers (fixed 40px height)
221-
- If content involves data, MUST include ECharts visualization within size limits
222-
- DO NOT use margin-top, use gap spacing instead
223-
- Use RESPONSIVE font sizes based on section height (see above sizing strategy)
224-
- Use ADAPTIVE padding based on section size (p-6 for large, p-4 for medium, p-3 for small)
225-
- CRITICAL: Each section must have FIXED height allocation - no overflow
226-
- CRITICAL: Font sizes must adapt to the available space within each fixed-height section
227-
- CRITICAL: Content must be EXTREMELY CONCISE - maximum 3-4 key points per slide
228-
- CRITICAL: Each text element should be brief and impactful - avoid verbose descriptions
229-
230-
DIRECT MODIFICATION MODE (when existingHtmlCode is provided):
231-
- PRESERVE the overall layout and structure of the existing HTML
232-
- ONLY modify the specific elements mentioned in the modification requirements
233-
- Keep the same color scheme, font styles, and visual design unless specifically requested to change
234-
- Maintain the same container structure and CSS classes
235-
- Focus on targeted changes rather than complete redesign
236-
- If modifying text content, preserve the formatting and styling of surrounding elements
237-
- If modifying specific elements (like selected text), only change that element while keeping everything else intact`
238197
198+
199+
200+
`
239201
// 创建流式响应
240202
const stream = new ReadableStream({
241203
async start(controller) {
@@ -344,14 +306,13 @@ ${!modificationContext?.isDirectModification ? `${thinkingContent ? `**🎯 设
344306
345307
**内容简洁性原则**:
346308
- 每页PPT最多包含3-4个核心要点
347-
- 每个要点用1-2句话表达,避免长段落
348309
- 使用关键词、短语和数字,提高可读性
349310
- 优先使用视觉元素(图表、图标、数据)代替大量文字
350311
- 删除冗余信息,只保留最精简的内容
351312
352313
**内容组织策略**:
353314
- 标题:简洁明了,一句话概括主题
354-
- 要点:使用项目符号,每项不超过10个字
315+
- 要点:使用项目符号,每项不超过15个字
355316
- 描述:如需详细说明,控制在15字以内
356317
- 数据:优先使用图表展示,减少文字说明
357318
${thinkingContent ? '- 严格遵循设计分析中的所有决策和尺寸约束' : '- 创建专业美观的静态设计,确保内容完整显示'}

app/api/generate-ppt-outline/route.ts

Lines changed: 2 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -31,45 +31,8 @@ IMPORTANT: You MUST start your response with detailed thinking process enclosed
3131
7. Content depth and breadth decisions
3232
8. Slide progression and storytelling approach
3333
34-
EXCELLENT OUTLINE EXAMPLE:
35-
Topic: "为什么要全球化"
36-
Structure:
37-
1. 标题页 - 为什么要全球化 (探讨全球化的必要性、优势和重要意义)
38-
2. 目录页 - 清晰列出所有要点
39-
3. 定义页 - 全球化定义 (概念解释和核心要素)
40-
4. 主体页1 - 经济层面的全球化必要性 (具体分析经济影响)
41-
5. 主体页2 - 技术创新推动全球化 (技术角度的深入分析)
42-
6. 主体页3 - 文化交流的价值 (文化维度的重要性)
43-
7. 主体页4 - 应对全球挑战 (实际应用和解决方案)
44-
8. 总结页 - 总结与展望 (回顾要点,展望未来)
45-
46-
OUTLINE REQUIREMENTS:
47-
1. **逻辑结构**: 必须包含标题页、目录页(如果超过5页)、主体内容页、总结页
48-
2. **内容深度**: 每页描述要具体详细,不能泛泛而谈
49-
3. **逻辑递进**: 内容要有清晰的逻辑关系和递进层次
50-
4. **专业性**: 内容要有一定深度,适合专业演示
51-
5. **完整性**: 涵盖主题的各个重要维度
52-
6. **实用性**: 每页都要有明确的价值和目的
53-
54-
SLIDE NAMING CONVENTIONS:
55-
- 使用简洁有力的标题
56-
- 标题要体现页面核心价值
57-
- 避免过于抽象的表述
58-
- 确保标题间的逻辑关系清晰
59-
60-
CONTENT DESCRIPTION GUIDELINES:
61-
- 每页描述要详细具体(50-100字)
62-
- 说明该页要解决什么问题
63-
- 包含具体的论点或要素
64-
- 体现该页在整体结构中的作用
65-
- 如果涉及数据展示,明确说明需要什么类型的图表
66-
67-
KEY POINTS SELECTION:
68-
- 选择3-5个核心要点
69-
- 要点要具体可操作
70-
- 避免重复和冗余
71-
- 确保要点支撑主标题
72-
- 对于数据相关内容,包含具体的数据点或统计信息
34+
35+
7336
7437
After your thinking process, create a detailed presentation outline following this format:
7538

0 commit comments

Comments
 (0)