@ww_nero/skills 3.6.1 → 3.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/ppt_prompt.txt +3 -4
- package/index.js +1 -1
- package/package.json +1 -1
- package/scripts/svg_to_pptx.py +0 -2
package/assets/ppt_prompt.txt
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
制作PPT的完整步骤如下(可根据当前实际状态,跳过部分已经完成的环节):
|
|
2
2
|
|
|
3
3
|
1. **规划PPT内容**,存储到markdown文件中:
|
|
4
|
-
- 每页Slide
|
|
4
|
+
- 每页Slide的规划需要包含:内容、布局方式、插图(**注意:只有用户明确提出要求时才添加插图,默认不需要插图**)
|
|
5
5
|
- 不同页面应尽可能使用不同的布局方式,避免过于单调,可适当使用图表来呈现信息,例如折线图、柱状图、饼状图等;各正文页面标题样式、背景和文字色调**必须保持一致**。
|
|
6
6
|
- 如果用户未明确提出要求,则页面默认比例为宽1280px、高720px,默认背景为弱渐变的浅灰蓝(#F2F4F7 → #FCFCFC),现代科技感、扁平化风格。
|
|
7
7
|
- 如果需要插入图片,则按照以下方式:
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
- 将图片素材保存到`images`文件夹中,使用内容和宽高比例作为图片名称,例如`main_background_16_9.png`表示该图片是主背景图,宽高比为16:9。
|
|
11
11
|
|
|
12
12
|
2. **通过SVG代码实现Slides的排版**:
|
|
13
|
-
- 如需插入Image,应使用`
|
|
13
|
+
- 如需插入Image,应使用`image`标签,图片使用本地相对路径即可,示例:`<image href="images/main_background_16_9.png" width="1280" height="720"/>`
|
|
14
14
|
- 如需插入Icon,应使用纯SVG代码的方式绘制
|
|
15
|
-
- 如需插入Chart,如折线图、柱状图等,应使用纯SVG
|
|
15
|
+
- 如需插入Chart,如折线图、柱状图等,应使用纯SVG代码的方式绘制
|
|
16
16
|
- 每页Slide的保存在一个独立HTML文件中,例如`slide_01.html`、`slide_02.html`等。
|
|
17
17
|
|
|
18
18
|
3. **把SVG转成PPTX文件**:
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
- 转化的方法是把svg代码转化成使用python创建pptx中可操作元素的代码,示例中的创建元素的工具函数均可以使用
|
|
21
21
|
- 同时对于每个slide务必创建单独的create_slide函数,例如`create_slide1`、`create_slide2`等
|
|
22
22
|
- **不要使用`BeautifulSoup`这种通用的解析元素的方式,而是逐个元素从svg代码转化为python创建元素的代码**
|
|
23
|
-
- 转换过程中,需要把图片占位元素替换成前面准备的图片素材
|
|
24
23
|
- 每个页面编写一个单独的python脚本进行转化,最后再写一个python脚本,把所有单页的pptx文件合并成一个。
|
|
25
24
|
|
|
26
25
|
**注意**:完成后**需要保留**规划文档、html页面文件和python转化脚本,方便进一步根据反馈进行修改
|
package/index.js
CHANGED
|
@@ -149,7 +149,7 @@ const listTools = () => ({
|
|
|
149
149
|
]
|
|
150
150
|
});
|
|
151
151
|
|
|
152
|
-
const server = new Server({ name: 'skills', version: '3.6.
|
|
152
|
+
const server = new Server({ name: 'skills', version: '3.6.2' }, { capabilities: { tools: {} } });
|
|
153
153
|
|
|
154
154
|
server.setRequestHandler(ListToolsRequestSchema, async () => listTools());
|
|
155
155
|
|
package/package.json
CHANGED
package/scripts/svg_to_pptx.py
CHANGED
|
@@ -626,11 +626,9 @@ def create_slide(prs):
|
|
|
626
626
|
# SVG: <rect width="100%" height="100%" fill="url(#bgGrad)"/>
|
|
627
627
|
set_slide_background_gradient(slide, "1a237e", "0d1b60")
|
|
628
628
|
|
|
629
|
-
# SVG: <rect id="image-placeholder" x="420" y="340" width="180" height="120" .../>
|
|
630
629
|
image_path = os.path.join(os.path.dirname(__file__), "demo.jpg")
|
|
631
630
|
add_image(slide, image_path, 420, 340, 180, 120)
|
|
632
631
|
|
|
633
|
-
# SVG: <circle id="image-placeholder-circle" cx="1150" cy="120" r="50" .../>
|
|
634
632
|
add_circular_image(slide, image_path, 1150, 120, 50)
|
|
635
633
|
|
|
636
634
|
# SVG: <g opacity="0.1" stroke="#ffffff" stroke-width="1">
|