dom-to-pptx 1.0.2 → 1.0.3
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/Readme.md +26 -2
- package/dist/dom-to-pptx.cjs +1038 -0
- package/dist/dom-to-pptx.min.js +505 -470
- package/dist/dom-to-pptx.mjs +1017 -0
- package/package.json +71 -64
- package/rollup.config.js +24 -8
- package/src/index.js +502 -486
package/Readme.md
CHANGED
|
@@ -41,7 +41,11 @@ This library is intended for use in the browser (React, Vue, Svelte, Vanilla JS,
|
|
|
41
41
|
### 1. Basic Example
|
|
42
42
|
|
|
43
43
|
```javascript
|
|
44
|
-
import { exportToPptx } from 'dom-to-pptx';
|
|
44
|
+
import { exportToPptx } from 'dom-to-pptx'; // ESM or CJS import
|
|
45
|
+
|
|
46
|
+
// Note: If you are using a module bundler, it is recommended to import pptxgenjs
|
|
47
|
+
// directly into your project to ensure tree-shaking and optimal bundle size.
|
|
48
|
+
// import PptxGenJS from 'pptxgenjs'; // Uncomment and use if needed for your setup
|
|
45
49
|
|
|
46
50
|
document.getElementById('download-btn').addEventListener('click', async () => {
|
|
47
51
|
// Pass the CSS selector of the container you want to turn into a slide
|
|
@@ -56,7 +60,7 @@ document.getElementById('download-btn').addEventListener('click', async () => {
|
|
|
56
60
|
To export multiple HTML elements as separate slides, pass an array of elements or selectors:
|
|
57
61
|
|
|
58
62
|
```javascript
|
|
59
|
-
import { exportToPptx } from 'dom-to-pptx';
|
|
63
|
+
import { exportToPptx } from 'dom-to-pptx'; // ESM or CJS import
|
|
60
64
|
|
|
61
65
|
document.getElementById('export-btn').addEventListener('click', async () => {
|
|
62
66
|
const slideElements = document.querySelectorAll('.slide');
|
|
@@ -71,6 +75,10 @@ document.getElementById('export-btn').addEventListener('click', async () => {
|
|
|
71
75
|
For direct inclusion in a web page using a `<script>` tag, you can use the UMD bundle:
|
|
72
76
|
|
|
73
77
|
```html
|
|
78
|
+
<!-- include pptxgenjs UMD bundle first -->
|
|
79
|
+
<script src="https://cdn.jsdelivr.net/npm/pptxgenjs@latest/dist/pptxgen.bundle.js"></script>
|
|
80
|
+
|
|
81
|
+
<!-- then include dom-to-pptx UMD bundle -->
|
|
74
82
|
<script src="https://cdn.jsdelivr.net/npm/dom-to-pptx@latest/dist/dom-to-pptx.min.js"></script>
|
|
75
83
|
<script>
|
|
76
84
|
document.getElementById('download-btn').addEventListener('click', async () => {
|
|
@@ -178,3 +186,19 @@ MIT © [Atharva Dharmendra Jagtap](https://github.com/atharva9167j) and `dom-to-
|
|
|
178
186
|
## Acknowledgements
|
|
179
187
|
|
|
180
188
|
This project is built on top of [PptxGenJS](https://github.com/gitbrent/PptxGenJS). Huge thanks to the PptxGenJS maintainers and all contributors — dom-to-pptx leverages and extends their excellent work on PPTX generation.
|
|
189
|
+
|
|
190
|
+
## Peer Dependencies
|
|
191
|
+
|
|
192
|
+
`dom-to-pptx` relies on `pptxgenjs` as a peer dependency. You need to install it separately in your project:
|
|
193
|
+
|
|
194
|
+
```bash
|
|
195
|
+
npm install pptxgenjs
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
## Peer Dependencies
|
|
199
|
+
|
|
200
|
+
`dom-to-pptx` relies on `pptxgenjs` as a peer dependency. You need to install it separately in your project:
|
|
201
|
+
|
|
202
|
+
```bash
|
|
203
|
+
npm install pptxgenjs
|
|
204
|
+
```
|