Skip to content

Commit eaae928

Browse files
committed
update doc
1 parent 8f203cb commit eaae928

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,30 @@
88
- 删除了所有非核心代码,仅关注 XML 的解析过程;
99
- 输出 JSON 格式的解析结果;
1010

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+
1135
# 📄 开源协议
1236
GPL-3.0 LICENSE © [pipipi-pikachu](https://github.com/pipipi-pikachu)
1337

index.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
text-align: center;
7676
cursor: pointer;
7777
user-select: none;
78+
margin-bottom: 20px;
7879
}
7980
.upload-input {
8081
display: none;
@@ -88,6 +89,8 @@
8889
点击上传 .pptx 文件
8990
<input class="upload-input" type="file" accept="application/vnd.openxmlformats-officedocument.presentationml.presentation"/>
9091
</div>
92+
93+
<a href="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/pipipi-pikachu/pptx2json">Github</a>
9194
</div>
9295
<div id="jsoneditor"></div>
9396

0 commit comments

Comments
 (0)