w-docx-split 1.0.0

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.
Files changed (61) hide show
  1. package/.editorconfig +9 -0
  2. package/.eslintignore +3 -0
  3. package/.eslintrc.js +55 -0
  4. package/.jsdoc +25 -0
  5. package/LICENSE +21 -0
  6. package/README.md +28 -0
  7. package/SECURITY.md +5 -0
  8. package/babel.config.js +16 -0
  9. package/dist/w-docx-split.umd.js +7 -0
  10. package/dist/w-docx-split.umd.js.map +1 -0
  11. package/docs/WDocxSplit.mjs.html +199 -0
  12. package/docs/fonts/Montserrat/Montserrat-Bold.eot +0 -0
  13. package/docs/fonts/Montserrat/Montserrat-Bold.ttf +0 -0
  14. package/docs/fonts/Montserrat/Montserrat-Bold.woff +0 -0
  15. package/docs/fonts/Montserrat/Montserrat-Bold.woff2 +0 -0
  16. package/docs/fonts/Montserrat/Montserrat-Regular.eot +0 -0
  17. package/docs/fonts/Montserrat/Montserrat-Regular.ttf +0 -0
  18. package/docs/fonts/Montserrat/Montserrat-Regular.woff +0 -0
  19. package/docs/fonts/Montserrat/Montserrat-Regular.woff2 +0 -0
  20. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.eot +0 -0
  21. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.svg +978 -0
  22. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.ttf +0 -0
  23. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff +0 -0
  24. package/docs/fonts/Source-Sans-Pro/sourcesanspro-light-webfont.woff2 +0 -0
  25. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.eot +0 -0
  26. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.svg +1049 -0
  27. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.ttf +0 -0
  28. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff +0 -0
  29. package/docs/fonts/Source-Sans-Pro/sourcesanspro-regular-webfont.woff2 +0 -0
  30. package/docs/global.html +519 -0
  31. package/docs/index.html +84 -0
  32. package/docs/scripts/collapse.js +39 -0
  33. package/docs/scripts/commonNav.js +28 -0
  34. package/docs/scripts/linenumber.js +25 -0
  35. package/docs/scripts/nav.js +12 -0
  36. package/docs/scripts/polyfill.js +4 -0
  37. package/docs/scripts/prettify/Apache-License-2.0.txt +202 -0
  38. package/docs/scripts/prettify/lang-css.js +2 -0
  39. package/docs/scripts/prettify/prettify.js +28 -0
  40. package/docs/scripts/search.js +99 -0
  41. package/docs/styles/jsdoc.css +776 -0
  42. package/docs/styles/prettify.css +80 -0
  43. package/g.mjs +29 -0
  44. package/package.json +32 -0
  45. package/script.txt +17 -0
  46. package/scripts/install.mjs +30 -0
  47. package/src/WDocxSplit.mjs +127 -0
  48. package/src/downloadFiles.mjs +23 -0
  49. package/srcPython/build.bat +9 -0
  50. package/srcPython/run.bat +4 -0
  51. package/srcPython/splitDocx.py +271 -0
  52. package/srcPython/splitDocx.spec +37 -0
  53. package/srcPython//350/252/252/346/230/216.txt +24 -0
  54. package/test/WDocxSplit.test.mjs +40 -0
  55. package/test/docin.docx +0 -0
  56. package/test/outTrue/001.docx +0 -0
  57. package/test/outTrue/002.docx +0 -0
  58. package/toolg/addVersion.mjs +4 -0
  59. package/toolg/cleanFolder.mjs +4 -0
  60. package/toolg/gDistRollup.mjs +28 -0
  61. package/toolg/modifyReadme.mjs +4 -0
@@ -0,0 +1,519 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+
5
+ <meta charset="utf-8">
6
+ <title>Global - Documentation</title>
7
+
8
+
9
+ <script src="scripts/prettify/prettify.js"></script>
10
+ <script src="scripts/prettify/lang-css.js"></script>
11
+ <!--[if lt IE 9]>
12
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13
+ <![endif]-->
14
+ <link type="text/css" rel="stylesheet" href="styles/prettify.css">
15
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
16
+ <script src="scripts/nav.js" defer></script>
17
+
18
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
19
+ </head>
20
+ <body>
21
+
22
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
23
+ <label for="nav-trigger" class="navicon-button x">
24
+ <div class="navicon"></div>
25
+ </label>
26
+
27
+ <label for="nav-trigger" class="overlay"></label>
28
+
29
+ <nav >
30
+
31
+
32
+ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#WDocxSplit">WDocxSplit</a></li></ul>
33
+
34
+ </nav>
35
+
36
+ <div id="main">
37
+
38
+ <h1 class="page-title">Global</h1>
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+ <section>
47
+
48
+ <header>
49
+
50
+ <h2>
51
+
52
+
53
+
54
+ </h2>
55
+
56
+
57
+ </header>
58
+
59
+ <article>
60
+
61
+ <div class="container-overview">
62
+
63
+
64
+
65
+ <dl class="details">
66
+
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+
88
+
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+
99
+ </dl>
100
+
101
+
102
+
103
+
104
+
105
+
106
+
107
+
108
+ </div>
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+
118
+
119
+
120
+
121
+
122
+
123
+
124
+
125
+
126
+ <h3 class="subsection-title">Methods</h3>
127
+
128
+
129
+
130
+
131
+
132
+
133
+ <h4 class="name" id="WDocxSplit"><span class="type-signature type-signature-async">(async) </span>WDocxSplit<span class="signature">(fpIn, strSep, fdOut, opt<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Promise}</span></h4>
134
+
135
+
136
+
137
+
138
+
139
+
140
+ <dl class="details">
141
+
142
+ <dt class="tag-description">Description:</dt>
143
+ <dd class="tag-description"><ul class="dummy"><li><p>依照指定字串分割Docx檔</p></li></ul></dd>
144
+
145
+
146
+
147
+ <dt class="tag-source">Source:</dt>
148
+ <dd class="tag-source"><ul class="dummy"><li>
149
+ <a href="WDocxSplit.mjs.html">WDocxSplit.mjs</a>, <a href="WDocxSplit.mjs.html#line35">line 35</a>
150
+ </li></ul></dd>
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+
179
+
180
+
181
+
182
+ </dl>
183
+
184
+
185
+
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+ <h5 class="h5-examples">Example</h5>
195
+
196
+ <pre class="prettyprint"><code></code></pre>
197
+
198
+
199
+
200
+
201
+ <h5 class="h5-parameters">Parameters:</h5>
202
+
203
+
204
+ <table class="params">
205
+ <thead>
206
+ <tr>
207
+
208
+ <th>Name</th>
209
+
210
+
211
+ <th>Type</th>
212
+
213
+
214
+ <th>Attributes</th>
215
+
216
+
217
+
218
+ <th>Default</th>
219
+
220
+
221
+ <th class="last">Description</th>
222
+ </tr>
223
+ </thead>
224
+
225
+ <tbody>
226
+
227
+
228
+ <tr>
229
+
230
+ <td class="name"><code>fpIn</code></td>
231
+
232
+
233
+ <td class="type">
234
+
235
+
236
+ <span class="param-type">String</span>
237
+
238
+
239
+
240
+
241
+ </td>
242
+
243
+
244
+ <td class="attributes">
245
+
246
+
247
+
248
+
249
+
250
+ </td>
251
+
252
+
253
+
254
+ <td class="default">
255
+
256
+ </td>
257
+
258
+
259
+ <td class="description last"><p>輸入來源Html檔位置字串</p></td>
260
+ </tr>
261
+
262
+
263
+
264
+ <tr>
265
+
266
+ <td class="name"><code>strSep</code></td>
267
+
268
+
269
+ <td class="type">
270
+
271
+
272
+ <span class="param-type">String</span>
273
+
274
+
275
+
276
+
277
+ </td>
278
+
279
+
280
+ <td class="attributes">
281
+
282
+
283
+
284
+
285
+
286
+ </td>
287
+
288
+
289
+
290
+ <td class="default">
291
+
292
+ </td>
293
+
294
+
295
+ <td class="description last"><p>輸入內文會提供之分割字串</p></td>
296
+ </tr>
297
+
298
+
299
+
300
+ <tr>
301
+
302
+ <td class="name"><code>fdOut</code></td>
303
+
304
+
305
+ <td class="type">
306
+
307
+
308
+ <span class="param-type">String</span>
309
+
310
+
311
+
312
+
313
+ </td>
314
+
315
+
316
+ <td class="attributes">
317
+
318
+
319
+
320
+
321
+
322
+ </td>
323
+
324
+
325
+
326
+ <td class="default">
327
+
328
+ </td>
329
+
330
+
331
+ <td class="description last"><p>輸入轉出Docx檔位置字串</p></td>
332
+ </tr>
333
+
334
+
335
+
336
+ <tr>
337
+
338
+ <td class="name"><code>opt</code></td>
339
+
340
+
341
+ <td class="type">
342
+
343
+
344
+ <span class="param-type">Object</span>
345
+
346
+
347
+
348
+
349
+ </td>
350
+
351
+
352
+ <td class="attributes">
353
+
354
+ &lt;optional><br>
355
+
356
+
357
+
358
+
359
+
360
+ </td>
361
+
362
+
363
+
364
+ <td class="default">
365
+
366
+ <code>{}</code>
367
+
368
+ </td>
369
+
370
+
371
+ <td class="description last"><p>輸入設定物件,預設{}</p>
372
+ <h6>Properties</h6>
373
+
374
+
375
+ <table class="params">
376
+ <thead>
377
+ <tr>
378
+
379
+ <th>Name</th>
380
+
381
+
382
+ <th>Type</th>
383
+
384
+
385
+ <th>Attributes</th>
386
+
387
+
388
+
389
+ <th>Default</th>
390
+
391
+
392
+ <th class="last">Description</th>
393
+ </tr>
394
+ </thead>
395
+
396
+ <tbody>
397
+
398
+
399
+ <tr>
400
+
401
+ <td class="name"><code>padZero</code></td>
402
+
403
+
404
+ <td class="type">
405
+
406
+
407
+ <span class="param-type">Integer</span>
408
+
409
+
410
+
411
+
412
+ </td>
413
+
414
+
415
+ <td class="attributes">
416
+
417
+ &lt;optional><br>
418
+
419
+
420
+
421
+
422
+
423
+ </td>
424
+
425
+
426
+
427
+ <td class="default">
428
+
429
+ <code>0</code>
430
+
431
+ </td>
432
+
433
+
434
+ <td class="description last"><p>輸入是否補0位數整數,例如padZero=3時檔名會變成001.docx,預設0</p></td>
435
+ </tr>
436
+
437
+
438
+ </tbody>
439
+ </table>
440
+
441
+ </td>
442
+ </tr>
443
+
444
+
445
+ </tbody>
446
+ </table>
447
+
448
+
449
+
450
+
451
+
452
+
453
+
454
+
455
+
456
+
457
+
458
+
459
+
460
+
461
+
462
+
463
+ <h5 class="h5-returns">Returns:</h5>
464
+
465
+
466
+ <div class="param-desc">
467
+ <p>回傳Promise,resolve回傳成功訊息,reject回傳錯誤訊息</p>
468
+ </div>
469
+
470
+
471
+
472
+ <dl class="param-type">
473
+ <dt>
474
+ Type
475
+ </dt>
476
+ <dd>
477
+
478
+ <span class="param-type">Promise</span>
479
+
480
+
481
+
482
+ </dd>
483
+ </dl>
484
+
485
+
486
+
487
+
488
+
489
+
490
+
491
+
492
+
493
+
494
+
495
+ </article>
496
+
497
+ </section>
498
+
499
+
500
+
501
+
502
+
503
+
504
+ </div>
505
+
506
+ <br class="clear">
507
+
508
+ <footer>
509
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Mon Dec 22 2025 23:26:04 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
510
+ </footer>
511
+
512
+ <script>prettyPrint();</script>
513
+ <script src="scripts/polyfill.js"></script>
514
+ <script src="scripts/linenumber.js"></script>
515
+
516
+
517
+
518
+ </body>
519
+ </html>
@@ -0,0 +1,84 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+
5
+ <meta charset="utf-8">
6
+ <title>Home - Documentation</title>
7
+
8
+
9
+ <script src="scripts/prettify/prettify.js"></script>
10
+ <script src="scripts/prettify/lang-css.js"></script>
11
+ <!--[if lt IE 9]>
12
+ <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
13
+ <![endif]-->
14
+ <link type="text/css" rel="stylesheet" href="styles/prettify.css">
15
+ <link type="text/css" rel="stylesheet" href="styles/jsdoc.css">
16
+ <script src="scripts/nav.js" defer></script>
17
+
18
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
19
+ </head>
20
+ <body>
21
+
22
+ <input type="checkbox" id="nav-trigger" class="nav-trigger" />
23
+ <label for="nav-trigger" class="navicon-button x">
24
+ <div class="navicon"></div>
25
+ </label>
26
+
27
+ <label for="nav-trigger" class="overlay"></label>
28
+
29
+ <nav >
30
+
31
+
32
+ <h2><a href="index.html">Home</a></h2><h3>Global</h3><ul><li><a href="global.html#WDocxSplit">WDocxSplit</a></li></ul>
33
+
34
+ </nav>
35
+
36
+ <div id="main">
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+ <section class="package">
47
+ <h3> </h3>
48
+ </section>
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+
67
+
68
+
69
+ </div>
70
+
71
+ <br class="clear">
72
+
73
+ <footer>
74
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 4.0.5</a> on Mon Dec 22 2025 23:26:04 GMT+0800 (台北標準時間) using the <a href="https://github.com/clenemt/docdash">docdash</a> theme.
75
+ </footer>
76
+
77
+ <script>prettyPrint();</script>
78
+ <script src="scripts/polyfill.js"></script>
79
+ <script src="scripts/linenumber.js"></script>
80
+
81
+
82
+
83
+ </body>
84
+ </html>
@@ -0,0 +1,39 @@
1
+ function hideAllButCurrent(){
2
+ //by default all submenut items are hidden
3
+ //but we need to rehide them for search
4
+ document.querySelectorAll("nav > ul").forEach(function(parent) {
5
+ if (parent.className.indexOf("collapse_top") !== -1) {
6
+ parent.style.display = "none";
7
+ }
8
+ });
9
+ document.querySelectorAll("nav > ul > li > ul li").forEach(function(parent) {
10
+ parent.style.display = "none";
11
+ });
12
+ document.querySelectorAll("nav > h3").forEach(function(section) {
13
+ if (section.className.indexOf("collapsed_header") !== -1) {
14
+ section.addEventListener("click", function(){
15
+ if (section.nextSibling.style.display === "none") {
16
+ section.nextSibling.style.display = "block";
17
+ } else {
18
+ section.nextSibling.style.display = "none";
19
+ }
20
+ });
21
+ }
22
+ });
23
+
24
+ //only current page (if it exists) should be opened
25
+ var file = window.location.pathname.split("/").pop().replace(/\.html/, '');
26
+ document.querySelectorAll("nav > ul > li > a").forEach(function(parent) {
27
+ var href = parent.attributes.href.value.replace(/\.html/, '');
28
+ if (file === href) {
29
+ if (parent.parentNode.parentNode.className.indexOf("collapse_top") !== -1) {
30
+ parent.parentNode.parentNode.style.display = "block";
31
+ }
32
+ parent.parentNode.querySelectorAll("ul li").forEach(function(elem) {
33
+ elem.style.display = "block";
34
+ });
35
+ }
36
+ });
37
+ }
38
+
39
+ hideAllButCurrent();
@@ -0,0 +1,28 @@
1
+ if (typeof fetch === 'function') {
2
+ const init = () => {
3
+ if (typeof scrollToNavItem !== 'function') return false
4
+ scrollToNavItem()
5
+ // hideAllButCurrent not always loaded
6
+ if (typeof hideAllButCurrent === 'function') hideAllButCurrent()
7
+ return true
8
+ }
9
+ fetch('./nav.inc.html')
10
+ .then(response => response.ok ? response.text() : `${response.url} => ${response.status} ${response.statusText}`)
11
+ .then(body => {
12
+ document.querySelector('nav').innerHTML += body
13
+ // nav.js should be quicker to load than nav.inc.html, a fallback just in case
14
+ return init()
15
+ })
16
+ .then(done => {
17
+ if (done) return
18
+ let i = 0
19
+ ;(function waitUntilNavJs () {
20
+ if (init()) return
21
+ if (i++ < 100) return setTimeout(waitUntilNavJs, 300)
22
+ console.error(Error('nav.js not loaded after 30s waiting for it'))
23
+ })()
24
+ })
25
+ .catch(error => console.error(error))
26
+ } else {
27
+ console.error(Error('Browser too old to display commonNav (remove commonNav docdash option)'))
28
+ }
@@ -0,0 +1,25 @@
1
+ /*global document */
2
+ (function() {
3
+ var source = document.getElementsByClassName('prettyprint source linenums');
4
+ var i = 0;
5
+ var lineNumber = 0;
6
+ var lineId;
7
+ var lines;
8
+ var totalLines;
9
+ var anchorHash;
10
+
11
+ if (source && source[0]) {
12
+ anchorHash = document.location.hash.substring(1);
13
+ lines = source[0].getElementsByTagName('li');
14
+ totalLines = lines.length;
15
+
16
+ for (; i < totalLines; i++) {
17
+ lineNumber++;
18
+ lineId = 'line' + lineNumber;
19
+ lines[i].id = lineId;
20
+ if (lineId === anchorHash) {
21
+ lines[i].className += ' selected';
22
+ }
23
+ }
24
+ }
25
+ })();
@@ -0,0 +1,12 @@
1
+ function scrollToNavItem() {
2
+ var path = window.location.href.split('/').pop().replace(/\.html/, '');
3
+ document.querySelectorAll('nav a').forEach(function(link) {
4
+ var href = link.attributes.href.value.replace(/\.html/, '');
5
+ if (path === href) {
6
+ link.scrollIntoView({block: 'center'});
7
+ return;
8
+ }
9
+ })
10
+ }
11
+
12
+ scrollToNavItem();
@@ -0,0 +1,4 @@
1
+ //IE Fix, src: https://www.reddit.com/r/programminghorror/comments/6abmcr/nodelist_lacks_foreach_in_internet_explorer/
2
+ if (typeof(NodeList.prototype.forEach)!==typeof(alert)){
3
+ NodeList.prototype.forEach=Array.prototype.forEach;
4
+ }