File tree Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Expand file tree Collapse file tree 2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change 8
8
- 删除了所有非核心代码,仅关注 XML 的解析过程;
9
9
- 输出 JSON 格式的解析结果;
10
10
11
+ # 安装
12
+ > npm install pptxtojson
13
+
14
+ # 用法
15
+ ``` html
16
+ <input type =" file" accept =" application/vnd.openxmlformats-officedocument.presentationml.presentation" />
17
+ ```
18
+
19
+ ``` js
20
+ import { parse } from ' pptxtojson/dist/index.esm'
21
+
22
+ document .querySelector (' input' ).addEventListener (' change' , evt => {
23
+ const file = evt .target .files [0 ]
24
+
25
+ const reader = new FileReader ()
26
+ reader .onload = async e => {
27
+ const json = await pptxtojson .parse (e .target .result )
28
+ console .log (json)
29
+ }
30
+ reader .readAsArrayBuffer (file)
31
+ })
32
+ ```
33
+
34
+
11
35
# 📄 开源协议
12
36
GPL-3.0 LICENSE © [ pipipi-pikachu] ( https://github.com/pipipi-pikachu )
13
37
Original file line number Diff line number Diff line change 75
75
text-align : center;
76
76
cursor : pointer;
77
77
user-select : none;
78
+ margin-bottom : 20px ;
78
79
}
79
80
.upload-input {
80
81
display : none;
88
89
点击上传 .pptx 文件
89
90
< input class ="upload-input " type ="file " accept ="application/vnd.openxmlformats-officedocument.presentationml.presentation "/>
90
91
</ div >
92
+
93
+ < a href ="https://github.com/pipipi-pikachu/pptx2json "> Github</ a >
91
94
</ div >
92
95
< div id ="jsoneditor "> </ div >
93
96
You can’t perform that action at this time.
0 commit comments