Compare commits

...

872 Commits
5.3.0 ... 7.2.0

Author SHA1 Message Date
0e033131b2 Version bump 2021-11-26 15:07:51 +00:00
0be6f31611 #1303 Re-name methods to be full english words 2021-11-26 15:07:15 +00:00
e8a8b73ad0 Merge pull request #1313 from dolanmiu/dependabot/npm_and_yarn/prettier-2.5.0
Bump prettier from 2.4.1 to 2.5.0
2021-11-26 15:01:47 +00:00
953c6806ce Merge pull request #1314 from dolanmiu/dependabot/npm_and_yarn/typescript-4.5.2
Bump typescript from 4.4.4 to 4.5.2
2021-11-26 15:01:40 +00:00
1cf68c696e Merge pull request #1315 from dolanmiu/dependabot/npm_and_yarn/webpack-5.64.4
Bump webpack from 5.64.3 to 5.64.4
2021-11-26 15:01:33 +00:00
6d354674b2 Merge pull request #1316 from dolanmiu/dependabot/npm_and_yarn/types/prompt-1.1.2
Bump @types/prompt from 1.1.1 to 1.1.2
2021-11-26 15:01:25 +00:00
137b9a06cb Bump @types/prompt from 1.1.1 to 1.1.2
Bumps [@types/prompt](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/prompt) from 1.1.1 to 1.1.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/prompt)

---
updated-dependencies:
- dependency-name: "@types/prompt"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-26 11:02:16 +00:00
c43f04da52 Bump webpack from 5.64.3 to 5.64.4
Bumps [webpack](https://github.com/webpack/webpack) from 5.64.3 to 5.64.4.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.64.3...v5.64.4)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-26 11:01:54 +00:00
1941721070 Bump typescript from 4.4.4 to 4.5.2
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.4.4 to 4.5.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.4.4...v4.5.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-26 11:01:35 +00:00
9f282952cd Bump prettier from 2.4.1 to 2.5.0
Bumps [prettier](https://github.com/prettier/prettier) from 2.4.1 to 2.5.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.4.1...2.5.0)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-26 11:01:12 +00:00
09b81017d0 Merge pull request #1309 from dolanmiu/dependabot/npm_and_yarn/webpack-5.64.3
Bump webpack from 5.64.2 to 5.64.3
2021-11-25 16:44:14 +00:00
4f58979096 Merge pull request #1310 from dolanmiu/dependabot/npm_and_yarn/types/node-16.11.10
Bump @types/node from 16.11.9 to 16.11.10
2021-11-25 16:44:04 +00:00
898104ea2c Merge pull request #1312 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.22.10
Bump typedoc from 0.22.9 to 0.22.10
2021-11-25 16:43:55 +00:00
7d15eeda88 Bump typedoc from 0.22.9 to 0.22.10
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.22.9 to 0.22.10.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.22.9...v0.22.10)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-25 11:01:13 +00:00
cba3f77272 Bump @types/node from 16.11.9 to 16.11.10
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.9 to 16.11.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-24 11:01:47 +00:00
91dffc45ff Bump webpack from 5.64.2 to 5.64.3
Bumps [webpack](https://github.com/webpack/webpack) from 5.64.2 to 5.64.3.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.64.2...v5.64.3)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-24 11:01:29 +00:00
47eb46e700 Merge pull request #1303 from katz/katz/page-text-direction
ability to specify textDirection for SectionProperties
2021-11-23 13:43:16 +00:00
8271ddc78e Merge pull request #1305 from dolanmiu/dependabot/npm_and_yarn/tsconfig-paths-3.12.0
Bump tsconfig-paths from 3.11.0 to 3.12.0
2021-11-23 03:52:38 +00:00
6b08545ef9 Merge pull request #1306 from dolanmiu/dependabot/npm_and_yarn/webpack-5.64.2
Bump webpack from 5.64.1 to 5.64.2
2021-11-23 03:52:32 +00:00
9cddfb4ce7 ability to specify textDirection for section 2021-11-23 10:52:17 +09:00
19b26e1c5e Bump webpack from 5.64.1 to 5.64.2
Bumps [webpack](https://github.com/webpack/webpack) from 5.64.1 to 5.64.2.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.64.1...v5.64.2)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-22 11:01:44 +00:00
936fffd0a1 Bump tsconfig-paths from 3.11.0 to 3.12.0
Bumps [tsconfig-paths](https://github.com/dividab/tsconfig-paths) from 3.11.0 to 3.12.0.
- [Release notes](https://github.com/dividab/tsconfig-paths/releases)
- [Changelog](https://github.com/dividab/tsconfig-paths/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dividab/tsconfig-paths/compare/v3.11.0...v3.12.0)

---
updated-dependencies:
- dependency-name: tsconfig-paths
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-22 11:01:13 +00:00
2f24d062b3 Merge pull request #1302 from dolanmiu/dependabot/npm_and_yarn/types/node-16.11.9
Bump @types/node from 16.11.7 to 16.11.9
2021-11-21 06:41:00 +00:00
4e373d4ab6 Bump @types/node from 16.11.7 to 16.11.9
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.7 to 16.11.9.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-19 11:01:29 +00:00
c01d3d9f67 Merge pull request #1292 from dolanmiu/dependabot/npm_and_yarn/webpack-5.64.1
Bump webpack from 5.64.0 to 5.64.1
2021-11-17 03:13:00 +00:00
d2f344b83f Bump webpack from 5.64.0 to 5.64.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.64.0 to 5.64.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.64.0...v5.64.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-16 11:01:19 +00:00
d7f5a44b45 Merge pull request #1288 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.22.9
Bump typedoc from 0.22.8 to 0.22.9
2021-11-15 11:17:37 +00:00
0a9b98e1aa Merge pull request #1286 from dolanmiu/dependabot/npm_and_yarn/webpack-5.64.0
Bump webpack from 5.62.1 to 5.64.0
2021-11-15 11:17:29 +00:00
fd188870e8 Merge pull request #1280 from dolanmiu/dependabot/npm_and_yarn/types/node-16.11.7
Bump @types/node from 16.11.6 to 16.11.7
2021-11-15 11:09:35 +00:00
c28e6ac22e Merge pull request #1285 from erlend-axelsson/master
Dont set background color if none is provided in options
2021-11-15 11:05:37 +00:00
9381bd8ddb Bump typedoc from 0.22.8 to 0.22.9
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.22.8 to 0.22.9.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.22.8...v0.22.9)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-15 11:01:23 +00:00
454fc76e8d Bump webpack from 5.62.1 to 5.64.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.62.1 to 5.64.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.62.1...v5.64.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-12 11:01:25 +00:00
ba963b0360 Dont set background color if none is provided in options
After comparing the output of this library and what is
produced by Microsoft Word, it seems that document
background color is not set by default by Word.

Removing the default #FFFFFF background color enables the
generated documents to be readable in dark mode.

This seems to fix dolanmiu/docx#1093
2021-11-12 10:21:01 +01:00
19d3ed47c9 Bump @types/node from 16.11.6 to 16.11.7
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.6 to 16.11.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-09 11:01:20 +00:00
0757295213 Merge pull request #1279 from dolanmiu/dependabot/npm_and_yarn/webpack-5.62.1
Bump webpack from 5.61.0 to 5.62.1
2021-11-08 16:16:22 +00:00
76c677a6b1 Merge pull request #1278 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.22.8
Bump typedoc from 0.22.7 to 0.22.8
2021-11-08 16:16:14 +00:00
ce8842b52f Bump webpack from 5.61.0 to 5.62.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.61.0 to 5.62.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.61.0...v5.62.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-08 11:01:50 +00:00
a039fe3223 Bump typedoc from 0.22.7 to 0.22.8
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.22.7 to 0.22.8.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.22.7...v0.22.8)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-08 11:01:24 +00:00
a669b2148f Merge pull request #1273 from dolanmiu/dependabot/npm_and_yarn/webpack-5.61.0
Bump webpack from 5.60.0 to 5.61.0
2021-11-05 11:29:08 +00:00
53a7d87b03 Merge pull request #1275 from dolanmiu/dependabot/npm_and_yarn/sinon-12.0.1
Bump sinon from 11.1.2 to 12.0.1
2021-11-05 11:29:00 +00:00
388ab4f3b1 Bump sinon from 11.1.2 to 12.0.1
Bumps [sinon](https://github.com/sinonjs/sinon) from 11.1.2 to 12.0.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/docs/changelog.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v11.1.2...v12.0.1)

---
updated-dependencies:
- dependency-name: sinon
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-05 11:01:18 +00:00
567713b7ba Bump webpack from 5.60.0 to 5.61.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.60.0 to 5.61.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.60.0...v5.61.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-11-01 11:01:25 +00:00
9547805ec2 Version bump 2021-11-01 00:42:30 +00:00
89040e0237 Merge pull request #1271 from dolanmiu/feature/page-border-demos
#1256 Add page border demos
2021-10-31 21:47:21 +00:00
dd657a9e88 Fix typo 2021-10-31 20:25:52 +00:00
fe21bb1702 #1256 Add page border demos 2021-10-30 19:34:16 +01:00
a01d352925 Merge pull request #1241 from dolanmiu/dependabot/npm_and_yarn/webpack-cli-4.9.1
Bump webpack-cli from 4.9.0 to 4.9.1
2021-10-29 12:39:18 +01:00
e1fb07989f Merge pull request #1242 from dolanmiu/dependabot/npm_and_yarn/types/glob-7.2.0
Bump @types/glob from 7.1.4 to 7.2.0
2021-10-29 12:39:10 +01:00
b0d6be1929 Merge pull request #1251 from dolanmiu/dependabot/npm_and_yarn/replace-in-file-6.3.2
Bump replace-in-file from 6.3.1 to 6.3.2
2021-10-29 12:38:40 +01:00
a2e0c66dc8 Merge pull request #1252 from dolanmiu/dependabot/npm_and_yarn/ts-node-10.4.0
Bump ts-node from 10.3.0 to 10.4.0
2021-10-29 12:38:33 +01:00
fe028c3ac1 Merge pull request #1253 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.22.7
Bump typedoc from 0.22.6 to 0.22.7
2021-10-29 12:38:26 +01:00
92ef5805b8 Merge pull request #1258 from dolanmiu/dependabot/npm_and_yarn/types/sinon-10.0.6
Bump @types/sinon from 10.0.4 to 10.0.6
2021-10-29 12:38:19 +01:00
e30f3b2035 Merge pull request #1259 from dolanmiu/dependabot/npm_and_yarn/types/node-16.11.6
Bump @types/node from 16.11.1 to 16.11.6
2021-10-29 12:38:12 +01:00
cdcaba651c Merge pull request #1260 from dolanmiu/dependabot/npm_and_yarn/webpack-5.60.0
Bump webpack from 5.58.2 to 5.60.0
2021-10-29 12:38:04 +01:00
63aff461ed Merge pull request #1262 from devoidfury/fix/bookmark-schema-issue-ids
fix #1261 use numeric ids with bookmarks
2021-10-27 14:03:24 +01:00
54565e2228 fix #1261 use numeric ids with bookmarkStart and bookmarkEnd to conform to schema 2021-10-26 20:10:10 -05:00
cce6d3fcbe Bump webpack from 5.58.2 to 5.60.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.58.2 to 5.60.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.58.2...v5.60.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-26 11:01:50 +00:00
26809a33c6 Bump @types/node from 16.11.1 to 16.11.6
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.11.1 to 16.11.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-26 11:01:25 +00:00
030594ccae Bump @types/sinon from 10.0.4 to 10.0.6
Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 10.0.4 to 10.0.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon)

---
updated-dependencies:
- dependency-name: "@types/sinon"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-26 11:01:10 +00:00
396470886c Bump typedoc from 0.22.6 to 0.22.7
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.22.6 to 0.22.7.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.22.6...v0.22.7)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-25 11:01:38 +00:00
0408a2808c Bump ts-node from 10.3.0 to 10.4.0
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.3.0 to 10.4.0.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v10.3.0...v10.4.0)

---
updated-dependencies:
- dependency-name: ts-node
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-25 11:01:18 +00:00
14f9347311 Bump replace-in-file from 6.3.1 to 6.3.2
Bumps [replace-in-file](https://github.com/adamreisnz/replace-in-file) from 6.3.1 to 6.3.2.
- [Release notes](https://github.com/adamreisnz/replace-in-file/releases)
- [Changelog](https://github.com/adamreisnz/replace-in-file/blob/main/CHANGELOG.md)
- [Commits](https://github.com/adamreisnz/replace-in-file/compare/v6.3.1...v6.3.2)

---
updated-dependencies:
- dependency-name: replace-in-file
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-25 11:01:04 +00:00
40747603e8 Bump @types/glob from 7.1.4 to 7.2.0
Bumps [@types/glob](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/glob) from 7.1.4 to 7.2.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/glob)

---
updated-dependencies:
- dependency-name: "@types/glob"
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-20 11:01:21 +00:00
608ba89c7c Bump webpack-cli from 4.9.0 to 4.9.1
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.9.0 to 4.9.1.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.9.0...webpack-cli@4.9.1)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-19 11:01:21 +00:00
f34d4833a8 Merge pull request #1240 from dolanmiu/dependabot/npm_and_yarn/replace-in-file-6.3.1
Bump replace-in-file from 6.2.0 to 6.3.1
2021-10-18 13:25:52 +01:00
051a1226c0 Merge pull request #1239 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.22.6
Bump typedoc from 0.22.5 to 0.22.6
2021-10-18 13:25:45 +01:00
5b2350c01c Merge pull request #1238 from dolanmiu/dependabot/npm_and_yarn/types/node-16.11.1
Bump @types/node from 16.10.3 to 16.11.1
2021-10-18 13:25:37 +01:00
0ffc114005 Merge pull request #1235 from dolanmiu/dependabot/npm_and_yarn/mocha-9.1.3
Bump mocha from 9.1.2 to 9.1.3
2021-10-18 13:25:30 +01:00
ff25a4faa5 Merge pull request #1231 from dolanmiu/dependabot/npm_and_yarn/nanoid-3.1.30
Bump nanoid from 3.1.29 to 3.1.30
2021-10-18 13:25:23 +01:00
e73b12cd76 Merge pull request #1228 from dolanmiu/dependabot/npm_and_yarn/webpack-5.58.2
Bump webpack from 5.58.1 to 5.58.2
2021-10-18 13:25:16 +01:00
7a2f209430 Merge pull request #1227 from dolanmiu/dependabot/npm_and_yarn/typescript-4.4.4
Bump typescript from 4.4.3 to 4.4.4
2021-10-18 13:25:09 +01:00
0174e9b423 Bump replace-in-file from 6.2.0 to 6.3.1
Bumps [replace-in-file](https://github.com/adamreisnz/replace-in-file) from 6.2.0 to 6.3.1.
- [Release notes](https://github.com/adamreisnz/replace-in-file/releases)
- [Changelog](https://github.com/adamreisnz/replace-in-file/blob/main/CHANGELOG.md)
- [Commits](https://github.com/adamreisnz/replace-in-file/compare/v6.2.0...v6.3.1)

---
updated-dependencies:
- dependency-name: replace-in-file
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 11:02:23 +00:00
794571c7e1 Bump typedoc from 0.22.5 to 0.22.6
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.22.5 to 0.22.6.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.22.5...v0.22.6)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 11:01:58 +00:00
c34a4f2613 Bump @types/node from 16.10.3 to 16.11.1
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.10.3 to 16.11.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-18 11:01:33 +00:00
f648ecf0b8 Bump mocha from 9.1.2 to 9.1.3
Bumps [mocha](https://github.com/mochajs/mocha) from 9.1.2 to 9.1.3.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v9.1.2...v9.1.3)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-15 11:01:19 +00:00
e1cc557bec Bump nanoid from 3.1.29 to 3.1.30
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.29 to 3.1.30.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.29...3.1.30)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-14 11:01:25 +00:00
2310b7f479 Bump webpack from 5.58.1 to 5.58.2
Bumps [webpack](https://github.com/webpack/webpack) from 5.58.1 to 5.58.2.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.58.1...v5.58.2)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-13 11:01:42 +00:00
e64bb9c7b9 Bump typescript from 4.4.3 to 4.4.4
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.4.3 to 4.4.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.4.3...v4.4.4)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-13 11:01:24 +00:00
af98f80db0 Merge pull request #1226 from dolanmiu/dependabot/npm_and_yarn/ts-node-10.3.0
Bump ts-node from 10.2.1 to 10.3.0
2021-10-12 15:37:28 +01:00
8a704776d2 Merge pull request #1224 from dolanmiu/dependabot/npm_and_yarn/webpack-5.58.1
Bump webpack from 5.58.0 to 5.58.1
2021-10-12 15:37:21 +01:00
67a205cae7 Bump ts-node from 10.2.1 to 10.3.0
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 10.2.1 to 10.3.0.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v10.2.1...v10.3.0)

---
updated-dependencies:
- dependency-name: ts-node
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-12 11:01:29 +00:00
1fb1f50756 Bump webpack from 5.58.0 to 5.58.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.58.0 to 5.58.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.58.0...v5.58.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-11 11:01:29 +00:00
50049113b5 Merge pull request #1222 from tadmi/patch-1
comments fix
2021-10-11 01:18:51 +01:00
49694a53fd Merge pull request #1217 from curvenote/feat/revision
Change type of revision to a number
2021-10-09 20:42:28 +01:00
ead04d0764 comments fix
Fixed a comments about the behavior default, first, even Header and Footer when activating options:
Different Odd & Even Pages
Different First Page
2021-10-09 19:52:46 +03:00
47099d0468 Change type of revision to a number 2021-10-08 15:55:58 -06:00
abbd620220 Merge pull request #1216 from dolanmiu/dependabot/npm_and_yarn/webpack-5.58.0
Bump webpack from 5.57.1 to 5.58.0
2021-10-08 17:49:46 +01:00
303b025aee Bump webpack from 5.57.1 to 5.58.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.57.1 to 5.58.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.57.1...v5.58.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-08 11:01:23 +00:00
1421b06df7 Merge pull request #1215 from dolanmiu/dependabot/npm_and_yarn/webpack-cli-4.9.0
Bump webpack-cli from 4.8.0 to 4.9.0
2021-10-07 12:16:57 +01:00
1e37282e06 Bump webpack-cli from 4.8.0 to 4.9.0
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.8.0 to 4.9.0.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.8.0...webpack-cli@4.9.0)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-07 11:01:20 +00:00
7b992ed254 Merge pull request #1209 from dolanmiu/dependabot/npm_and_yarn/webpack-5.57.1
Bump webpack from 5.56.1 to 5.57.1
2021-10-06 12:54:39 +01:00
deba94d69c Merge pull request #1210 from dolanmiu/dependabot/npm_and_yarn/nanoid-3.1.29
Bump nanoid from 3.1.28 to 3.1.29
2021-10-06 12:53:17 +01:00
5e09c27a0d Merge pull request #1211 from dolanmiu/dependabot/npm_and_yarn/types/node-16.10.3
Bump @types/node from 16.10.2 to 16.10.3
2021-10-06 12:53:09 +01:00
31563f53ec Bump @types/node from 16.10.2 to 16.10.3
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.10.2 to 16.10.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-06 11:02:14 +00:00
a967e560c6 Bump nanoid from 3.1.28 to 3.1.29
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.28 to 3.1.29.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.28...3.1.29)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-06 11:01:56 +00:00
c4427f7bb9 Bump webpack from 5.56.1 to 5.57.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.56.1 to 5.57.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.56.1...v5.57.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-06 11:01:38 +00:00
a563659eca Merge pull request #1207 from dolanmiu/dependabot/npm_and_yarn/webpack-5.56.1
Bump webpack from 5.55.1 to 5.56.1
2021-10-05 00:27:41 +01:00
caca11d807 Merge pull request #1208 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.22.5
Bump typedoc from 0.22.4 to 0.22.5
2021-10-05 00:27:33 +01:00
c79d68d83e Bump typedoc from 0.22.4 to 0.22.5
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.22.4 to 0.22.5.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.22.4...v0.22.5)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-04 11:01:41 +00:00
7af63f4b0c Bump webpack from 5.55.1 to 5.56.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.55.1 to 5.56.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.55.1...v5.56.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-10-04 11:01:14 +00:00
ea54f35317 Merge pull request #1204 from dolanmiu/dependabot/npm_and_yarn/types/node-16.10.2
Bump @types/node from 16.10.1 to 16.10.2
2021-09-30 15:42:55 +01:00
820fb61a85 Use tsconfig spec for extraction 2021-09-30 15:37:20 +01:00
f602a097d2 Use CommonJS tsconfig for testing 2021-09-30 15:27:19 +01:00
0df72996b5 Version bump 2021-09-30 15:07:26 +01:00
8d94fa9a78 Change module to ES6 2021-09-30 15:00:49 +01:00
54417af3d4 Bump @types/node from 16.10.1 to 16.10.2
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.10.1 to 16.10.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-30 13:54:41 +00:00
5a0727f2d9 Add type definitions 2021-09-30 14:52:50 +01:00
d51a488303 Add types to glob 2021-09-30 14:16:42 +01:00
ef28ba1866 Add GitHub Pages pipeline 2021-09-30 03:14:15 +01:00
6ede7000fa Merge pull request #1107 from dolanmiu/dependabot/npm_and_yarn/ts-node-10.2.1
Bump ts-node from 9.1.1 to 10.2.1
2021-09-30 03:10:56 +01:00
0883e3b0c6 Merge pull request #1202 from dolanmiu/feat/schema-validator
Add schema validator
2021-09-30 03:10:45 +01:00
86f58703a5 Bump ts-node from 9.1.1 to 10.2.1
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 9.1.1 to 10.2.1.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v9.1.1...v10.2.1)

---
updated-dependencies:
- dependency-name: ts-node
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-30 02:04:51 +00:00
b6be7627bb Merge pull request #1203 from dolanmiu/feat/fix-demo-10
Add type definitions to demo 10
2021-09-30 03:03:45 +01:00
4522c9bbfd Add type definitions to demo 10 2021-09-30 02:56:33 +01:00
1cf9255f3d Fix demo 68 2021-09-30 02:55:47 +01:00
bc2b677c86 Exclude demo 66 2021-09-30 02:42:50 +01:00
297810d2f5 Update .nycrc 2021-09-30 02:30:53 +01:00
740f10f391 Exclude demo 61 2021-09-30 02:26:07 +01:00
b895bc7457 Update .nycrc 2021-09-30 02:02:09 +01:00
133761a266 Exclude demo 60 2021-09-30 01:58:34 +01:00
9ea940d2ca Exclude demo 55 from validation 2021-09-30 01:23:00 +01:00
a7b9dc7730 Revert yml 2021-09-30 01:06:37 +01:00
bf5e6cfa57 Try fix yml again 2021-09-30 01:04:21 +01:00
cdc82268e6 Try simplify demos 2021-09-30 00:59:06 +01:00
d3035a29b8 Re-name pipeline 2021-09-30 00:48:32 +01:00
cc6c696d99 Ignore demo 2021-09-30 00:47:38 +01:00
0f273c5aaf Fix schema 2021-09-30 00:41:21 +01:00
d1837651f8 Move schemas to better location 2021-09-30 00:36:28 +01:00
9ba1c233dc Rename pipeline 2021-09-30 00:32:16 +01:00
1727acf9ca Fix YML errors 2021-09-30 00:25:26 +01:00
60f59c1da5 Remove validator 2021-09-30 00:22:29 +01:00
e6a0f3e8f7 Remove demos validation 2021-09-30 00:22:00 +01:00
d881646e73 Try using GitHub Action validator 2021-09-30 00:19:03 +01:00
97d1025a0f Add schema validator 2021-09-29 23:47:33 +01:00
309517b654 Merge pull request #1200 from dolanmiu/dependabot/npm_and_yarn/webpack-5.55.1
Bump webpack from 5.54.0 to 5.55.1
2021-09-29 12:58:17 +01:00
e13d734738 Bump webpack from 5.54.0 to 5.55.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.54.0 to 5.55.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.54.0...v5.55.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-29 11:01:36 +00:00
34da2f4289 Update lock file 2021-09-29 00:49:38 +01:00
b986403656 Version bump 2021-09-28 22:20:05 +01:00
5cba664f70 Merge branch 'master' of github.com:dolanmiu/docx 2021-09-28 22:08:57 +01:00
9a35029f16 Merge pull request #1196 from mattpow/mpowell/suppress-line-numbers
Add suppressLineNumber option to Paragraph
2021-09-28 22:08:42 +01:00
3c768c5630 Update 70-line-numbers-suppression.ts 2021-09-28 12:22:59 -07:00
f77ddb4037 Add tests for suppressLineNumbers 2021-09-28 12:21:51 -07:00
536204e5ef Add back types absolute fixer 2021-09-28 19:56:29 +01:00
1f078e0687 Merge pull request #1199 from anti-the-social/table-width-percent-unit-handling
Table width percent unit handling
2021-09-28 18:54:30 +01:00
705b1f7cfc Fix to table percent width test + additional test on DXA table width 2021-09-28 16:16:50 +03:00
28233075bd Append % if type is "pct" (WidthType.PERCENTAGE) 2021-09-28 15:57:33 +03:00
f1627c378d Merge pull request #1188 from dolanmiu/dependabot/npm_and_yarn/mocha-9.1.2
Bump mocha from 9.1.1 to 9.1.2
2021-09-28 13:02:08 +01:00
0aa5510b9c Merge pull request #1189 from dolanmiu/dependabot/npm_and_yarn/types/sinon-10.0.4
Bump @types/sinon from 10.0.3 to 10.0.4
2021-09-28 13:01:57 +01:00
3d9216e8bf Merge pull request #1190 from dolanmiu/dependabot/npm_and_yarn/types/node-16.10.1
Bump @types/node from 16.9.6 to 16.10.1
2021-09-28 13:01:11 +01:00
054ece38ab Merge pull request #1191 from dolanmiu/dependabot/npm_and_yarn/webpack-5.54.0
Bump webpack from 5.53.0 to 5.54.0
2021-09-28 13:01:01 +01:00
951094c6fb Merge pull request #1192 from dolanmiu/dependabot/npm_and_yarn/nanoid-3.1.28
Bump nanoid from 3.1.25 to 3.1.28
2021-09-28 13:00:52 +01:00
ea01ddb337 Update Paragraph/properties.ts with supressLineNumber docs 2021-09-27 19:18:58 -07:00
34036bca8f Add suppressLineNumber option to Paragraph 2021-09-27 19:11:09 -07:00
0256968240 Remove Travis CI 2021-09-28 00:45:51 +01:00
1f894303d3 Bump nanoid from 3.1.25 to 3.1.28
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.25 to 3.1.28.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.25...3.1.28)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 11:02:18 +00:00
c79e9ded71 Bump webpack from 5.53.0 to 5.54.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.53.0 to 5.54.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.53.0...v5.54.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 11:02:02 +00:00
0d72de7e53 Bump @types/node from 16.9.6 to 16.10.1
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.9.6 to 16.10.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 11:01:46 +00:00
750368ac08 Bump @types/sinon from 10.0.3 to 10.0.4
Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 10.0.3 to 10.0.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon)

---
updated-dependencies:
- dependency-name: "@types/sinon"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 11:01:12 +00:00
4394a9b575 Bump mocha from 9.1.1 to 9.1.2
Bumps [mocha](https://github.com/mochajs/mocha) from 9.1.1 to 9.1.2.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v9.1.1...v9.1.2)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-27 11:00:59 +00:00
1b758b73e6 Version bump 2021-09-25 20:56:16 +01:00
65a0e97c97 Version bump 2021-09-25 02:33:45 +01:00
3c33931d99 Merge pull request #1182 from dolanmiu/dependabot/npm_and_yarn/glob-7.2.0
Bump glob from 7.1.7 to 7.2.0
2021-09-25 02:32:52 +01:00
e475779ba5 Bump glob from 7.1.7 to 7.2.0
Bumps [glob](https://github.com/isaacs/node-glob) from 7.1.7 to 7.2.0.
- [Release notes](https://github.com/isaacs/node-glob/releases)
- [Changelog](https://github.com/isaacs/node-glob/blob/master/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v7.1.7...v7.2.0)

---
updated-dependencies:
- dependency-name: glob
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-23 11:01:14 +00:00
4c58e3c47d Merge pull request #3 from dolanmiu/master
merge latest changes from Dolans master
2021-09-23 10:38:47 +03:00
9fb77d9cee Merge pull request #1180 from dolanmiu/dependabot/npm_and_yarn/types/node-16.9.6
Bump @types/node from 16.9.4 to 16.9.6
2021-09-23 02:10:11 +01:00
f315909dc0 Merge pull request #1181 from grahampcharles/master
documentation: add possible values for LineRuleType
2021-09-23 02:10:03 +01:00
fa9ffec601 Update _coverpage.md 2021-09-23 02:09:09 +01:00
636d114d44 Merge branch 'master' of https://github.com/grahampcharles/docx 2021-09-22 16:55:12 -07:00
2140ed63cd added possible values for LineRuleType 2021-09-22 16:54:40 -07:00
8d0f7d58bf Bump @types/node from 16.9.4 to 16.9.6
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.9.4 to 16.9.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-22 11:01:13 +00:00
3c48822cec Merge pull request #1178 from dolanmiu/dependabot/npm_and_yarn/types/sinon-10.0.3
Bump @types/sinon from 10.0.2 to 10.0.3
2021-09-22 11:20:36 +01:00
547c05b05d Merge pull request #1177 from dolanmiu/dependabot/npm_and_yarn/types/chai-4.2.22
Bump @types/chai from 4.2.21 to 4.2.22
2021-09-22 11:20:29 +01:00
e5ba625820 Merge pull request #1176 from dolanmiu/dependabot/npm_and_yarn/ts-loader-9.2.6
Bump ts-loader from 9.2.5 to 9.2.6
2021-09-22 11:20:22 +01:00
45e644ac43 Merge pull request #1173 from dolanmiu/dependabot/npm_and_yarn/prismjs-1.25.0
Bump prismjs from 1.24.0 to 1.25.0
2021-09-22 11:19:58 +01:00
9b14b9c925 Merge pull request #1172 from anti-the-social/interface-fixes-connected-to-paragraph-options-
Separate paragraph style options interface for level
2021-09-22 11:18:38 +01:00
0bc55208ec Merge pull request #1171 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.22.4
Bump typedoc from 0.22.3 to 0.22.4
2021-09-22 11:18:06 +01:00
285eb0a85d Merge pull request #1170 from dolanmiu/dependabot/npm_and_yarn/types/node-16.9.4
Bump @types/node from 16.9.2 to 16.9.4
2021-09-22 11:17:56 +01:00
d521e20c0e Bump @types/sinon from 10.0.2 to 10.0.3
Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 10.0.2 to 10.0.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon)

---
updated-dependencies:
- dependency-name: "@types/sinon"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-21 11:02:42 +00:00
439f8ff4bc Bump @types/chai from 4.2.21 to 4.2.22
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.21 to 4.2.22.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

---
updated-dependencies:
- dependency-name: "@types/chai"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-21 11:02:06 +00:00
18791c99f5 Bump ts-loader from 9.2.5 to 9.2.6
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.2.5 to 9.2.6.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.2.5...v9.2.6)

---
updated-dependencies:
- dependency-name: ts-loader
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-21 11:01:49 +00:00
9991700701 Bump prismjs from 1.24.0 to 1.25.0
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.24.0 to 1.25.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.24.0...v1.25.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-20 21:38:30 +00:00
01bc6093dd Separate paragraph style options interface for level 2021-09-20 21:58:07 +03:00
5c08b889b1 Bump typedoc from 0.22.3 to 0.22.4
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.22.3 to 0.22.4.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.22.3...v0.22.4)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-20 11:01:50 +00:00
7944a7064e Bump @types/node from 16.9.2 to 16.9.4
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.9.2 to 16.9.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-20 11:01:32 +00:00
1713358f0c Merge pull request #1168 from askoufis/unequal-columns
Extend `Columns` API to allow specifying individual column widths/spacing
2021-09-20 10:00:20 +01:00
b6465e15de Merge pull request #1169 from dolanmiu/feat/set-correct-h-rule
Use correct value for height rule
2021-09-18 18:12:50 +01:00
5ca97ce96f Remove @types/jszip 2021-09-18 18:10:44 +01:00
5609b11188 Use correct value for height rule 2021-09-18 18:07:59 +01:00
eec084767f Fix lint and style errors 2021-09-18 23:14:13 +10:00
3a795401d1 Add demo file for columns with different widths 2021-09-18 23:09:45 +10:00
23fd3b483f Add API for specifying columns with different widths 2021-09-18 22:58:19 +10:00
a2566e92d2 Fix error message typos 2021-09-18 22:42:56 +10:00
bf884c8d13 Merge pull request #1158 from dolanmiu/dependabot/npm_and_yarn/typescript-4.4.3
Bump typescript from 4.4.2 to 4.4.3
2021-09-17 19:29:51 +01:00
dae2898496 Merge pull request #1165 from dolanmiu/dependabot/npm_and_yarn/minimist-1.2.5
Bump minimist from 1.2.0 to 1.2.5
2021-09-17 19:29:42 +01:00
9555ddd648 Bump typescript from 4.4.2 to 4.4.3
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.4.2 to 4.4.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.4.2...v4.4.3)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 12:13:28 +00:00
755895ebef Bump minimist from 1.2.0 to 1.2.5
Bumps [minimist](https://github.com/substack/minimist) from 1.2.0 to 1.2.5.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.0...1.2.5)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 12:12:09 +00:00
4283a6c7d9 Merge pull request #1166 from dolanmiu/dependabot/npm_and_yarn/types/node-16.9.2
Bump @types/node from 16.7.13 to 16.9.2
2021-09-17 13:11:44 +01:00
dd7439b45c Merge pull request #1167 from dolanmiu/dependabot/npm_and_yarn/webpack-5.53.0
Bump webpack from 5.52.0 to 5.53.0
2021-09-17 13:11:34 +01:00
b4c7ed2347 Merge pull request #1157 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.22.3
Bump typedoc from 0.21.9 to 0.22.3
2021-09-17 13:10:17 +01:00
9354b99897 Merge pull request #1163 from anti-the-social/attaching-numbering-to-custom-style
Attaching numbering to custom style
2021-09-17 13:09:47 +01:00
a1fbbde149 Bump webpack from 5.52.0 to 5.53.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.52.0 to 5.53.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.52.0...v5.53.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 11:01:51 +00:00
607087d256 Bump @types/node from 16.7.13 to 16.9.2
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.7.13 to 16.9.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-17 11:01:16 +00:00
7d50194cbf Merge pull request #1164 from dolanmiu/dependabot/npm_and_yarn/prettier-2.4.1
Bump prettier from 2.3.2 to 2.4.1
2021-09-16 13:09:53 +01:00
ab5c5c0fb7 Bump prettier from 2.3.2 to 2.4.1
Bumps [prettier](https://github.com/prettier/prettier) from 2.3.2 to 2.4.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.2...2.4.1)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-16 11:01:11 +00:00
bc1bca762e Demo on numbering attaching to custom styles 2021-09-16 13:21:21 +03:00
75290aeaf5 Adding numberingReplacer for styles.xml at next-compiler.ts 2021-09-16 13:03:34 +03:00
996594da9b Moving numbering from IParagraphPropertiesOptions to IParagraphStylePropertiesOptions 2021-09-16 13:01:47 +03:00
5018134e35 Merge pull request #1 from dolanmiu/master
Updating from docx's master
2021-09-13 15:26:33 +03:00
da9ebbdb9a Bump typedoc from 0.21.9 to 0.22.3
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.21.9 to 0.22.3.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Changelog](https://github.com/TypeStrong/typedoc/blob/master/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.21.9...v0.22.3)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-13 11:00:59 +00:00
eb5a4f9620 Merge pull request #1137 from dolanmiu/dependabot/npm_and_yarn/webpack-5.52.0
Bump webpack from 5.51.1 to 5.52.0
2021-09-08 01:57:57 +01:00
64cec50b84 Merge pull request #1140 from dolanmiu/dependabot/npm_and_yarn/types/node-16.7.13
Bump @types/node from 16.7.10 to 16.7.13
2021-09-08 01:34:14 +01:00
ce2a949176 Re-name PageRef to PageReference 2021-09-08 00:41:40 +01:00
ff7756f8c5 Bump @types/node from 16.7.10 to 16.7.13
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.7.10 to 16.7.13.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-07 11:01:33 +00:00
4221b9085a Bump webpack from 5.51.1 to 5.52.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.51.1 to 5.52.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.51.1...v5.52.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-06 11:01:32 +00:00
76e7f40bd2 Merge pull request #1131 from curvenote/fix/bookmark-types
Allow any `ParagraphChild` in `Bookmark`s
2021-09-02 03:31:05 +01:00
dc2f9c3bdc Allow other types in bookmarks 2021-09-01 12:20:54 -06:00
8eb5d6281e Merge pull request #1127 from dolanmiu/dependabot/npm_and_yarn/types/node-16.7.10
Bump @types/node from 16.7.8 to 16.7.10
2021-09-01 14:54:25 +01:00
6d09355174 Merge pull request #1129 from dolanmiu/dependabot/npm_and_yarn/typescript-4.4.2
Bump typescript from 4.3.5 to 4.4.2
2021-09-01 14:54:15 +01:00
4e3a2fd90f Bump typescript from 4.3.5 to 4.4.2
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.3.5 to 4.4.2.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.3.5...v4.4.2)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-01 11:01:36 +00:00
463c282568 Bump @types/node from 16.7.8 to 16.7.10
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.7.8 to 16.7.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-01 03:40:07 +00:00
8c0ff0422a Merge pull request #1125 from dolanmiu/dependabot/npm_and_yarn/types/node-16.7.8
Bump @types/node from 16.7.1 to 16.7.8
2021-09-01 04:39:13 +01:00
0fe1765b7f Merge pull request #1124 from dolanmiu/dependabot/npm_and_yarn/mocha-9.1.1
Bump mocha from 9.1.0 to 9.1.1
2021-09-01 04:39:06 +01:00
4accf65802 Merge pull request #1123 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.21.9
Bump typedoc from 0.21.6 to 0.21.9
2021-09-01 04:38:58 +01:00
c6eb11d535 Merge pull request #1117 from dolanmiu/dependabot/npm_and_yarn/prompt-1.2.0
Bump prompt from 1.1.0 to 1.2.0
2021-09-01 04:38:50 +01:00
58cfb427e9 Merge pull request #1114 from dolanmiu/dependabot/npm_and_yarn/tsconfig-paths-3.11.0
Bump tsconfig-paths from 3.10.1 to 3.11.0
2021-09-01 04:38:40 +01:00
90bb670de6 Merge pull request #1120 from curvenote/feat/children-hyperlink
ExternalHyperlink with multiple children
2021-09-01 04:37:45 +01:00
727e741b08 Hyperlink documentation 2021-08-31 19:54:57 -06:00
41f516d64b Make the internal hyperlink consistent 2021-08-31 19:54:33 -06:00
366cd2b4b1 Merge pull request #1121 from 1shaked/master
Update README.md
2021-09-01 02:35:58 +01:00
243d73542f Update demo 35 with new API 2021-08-31 18:55:38 -06:00
44520bc54b Bump @types/node from 16.7.1 to 16.7.8
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.7.1 to 16.7.8.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-31 11:01:41 +00:00
831ef9a98c Bump mocha from 9.1.0 to 9.1.1
Bumps [mocha](https://github.com/mochajs/mocha) from 9.1.0 to 9.1.1.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v9.1.0...v9.1.1)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-30 11:02:05 +00:00
bef9ea28f2 Bump typedoc from 0.21.6 to 0.21.9
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.21.6 to 0.21.9.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.21.6...v0.21.9)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-30 11:01:17 +00:00
7fa94b6996 Update README.md
fix typing error with the extra ;
2021-08-29 09:43:09 +03:00
c1cc211c7f Add children to hyperlink 2021-08-27 16:53:11 -06:00
9efee181ba Update tables.md 2021-08-27 10:12:08 +01:00
631f561441 Bump prompt from 1.1.0 to 1.2.0
Bumps [prompt](https://github.com/flatiron/prompt) from 1.1.0 to 1.2.0.
- [Release notes](https://github.com/flatiron/prompt/releases)
- [Changelog](https://github.com/flatiron/prompt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flatiron/prompt/commits)

---
updated-dependencies:
- dependency-name: prompt
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-26 11:01:05 +00:00
94592de477 Bump tsconfig-paths from 3.10.1 to 3.11.0
Bumps [tsconfig-paths](https://github.com/dividab/tsconfig-paths) from 3.10.1 to 3.11.0.
- [Release notes](https://github.com/dividab/tsconfig-paths/releases)
- [Changelog](https://github.com/dividab/tsconfig-paths/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dividab/tsconfig-paths/compare/v3.10.1...v3.11.0)

---
updated-dependencies:
- dependency-name: tsconfig-paths
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-25 11:01:05 +00:00
ac204a5189 Merge pull request #1112 from dolanmiu/dependabot/npm_and_yarn/types/node-16.7.1
Bump @types/node from 16.6.2 to 16.7.1
2021-08-24 18:31:18 +01:00
e48ca53660 Bump @types/node from 16.6.2 to 16.7.1
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.6.2 to 16.7.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-23 11:01:18 +00:00
5c2d4f729a Merge pull request #1104 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.21.6
Bump typedoc from 0.21.5 to 0.21.6
2021-08-21 23:29:50 +01:00
03d6636262 Merge pull request #1106 from dolanmiu/dependabot/npm_and_yarn/types/node-16.6.2
Bump @types/node from 16.6.1 to 16.6.2
2021-08-21 23:29:43 +01:00
74b3267294 Merge pull request #1109 from dolanmiu/dependabot/npm_and_yarn/webpack-5.51.1
Bump webpack from 5.50.0 to 5.51.1
2021-08-21 23:29:33 +01:00
83af11aa1b Merge pull request #1110 from dolanmiu/dependabot/npm_and_yarn/mocha-9.1.0
Bump mocha from 9.0.3 to 9.1.0
2021-08-21 23:29:27 +01:00
8cf9b83068 Bump mocha from 9.0.3 to 9.1.0
Bumps [mocha](https://github.com/mochajs/mocha) from 9.0.3 to 9.1.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v9.0.3...v9.1.0)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-20 11:01:29 +00:00
5dab97241e Bump webpack from 5.50.0 to 5.51.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.50.0 to 5.51.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.50.0...v5.51.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-20 11:01:10 +00:00
3b7394fe74 Bump @types/node from 16.6.1 to 16.6.2
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.6.1 to 16.6.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-19 11:01:36 +00:00
31c6f0a8ca Bump typedoc from 0.21.5 to 0.21.6
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.21.5 to 0.21.6.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.21.5...v0.21.6)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-19 11:01:01 +00:00
890983c1e1 Merge pull request #1097 from dolanmiu/dependabot/npm_and_yarn/webpack-cli-4.8.0
Bump webpack-cli from 4.7.2 to 4.8.0
2021-08-16 14:39:59 +01:00
e8db8ec669 Bump webpack-cli from 4.7.2 to 4.8.0
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.7.2 to 4.8.0.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.7.2...webpack-cli@4.8.0)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-16 11:01:26 +00:00
dcbe542fb2 Merge pull request #1070 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.21.5
Bump typedoc from 0.21.4 to 0.21.5
2021-08-14 02:40:47 +01:00
ca695ad122 Merge pull request #1075 from dolanmiu/dependabot/npm_and_yarn/ts-loader-9.2.5
Bump ts-loader from 9.2.4 to 9.2.5
2021-08-14 02:40:36 +01:00
60bd9a84dd Merge pull request #1080 from dolanmiu/dependabot/npm_and_yarn/jszip-3.7.1
Bump jszip from 3.7.0 to 3.7.1
2021-08-14 02:40:27 +01:00
ecc3b2ef3f Merge pull request #1094 from dolanmiu/dependabot/npm_and_yarn/types/node-16.6.1
Bump @types/node from 16.4.7 to 16.6.1
2021-08-14 02:40:05 +01:00
3e8d816614 Merge pull request #1090 from dolanmiu/dependabot/npm_and_yarn/path-parse-1.0.7
Bump path-parse from 1.0.6 to 1.0.7
2021-08-14 02:39:58 +01:00
dde54082d5 Merge pull request #1089 from dolanmiu/dependabot/npm_and_yarn/webpack-5.50.0
Bump webpack from 5.47.1 to 5.50.0
2021-08-14 02:39:51 +01:00
6845cd433f Merge pull request #1095 from dolanmiu/dependabot/npm_and_yarn/nanoid-3.1.25
Bump nanoid from 3.1.23 to 3.1.25
2021-08-14 02:39:42 +01:00
046ef0330a Bump nanoid from 3.1.23 to 3.1.25
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.23 to 3.1.25.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.23...3.1.25)

---
updated-dependencies:
- dependency-name: nanoid
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-13 11:01:19 +00:00
fcd0427fe4 Bump @types/node from 16.4.7 to 16.6.1
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.4.7 to 16.6.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-13 11:01:03 +00:00
4c4e253883 Bump path-parse from 1.0.6 to 1.0.7
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-11 14:02:37 +00:00
3a9f09b578 Bump webpack from 5.47.1 to 5.50.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.47.1 to 5.50.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.47.1...v5.50.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-11 11:01:26 +00:00
e9aea8b8a9 Bump jszip from 3.7.0 to 3.7.1
Bumps [jszip](https://github.com/Stuk/jszip) from 3.7.0 to 3.7.1.
- [Release notes](https://github.com/Stuk/jszip/releases)
- [Changelog](https://github.com/Stuk/jszip/blob/master/CHANGES.md)
- [Commits](https://github.com/Stuk/jszip/compare/v3.7.0...v3.7.1)

---
updated-dependencies:
- dependency-name: jszip
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-06 11:01:03 +00:00
5c9b5e4322 Merge pull request #1074 from LeSuisse/pageref-element
Add the pageref element
2021-08-06 04:02:37 +01:00
33d6544aba Bump ts-loader from 9.2.4 to 9.2.5
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.2.4 to 9.2.5.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.2.4...v9.2.5)

---
updated-dependencies:
- dependency-name: ts-loader
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-04 11:01:07 +00:00
3f257bf5a4 Add the pageref element
This instruction is useful if you want to get the number of the page
containing a specific bookmark.
2021-08-03 21:17:32 +02:00
1ff31a2a42 Bump typedoc from 0.21.4 to 0.21.5
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.21.4 to 0.21.5.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.21.4...v0.21.5)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-02 11:01:11 +00:00
14013273af Merge pull request #1057 from anti-the-social/Numbering-start-from-number-doesn't-work
Numbering start from number doesn't work fix
2021-08-01 20:57:14 +01:00
b34127665c Merge pull request #1069 from dolanmiu/dependabot/npm_and_yarn/types/node-16.4.7
Bump @types/node from 16.4.6 to 16.4.7
2021-07-30 19:00:54 +01:00
0fcd02aea8 Merge pull request #1068 from dolanmiu/dependabot/npm_and_yarn/webpack-5.47.1
Bump webpack from 5.47.0 to 5.47.1
2021-07-30 19:00:45 +01:00
d773148218 Bump @types/node from 16.4.6 to 16.4.7
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.4.6 to 16.4.7.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-30 11:01:49 +00:00
d52bf7b57d Bump webpack from 5.47.0 to 5.47.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.47.0 to 5.47.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.47.0...v5.47.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-30 11:01:30 +00:00
f378c37b62 Test at spec.ts for referenceConfigMap 2021-07-30 11:59:49 +03:00
d773972877 Test coverage issue fix 2021-07-30 11:58:55 +03:00
738b36b6a9 Merge pull request #1062 from grahampcharles/master
updated tab stops docs
2021-07-30 03:59:35 +01:00
ad7ef22b63 Merge pull request #1067 from dolanmiu/dependabot/npm_and_yarn/types/node-16.4.6
Bump @types/node from 16.4.1 to 16.4.6
2021-07-30 03:54:56 +01:00
e73e1f98f9 Merge pull request #1060 from dolanmiu/dependabot/npm_and_yarn/mocha-9.0.3
Bump mocha from 9.0.2 to 9.0.3
2021-07-30 03:54:44 +01:00
738e374bf2 Merge pull request #1065 from dolanmiu/dependabot/npm_and_yarn/sinon-11.1.2
Bump sinon from 11.1.1 to 11.1.2
2021-07-30 03:54:36 +01:00
c5861129c9 Merge pull request #1059 from dolanmiu/dependabot/npm_and_yarn/ts-loader-9.2.4
Bump ts-loader from 9.2.3 to 9.2.4
2021-07-30 03:54:29 +01:00
5f4c595a1a Merge pull request #1063 from dolanmiu/dependabot/npm_and_yarn/webpack-5.47.0
Bump webpack from 5.46.0 to 5.47.0
2021-07-30 03:54:12 +01:00
238b8b9a8d Merge pull request #1058 from dolanmiu/dependabot/npm_and_yarn/jszip-3.7.0
Bump jszip from 3.6.0 to 3.7.0
2021-07-30 03:53:15 +01:00
a92f3a7ba1 Bump @types/node from 16.4.1 to 16.4.6
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.4.1 to 16.4.6.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-29 11:01:25 +00:00
2a1685ab82 Bump sinon from 11.1.1 to 11.1.2
Bumps [sinon](https://github.com/sinonjs/sinon) from 11.1.1 to 11.1.2.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/commits)

---
updated-dependencies:
- dependency-name: sinon
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-28 11:01:51 +00:00
0088d58fea Bump webpack from 5.46.0 to 5.47.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.46.0 to 5.47.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.46.0...v5.47.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-28 11:01:07 +00:00
cbf4f828ab Merge branch 'master' of https://github.com/grahampcharles/docx 2021-07-27 22:16:30 -07:00
2ccf27162e updated tab stops docs 2021-07-27 22:16:21 -07:00
5dffda8c7c Merge branch 'dolanmiu:master' into master 2021-07-27 22:13:05 -07:00
e1c777738b Update tab-stops.md
corrected docs to reflect declarative style for tab stops; removed tab() and bold()
2021-07-27 22:11:46 -07:00
0f531b2a9b Additional demo on use of start & instance numbers 2021-07-26 14:22:59 +03:00
d523b2dae7 Bump mocha from 9.0.2 to 9.0.3
Bumps [mocha](https://github.com/mochajs/mocha) from 9.0.2 to 9.0.3.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v9.0.2...v9.0.3)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-26 11:01:36 +00:00
f50c7f20cb Bump ts-loader from 9.2.3 to 9.2.4
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.2.3 to 9.2.4.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.2.3...v9.2.4)

---
updated-dependencies:
- dependency-name: ts-loader
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-26 11:01:19 +00:00
f21fb06467 Bump jszip from 3.6.0 to 3.7.0
Bumps [jszip](https://github.com/Stuk/jszip) from 3.6.0 to 3.7.0.
- [Release notes](https://github.com/Stuk/jszip/releases)
- [Changelog](https://github.com/Stuk/jszip/blob/master/CHANGES.md)
- [Commits](https://github.com/Stuk/jszip/commits)

---
updated-dependencies:
- dependency-name: jszip
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-26 11:01:05 +00:00
2fd4f064ae Simplify + TS related fix 2021-07-26 13:28:55 +03:00
36a18c5af3 Use level.start for overrideLevel.start if possible
Implemented via additional reference config map.
2021-07-26 09:55:33 +03:00
75587df420 Merge pull request #1056 from dolanmiu/dependabot/npm_and_yarn/types/node-16.4.1
Bump @types/node from 16.4.0 to 16.4.1
2021-07-23 16:13:44 +01:00
43ea0bd406 Merge pull request #1055 from dolanmiu/dependabot/npm_and_yarn/types/mocha-9.0.0
Bump @types/mocha from 8.2.3 to 9.0.0
2021-07-23 16:13:38 +01:00
ec2ad99e95 Bump @types/node from 16.4.0 to 16.4.1
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.4.0 to 16.4.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-23 11:01:44 +00:00
46deaa5a4a Bump @types/mocha from 8.2.3 to 9.0.0
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.2.3 to 9.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

---
updated-dependencies:
- dependency-name: "@types/mocha"
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-23 11:01:09 +00:00
697baa3fd6 Merge pull request #1051 from dolanmiu/dependabot/npm_and_yarn/types/node-16.4.0
Bump @types/node from 16.3.3 to 16.4.0
2021-07-22 18:20:59 +01:00
15829b53a6 Merge pull request #1054 from dolanmiu/dependabot/npm_and_yarn/webpack-5.46.0
Bump webpack from 5.45.1 to 5.46.0
2021-07-22 18:20:21 +01:00
56f1e4408a Bump webpack from 5.45.1 to 5.46.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.45.1 to 5.46.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.45.1...v5.46.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-22 11:01:09 +00:00
689d4d07bc Bump @types/node from 16.3.3 to 16.4.0
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.3.3 to 16.4.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-21 11:01:23 +00:00
b0049d8221 Merge pull request #1050 from dolanmiu/dependabot/npm_and_yarn/types/node-16.3.3
Bump @types/node from 16.0.0 to 16.3.3
2021-07-19 23:12:02 +01:00
152a11d7fc Merge pull request #1049 from dolanmiu/dependabot/npm_and_yarn/webpack-5.45.1
Bump webpack from 5.44.0 to 5.45.1
2021-07-19 23:11:55 +01:00
31171330a2 Bump @types/node from 16.0.0 to 16.3.3
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 16.0.0 to 16.3.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-19 11:01:37 +00:00
3c0032cf68 Bump webpack from 5.44.0 to 5.45.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.44.0 to 5.45.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.44.0...v5.45.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-19 11:01:21 +00:00
0e44af1c06 Merge pull request #1039 from dolanmiu/dependabot/npm_and_yarn/types/chai-4.2.21
Bump @types/chai from 4.2.19 to 4.2.21
2021-07-14 01:23:52 +01:00
39893a984c Merge pull request #1038 from dolanmiu/dependabot/npm_and_yarn/webpack-5.44.0
Bump webpack from 5.42.1 to 5.44.0
2021-07-14 01:23:42 +01:00
b75e194993 Merge pull request #1029 from dolanmiu/dependabot/npm_and_yarn/tsconfig-paths-3.10.1
Bump tsconfig-paths from 3.9.0 to 3.10.1
2021-07-14 01:23:32 +01:00
9fb58a5852 Merge pull request #1035 from dolanmiu/dependabot/npm_and_yarn/types/request-promise-4.1.48
Bump @types/request-promise from 4.1.47 to 4.1.48
2021-07-14 01:23:18 +01:00
5c578a6bea Merge pull request #1041 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.21.4
Bump typedoc from 0.21.2 to 0.21.4
2021-07-14 01:23:09 +01:00
3ba197a289 Merge pull request #1037 from byoungd/master
docs:fix typo change fro0oum to from
2021-07-14 01:22:56 +01:00
bbf50c34a0 Bump typedoc from 0.21.2 to 0.21.4
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.21.2 to 0.21.4.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.21.2...v0.21.4)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-12 11:01:20 +00:00
6b6f2214f6 Bump @types/chai from 4.2.19 to 4.2.21
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.19 to 4.2.21.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

---
updated-dependencies:
- dependency-name: "@types/chai"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-09 11:01:41 +00:00
836ffd683f Bump webpack from 5.42.1 to 5.44.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.42.1 to 5.44.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.42.1...v5.44.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-09 11:01:17 +00:00
6c94a1382c docs:fix typo change fro0oum to from 2021-07-09 15:28:22 +08:00
c13cac899a Bump @types/request-promise from 4.1.47 to 4.1.48
Bumps [@types/request-promise](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/request-promise) from 4.1.47 to 4.1.48.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/request-promise)

---
updated-dependencies:
- dependency-name: "@types/request-promise"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-08 11:01:28 +00:00
ec1f9d5ecf Merge pull request #1028 from dolanmiu/dependabot/npm_and_yarn/types/mocha-8.2.3
Bump @types/mocha from 8.2.2 to 8.2.3
2021-07-08 11:58:26 +01:00
a8115ff964 Merge pull request #1031 from askoufis/column-break
Export new `ColumnBreak` class via more generic `Break` class
2021-07-08 10:10:16 +01:00
da744cbdec Fix lint errors 2021-07-08 17:46:13 +10:00
439ab8441e Export new ColumnBreak class via more generic Break class 2021-07-08 17:39:21 +10:00
15b14579e6 Bump tsconfig-paths from 3.9.0 to 3.10.1
Bumps [tsconfig-paths](https://github.com/dividab/tsconfig-paths) from 3.9.0 to 3.10.1.
- [Release notes](https://github.com/dividab/tsconfig-paths/releases)
- [Changelog](https://github.com/dividab/tsconfig-paths/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dividab/tsconfig-paths/compare/v3.9.0...v3.10.1)

---
updated-dependencies:
- dependency-name: tsconfig-paths
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-07 11:02:00 +00:00
1cb666fd03 Bump @types/mocha from 8.2.2 to 8.2.3
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.2.2 to 8.2.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

---
updated-dependencies:
- dependency-name: "@types/mocha"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-07 11:01:28 +00:00
bde4aa4657 Merge pull request #1011 from dolanmiu/dependabot/npm_and_yarn/prismjs-1.24.0
Bump prismjs from 1.23.0 to 1.24.0
2021-07-07 11:37:27 +01:00
709876a02d Merge pull request #1001 from dolanmiu/dependabot/npm_and_yarn/types/chai-4.2.19
Bump @types/chai from 4.2.18 to 4.2.19
2021-07-07 11:37:15 +01:00
a0b74f24e3 Merge pull request #1024 from dolanmiu/dependabot/npm_and_yarn/webpack-5.42.1
Bump webpack from 5.42.0 to 5.42.1
2021-07-07 11:30:32 +01:00
ed15614023 Bump webpack from 5.42.0 to 5.42.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.42.0 to 5.42.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.42.0...v5.42.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-06 11:01:13 +00:00
c3e97a0aab Merge pull request #1020 from dolanmiu/dependabot/npm_and_yarn/types/node-16.0.0
Bump @types/node from 15.14.0 to 16.0.0
2021-07-05 12:13:35 +01:00
b69968a99c Merge pull request #1021 from dolanmiu/dependabot/npm_and_yarn/mocha-9.0.2
Bump mocha from 8.4.0 to 9.0.2
2021-07-05 12:13:27 +01:00
82b12a99b9 Bump mocha from 8.4.0 to 9.0.2
Bumps [mocha](https://github.com/mochajs/mocha) from 8.4.0 to 9.0.2.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v8.4.0...v9.0.2)

---
updated-dependencies:
- dependency-name: mocha
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-05 11:01:45 +00:00
1486519a98 Bump @types/node from 15.14.0 to 16.0.0
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.14.0 to 16.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-05 11:01:27 +00:00
7e194350d8 Merge pull request #1019 from dolanmiu/dependabot/npm_and_yarn/types/node-15.14.0
Bump @types/node from 15.12.2 to 15.14.0
2021-07-02 17:45:57 +01:00
855c47954e Merge pull request #1018 from dolanmiu/dependabot/npm_and_yarn/webpack-5.42.0
Bump webpack from 5.41.1 to 5.42.0
2021-07-02 17:45:44 +01:00
dd3300506b Bump @types/node from 15.12.2 to 15.14.0
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.12.2 to 15.14.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-02 11:01:42 +00:00
154c7cb54b Bump webpack from 5.41.1 to 5.42.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.41.1 to 5.42.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.41.1...v5.42.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-02 11:01:00 +00:00
cd75c2e860 Merge pull request #1008 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.21.2
Bump typedoc from 0.21.1 to 0.21.2
2021-07-01 16:57:16 +01:00
1b0f19d570 Bump typedoc from 0.21.1 to 0.21.2
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.21.1 to 0.21.2.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.21.1...v0.21.2)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-01 13:27:12 +00:00
45026eb30e Merge pull request #1015 from dolanmiu/dependabot/npm_and_yarn/typescript-4.3.5
Bump typescript from 4.2.4 to 4.3.5
2021-07-01 14:26:17 +01:00
aeddcc7478 Merge pull request #1016 from dolanmiu/feat/codecov
Add codecov check
2021-07-01 14:25:18 +01:00
f88b588b60 Fix codecov yml 2021-07-01 13:08:50 +01:00
f00844ad1b Add codecov check 2021-07-01 12:55:43 +01:00
8e87437272 Bump typescript from 4.2.4 to 4.3.5
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.4 to 4.3.5.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/compare/v4.2.4...v4.3.5)

---
updated-dependencies:
- dependency-name: typescript
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-01 11:01:12 +00:00
49b011280c Merge pull request #1014 from dolanmiu/dependabot/npm_and_yarn/webpack-5.41.1
Bump webpack from 5.39.0 to 5.41.1
2021-07-01 10:04:44 +01:00
37b94eeedc Bump webpack from 5.39.0 to 5.41.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.39.0 to 5.41.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.39.0...v5.41.1)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-30 11:53:01 +00:00
4053b5bbc2 Bump prismjs from 1.23.0 to 1.24.0
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.23.0 to 1.24.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.23.0...v1.24.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-28 19:27:18 +00:00
46972a861d Merge pull request #1009 from dolanmiu/dependabot/npm_and_yarn/prettier-2.3.2
Bump prettier from 2.3.1 to 2.3.2
2021-06-28 12:20:33 +01:00
528dab5c10 Bump prettier from 2.3.1 to 2.3.2
Bumps [prettier](https://github.com/prettier/prettier) from 2.3.1 to 2.3.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.3.1...2.3.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-28 11:02:05 +00:00
d1ffc0bffa Merge pull request #1006 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.21.1
Bump typedoc from 0.20.36 to 0.21.1
2021-06-26 00:06:18 +01:00
3741dd7ef2 Bump typedoc from 0.20.36 to 0.21.1
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.20.36 to 0.21.1.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.20.36...v0.21.1)

---
updated-dependencies:
- dependency-name: typedoc
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-25 11:01:44 +00:00
c6c4b0cbcd Bump @types/chai from 4.2.18 to 4.2.19
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.18 to 4.2.19.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

---
updated-dependencies:
- dependency-name: "@types/chai"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-21 11:01:10 +00:00
804380f70e Merge pull request #1000 from dolanmiu/revert-994-patch-1
Revert "wrong border property"
2021-06-18 23:57:21 +01:00
118f60f704 Revert "wrong border property" 2021-06-18 23:56:41 +01:00
d556f97dbe Merge pull request #994 from yaniv14/patch-1
wrong border property
2021-06-18 23:55:59 +01:00
b116b0a268 wrong border property
based on IBorderPropertyOptions available properties are: color, space, value, size
2021-06-16 10:55:22 +03:00
99f0297c4f Merge pull request #992 from dolanmiu/dependabot/npm_and_yarn/webpack-5.39.0
Bump webpack from 5.38.1 to 5.39.0
2021-06-15 16:55:47 +01:00
4543016869 Bump webpack from 5.38.1 to 5.39.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.38.1 to 5.39.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.38.1...v5.39.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-15 05:02:56 +00:00
2b9c15a638 Upgrade prettier 2021-06-15 00:25:44 +01:00
4ca5ea6046 Merge pull request #983 from dolanmiu/dependabot/npm_and_yarn/normalize-url-4.5.1
Bump normalize-url from 4.5.0 to 4.5.1
2021-06-09 14:23:03 +01:00
2de55a1eb3 Bump normalize-url from 4.5.0 to 4.5.1
Bumps [normalize-url](https://github.com/sindresorhus/normalize-url) from 4.5.0 to 4.5.1.
- [Release notes](https://github.com/sindresorhus/normalize-url/releases)
- [Commits](https://github.com/sindresorhus/normalize-url/commits)

---
updated-dependencies:
- dependency-name: normalize-url
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-09 00:01:47 +00:00
db20efa95b Merge pull request #982 from dolanmiu/dependabot/npm_and_yarn/webpack-cli-4.7.2
Bump webpack-cli from 4.7.0 to 4.7.2
2021-06-09 01:01:27 +01:00
3822d8139d Merge pull request #981 from dolanmiu/dependabot/npm_and_yarn/types/node-15.12.2
Bump @types/node from 15.12.0 to 15.12.2
2021-06-09 01:01:20 +01:00
3a65f383e4 Merge pull request #974 from dolanmiu/dependabot/npm_and_yarn/ts-loader-9.2.3
Bump ts-loader from 9.2.2 to 9.2.3
2021-06-09 01:01:07 +01:00
d05fef6b93 Bump webpack-cli from 4.7.0 to 4.7.2
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.7.0 to 4.7.2.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.7.0...webpack-cli@4.7.2)

---
updated-dependencies:
- dependency-name: webpack-cli
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-08 05:04:39 +00:00
f02b6211a3 Bump @types/node from 15.12.0 to 15.12.2
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.12.0 to 15.12.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-08 05:03:09 +00:00
4b4f67f9c7 Bump ts-loader from 9.2.2 to 9.2.3
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.2.2 to 9.2.3.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.2.2...v9.2.3)

---
updated-dependencies:
- dependency-name: ts-loader
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-07 05:20:03 +00:00
9f38e33a48 Merge pull request #972 from dolanmiu/dependabot/npm_and_yarn/types/node-15.12.0
Bump @types/node from 15.9.0 to 15.12.0
2021-06-05 14:55:59 +01:00
69ca5d8b0c Bump @types/node from 15.9.0 to 15.12.0
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.9.0 to 15.12.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-04 05:06:41 +00:00
809474e9c5 Merge pull request #971 from dolanmiu/dependabot/npm_and_yarn/types/sinon-10.0.2
Bump @types/sinon from 10.0.1 to 10.0.2
2021-06-03 10:42:18 +01:00
e5b56c4214 Merge pull request #970 from dolanmiu/dependabot/npm_and_yarn/types/node-15.9.0
Bump @types/node from 15.6.1 to 15.9.0
2021-06-03 10:42:07 +01:00
568a27367a Bump @types/sinon from 10.0.1 to 10.0.2
Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 10.0.1 to 10.0.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon)

---
updated-dependencies:
- dependency-name: "@types/sinon"
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-03 05:05:11 +00:00
c6f99fcbe5 Bump @types/node from 15.6.1 to 15.9.0
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.6.1 to 15.9.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

---
updated-dependencies:
- dependency-name: "@types/node"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-03 05:03:12 +00:00
309abbcc47 Update .nycrc 2021-06-01 11:56:07 +01:00
de145e0623 Merge pull request #956 from devoidfury/experiment
v7 prep - includes redesigning parts of core, and unifying different types
2021-06-01 01:12:32 +01:00
7f24abd104 Merge pull request #968 from dolanmiu/dependabot/npm_and_yarn/ws-7.4.6
Bump ws from 7.4.4 to 7.4.6
2021-05-31 02:17:12 +01:00
edafbdb1ff Bump ws from 7.4.4 to 7.4.6
Bumps [ws](https://github.com/websockets/ws) from 7.4.4 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.4...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-29 17:20:46 +00:00
034cd187ab change shading val -> type 2021-05-29 05:51:06 +03:00
8f04e0da4a Merge pull request #967 from dolanmiu/dependabot/npm_and_yarn/webpack-5.38.1
Bump webpack from 5.37.1 to 5.38.1
2021-05-28 10:13:53 +01:00
90b8b8140b Bump webpack from 5.37.1 to 5.38.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.37.1 to 5.38.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.37.1...v5.38.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-28 05:03:07 +00:00
0b28bf02c4 Merge pull request #966 from dolanmiu/dependabot/npm_and_yarn/sinon-11.1.1
Bump sinon from 11.0.0 to 11.1.1
2021-05-27 11:36:04 +01:00
2b169fc63a Merge pull request #965 from dolanmiu/dependabot/npm_and_yarn/types/sinon-10.0.1
Bump @types/sinon from 10.0.0 to 10.0.1
2021-05-27 11:35:56 +01:00
e2bb50d6ad Bump sinon from 11.0.0 to 11.1.1
Bumps [sinon](https://github.com/sinonjs/sinon) from 11.0.0 to 11.1.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v11.0.0...v11.1.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-27 05:02:28 +00:00
730e33b164 fix demos 2021-05-26 10:53:27 +03:00
6603aafa38 fix "missing export NumberFormat" 2021-05-26 10:19:26 +03:00
05a6ab77cc improve test coverage 2021-05-26 10:14:19 +03:00
5a52541136 add xsd comments to file/drawing 2021-05-26 09:28:31 +03:00
e4709a7f8d simplify core-properties; add xsd comment 2021-05-26 09:27:05 +03:00
60b7ce4785 clean up settings; BREAKING: TableOfContents requires Document features.updateFields = true setting 2021-05-26 08:36:05 +03:00
fd4afea9aa Bump @types/sinon from 10.0.0 to 10.0.1
Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 10.0.0 to 10.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-26 05:03:32 +00:00
04d88fa592 Merge pull request #962 from dolanmiu/dependabot/npm_and_yarn/sinon-11.0.0
Bump sinon from 10.0.1 to 11.0.0
2021-05-25 10:49:05 +01:00
87000d8656 Merge pull request #963 from dolanmiu/dependabot/npm_and_yarn/types/node-15.6.1
Bump @types/node from 15.6.0 to 15.6.1
2021-05-25 10:48:54 +01:00
776132ede0 Bump @types/node from 15.6.0 to 15.6.1
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.6.0 to 15.6.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-25 05:03:33 +00:00
b845e4daee Bump sinon from 10.0.1 to 11.0.0
Bumps [sinon](https://github.com/sinonjs/sinon) from 10.0.1 to 11.0.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/commits)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-25 05:02:29 +00:00
da61a30eb8 fix measurementOrPercentValue definition to include UniversalMeasure values 2021-05-25 05:05:33 +03:00
3a02bc087c fix demos. BREAKING: PageNumberFormat enum renamed to NumberFormat 2021-05-25 04:46:10 +03:00
b05748da25 update file/styles 2021-05-25 04:27:10 +03:00
63cea76eac update file/document and section-properties 2021-05-25 03:43:16 +03:00
e198f0752a add schema comments and update file/document; unify VerticalAlign type 2021-05-24 21:06:34 +03:00
22e62ed950 add NumberValueElement, representing a simple element with a single number value <foo w:val="1234"/> 2021-05-24 21:05:29 +03:00
c3e92c0709 update file/numbering with schema comments and values functions 2021-05-24 21:04:38 +03:00
d0036e64b5 Add additional values functions for defined types 2021-05-24 21:03:37 +03:00
7bfe8f26f0 progress on clean up file/paragraph 2021-05-24 17:12:10 +03:00
4274c7674c Merge pull request #957 from dolanmiu/dependabot/npm_and_yarn/ts-loader-9.2.2
Bump ts-loader from 9.2.1 to 9.2.2
2021-05-24 15:12:03 +01:00
8505e04e58 Merge pull request #959 from dolanmiu/dependabot/npm_and_yarn/types/node-15.6.0
Bump @types/node from 15.3.1 to 15.6.0
2021-05-24 15:11:53 +01:00
4466145d00 add values checks to remaining file/table code 2021-05-24 12:04:06 +03:00
ce2a0fb864 remove more duplicate classes; add additional values functions; clean up tests 2021-05-24 11:28:10 +03:00
a56119e7cd remove deprecated mutable drawing functions: scale, setXY 2021-05-24 09:26:21 +03:00
56eecef1a8 add tests for values functions 2021-05-24 09:13:46 +03:00
097c6a5962 use hexColorValue in borders and underlines 2021-05-24 08:42:34 +03:00
ee105cdb83 Simplify run format properties, removing duplicate classes. Add values functions, which check and clean up values for specific defined types from the schema 2021-05-24 08:20:08 +03:00
7891402c72 Bump @types/node from 15.3.1 to 15.6.0
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.3.1 to 15.6.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 05:12:01 +00:00
bde13193d5 Bump ts-loader from 9.2.1 to 9.2.2
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.2.1 to 9.2.2.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.2.1...v9.2.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 05:09:20 +00:00
449e1ed963 add test for table indent property 2021-05-24 05:39:26 +03:00
dd6d1bc039 Consolidate TableWidth and TableCellMargins types; add Table indent (#954) 2021-05-24 05:39:26 +03:00
528be93191 fix #507 - docx file not opening in edit mode in word and word online 2021-05-24 05:39:26 +03:00
1ea6017483 add test for floating vertical position 2021-05-24 05:39:26 +03:00
08bd2744b6 further clean up border code; update paragraph borders to use shared type; BREAKING: paragraph border value attr renamed to style, to match other usages of borders 2021-05-24 05:39:26 +03:00
54ab55b92c simplify section-properties 2021-05-24 05:39:26 +03:00
5155cdaf45 unify Border type 2021-05-24 05:39:26 +03:00
496fcb55fa unify Shading; breaking change: Paragraph/Run shading option key type changed to val, and shadow alias removed 2021-05-24 05:39:26 +03:00
fcc393aca2 move break up higher in order, to use the simpler push instead of splice 2021-05-24 05:39:26 +03:00
2611e0c74f update table-row-properties, table-cell-properties, table-cell-borders to declarative style 2021-05-24 05:39:26 +03:00
acc23be297 remove unnecessary function expression in prepForXml 2021-05-24 05:39:26 +03:00
bdc0aa26ea fix test descriptions 2021-05-24 05:39:26 +03:00
ff14fcae3a remove from API delete()/IsDeleted(), and deleted check from prepForXml; not useful in declarative style API 2021-05-24 05:39:26 +03:00
37d099b457 Merge pull request #948 from devoidfury/bug/ooxml-conformance-fixes
Better conformance to Office Open XML schema
2021-05-24 01:45:36 +01:00
0344eb8e27 Merge pull request #949 from dolanmiu/dependabot/npm_and_yarn/ts-loader-9.2.1
Bump ts-loader from 9.2.0 to 9.2.1
2021-05-21 15:25:33 +01:00
403e7a4228 Merge pull request #950 from dolanmiu/dependabot/npm_and_yarn/types/node-15.3.1
Bump @types/node from 15.3.0 to 15.3.1
2021-05-21 15:25:24 +01:00
aa336dc652 Merge pull request #951 from dolanmiu/dependabot/npm_and_yarn/webpack-5.37.1
Bump webpack from 5.37.0 to 5.37.1
2021-05-21 15:25:16 +01:00
d8fca42eb7 Bump webpack from 5.37.0 to 5.37.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.37.0 to 5.37.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.37.0...v5.37.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-20 05:04:10 +00:00
10d1d15f73 Bump @types/node from 15.3.0 to 15.3.1
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.3.0 to 15.3.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-20 05:03:36 +00:00
ac55e0fcb3 Bump ts-loader from 9.2.0 to 9.2.1
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.2.0 to 9.2.1.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.2.0...v9.2.1)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-20 05:02:57 +00:00
780682a8f7 add test for ExternalStylesFactory when styles element is missing, to bump coverage 2021-05-20 05:03:12 +03:00
b627f0982a fix ordering of elements in w:lvl 2021-05-20 04:20:14 +03:00
798cbb8628 fix prettier issues 2021-05-20 04:08:00 +03:00
15f79abf5e fix lint issues 2021-05-20 04:02:14 +03:00
f5e35603ef remove invalid w:mirrorMargins attribute from w:pgMar 2021-05-20 03:42:10 +03:00
06da596ffb Remove invalid 'w:shdCs' element 2021-05-20 03:02:48 +03:00
4593464a15 Merge pull request #946 from dolanmiu/dependabot/npm_and_yarn/ts-loader-9.2.0
Bump ts-loader from 9.1.2 to 9.2.0
2021-05-20 00:38:49 +01:00
30912e7aaf Fix ordering of elements in table-cell-borders and section-properties 2021-05-20 02:18:17 +03:00
56b18d3793 Fix ordering of elements in paragraph-properties 2021-05-20 01:06:07 +03:00
d0a675fde6 Fix ordering of elements in table, table-cell, table-properties, table-cell-properties, table-cell-margin 2021-05-20 01:03:09 +03:00
45130bed0b Fix conformance issues with imagerun - out of order properties (a:xfrm), invalid attr name (pic:cNvPr) desc -> descr 2021-05-20 00:42:29 +03:00
faefb0d2a8 Bump ts-loader from 9.1.2 to 9.2.0
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.1.2 to 9.2.0.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.1.2...v9.2.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-19 05:02:38 +00:00
c4b7a7094b Merge pull request #944 from devoidfury/fix/docs-update
Updates and fixes for documentation
2021-05-18 18:18:38 +01:00
d527013451 Update outdated docs to show current usage 2021-05-18 17:16:10 +03:00
bb8ac8b9d8 Fix broken links in documentation. 2021-05-18 17:15:29 +03:00
cdc97adaeb Merge pull request #942 from dolanmiu/dependabot/npm_and_yarn/types/node-15.3.0
Bump @types/node from 15.0.3 to 15.3.0
2021-05-17 10:11:18 +01:00
72f0ad9fdb Bump @types/node from 15.0.3 to 15.3.0
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.0.3 to 15.3.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-17 05:09:00 +00:00
0f55d70a19 Merge pull request #941 from dolanmiu/dependabot/npm_and_yarn/types/node-15.0.3
Bump @types/node from 15.0.2 to 15.0.3
2021-05-14 00:22:10 +01:00
6ac0375400 Bump @types/node from 15.0.2 to 15.0.3
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.0.2 to 15.0.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-13 05:03:14 +00:00
9048f8f271 Merge pull request #938 from dolanmiu/dependabot/npm_and_yarn/webpack-5.37.0
Bump webpack from 5.36.2 to 5.37.0
2021-05-11 21:46:59 +01:00
23eaff2dab Merge pull request #939 from dolanmiu/dependabot/npm_and_yarn/nanoid-3.1.23
Bump nanoid from 3.1.22 to 3.1.23
2021-05-11 21:46:50 +01:00
df4a381135 Bump nanoid from 3.1.22 to 3.1.23
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.22 to 3.1.23.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.22...3.1.23)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 05:03:44 +00:00
41dcf363b4 Bump webpack from 5.36.2 to 5.37.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.36.2 to 5.37.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.36.2...v5.37.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 05:03:10 +00:00
f143c017cb Merge pull request #935 from dolanmiu/dependabot/npm_and_yarn/mocha-8.4.0
Bump mocha from 8.3.2 to 8.4.0
2021-05-11 00:52:56 +01:00
7463c0301f Merge pull request #936 from dolanmiu/dependabot/npm_and_yarn/types/chai-4.2.18
Bump @types/chai from 4.2.17 to 4.2.18
2021-05-11 00:52:40 +01:00
bb24c50bf4 Bump @types/chai from 4.2.17 to 4.2.18
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.17 to 4.2.18.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-10 05:08:32 +00:00
70538a8062 Bump mocha from 8.3.2 to 8.4.0
Bumps [mocha](https://github.com/mochajs/mocha) from 8.3.2 to 8.4.0.
- [Release notes](https://github.com/mochajs/mocha/releases)
- [Changelog](https://github.com/mochajs/mocha/blob/master/CHANGELOG.md)
- [Commits](https://github.com/mochajs/mocha/compare/v8.3.2...v8.4.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-10 05:06:52 +00:00
085db9350c Merge pull request #934 from dolanmiu/dependabot/npm_and_yarn/lodash-4.17.21
Bump lodash from 4.17.19 to 4.17.21
2021-05-09 15:27:14 +01:00
eabdefdaf4 Bump lodash from 4.17.19 to 4.17.21
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-07 22:52:42 +00:00
9fc8e50691 Merge pull request #931 from dolanmiu/dependabot/npm_and_yarn/webpack-cli-4.7.0
Bump webpack-cli from 4.6.0 to 4.7.0
2021-05-07 23:52:07 +01:00
dfc01f2d5a Merge pull request #932 from dolanmiu/dependabot/npm_and_yarn/glob-7.1.7
Bump glob from 7.1.6 to 7.1.7
2021-05-07 23:51:57 +01:00
4e8aec9a0e Bump glob from 7.1.6 to 7.1.7
Bumps [glob](https://github.com/isaacs/node-glob) from 7.1.6 to 7.1.7.
- [Release notes](https://github.com/isaacs/node-glob/releases)
- [Changelog](https://github.com/isaacs/node-glob/blob/master/changelog.md)
- [Commits](https://github.com/isaacs/node-glob/compare/v7.1.6...v7.1.7)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-07 05:03:27 +00:00
c7e0554817 Bump webpack-cli from 4.6.0 to 4.7.0
Bumps [webpack-cli](https://github.com/webpack/webpack-cli) from 4.6.0 to 4.7.0.
- [Release notes](https://github.com/webpack/webpack-cli/releases)
- [Changelog](https://github.com/webpack/webpack-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/webpack/webpack-cli/compare/webpack-cli@4.6.0...webpack-cli@4.7.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-07 05:02:35 +00:00
d77d59836f Merge pull request #930 from dolanmiu/dependabot/npm_and_yarn/ts-loader-9.1.2
Bump ts-loader from 9.1.1 to 9.1.2
2021-05-06 16:04:28 +01:00
a035f4f411 Merge pull request #928 from pauldegroot/simple-mailmerge-fields
Added support for w:fldSimple, including convenience for MailMerge
2021-05-06 15:41:37 +01:00
53b1bba103 Bump ts-loader from 9.1.1 to 9.1.2
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.1.1 to 9.1.2.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.1.1...v9.1.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-06 05:02:12 +00:00
605536ce68 Merge pull request #929 from dolanmiu/dependabot/npm_and_yarn/types/node-15.0.2
Bump @types/node from 15.0.1 to 15.0.2
2021-05-05 15:52:02 +01:00
a9e4c88804 Expanded documentation on the formulas a bit 2021-05-05 15:11:11 +02:00
79c1db9c91 Added some documentation and demo file 2021-05-05 14:37:02 +02:00
3b757ad4c8 Bump @types/node from 15.0.1 to 15.0.2
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 15.0.1 to 15.0.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-05 05:02:25 +00:00
ee07ff8282 Merge pull request #926 from dolanmiu/dependabot/npm_and_yarn/webpack-5.36.2
Bump webpack from 5.36.1 to 5.36.2
2021-05-05 01:00:44 +01:00
85583a3dbd Added support for w:fldSimple, including convenience class for simple MailMerge fields 2021-05-04 23:38:25 +02:00
46daacfbc8 Bump webpack from 5.36.1 to 5.36.2
Bumps [webpack](https://github.com/webpack/webpack) from 5.36.1 to 5.36.2.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.36.1...v5.36.2)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-03 05:07:51 +00:00
7acd9e1fde Merge pull request #922 from dolanmiu/dependabot/add-v2-config-file
Upgrade to GitHub-native Dependabot
2021-04-29 18:18:25 +01:00
97e3f8bc78 Upgrade to GitHub-native Dependabot 2021-04-29 15:44:48 +00:00
ff378d6667 Merge pull request #921 from dolanmiu/dependabot/npm_and_yarn/webpack-5.36.1
build(deps-dev): bump webpack from 5.36.0 to 5.36.1
2021-04-29 11:35:09 +01:00
9930476f64 build(deps-dev): bump webpack from 5.36.0 to 5.36.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.36.0 to 5.36.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.36.0...v5.36.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-29 07:50:57 +00:00
3e5223dd5d Merge pull request #917 from dolanmiu/dependabot/npm_and_yarn/types/chai-4.2.17
build(deps-dev): bump @types/chai from 4.2.16 to 4.2.17
2021-04-28 19:26:36 +01:00
e3bb8258e5 Merge pull request #919 from dolanmiu/dependabot/npm_and_yarn/webpack-5.36.0
build(deps-dev): bump webpack from 5.35.1 to 5.36.0
2021-04-28 19:26:29 +01:00
77301a401e Merge pull request #920 from dolanmiu/dependabot/npm_and_yarn/types/node-15.0.1
build(deps): bump @types/node from 14.14.41 to 15.0.1
2021-04-28 19:26:21 +01:00
a09882b566 build(deps): bump @types/node from 14.14.41 to 15.0.1
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.41 to 15.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-28 16:11:16 +00:00
e72453c19a build(deps-dev): bump webpack from 5.35.1 to 5.36.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.35.1 to 5.36.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.35.1...v5.36.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-28 16:10:53 +00:00
bd159b280f build(deps-dev): bump @types/chai from 4.2.16 to 4.2.17
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.16 to 4.2.17.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-28 07:00:46 +00:00
4d3d971a12 Merge pull request #914 from dolanmiu/dependabot/npm_and_yarn/ts-loader-9.1.1
build(deps-dev): bump ts-loader from 9.0.0 to 9.1.1
2021-04-26 20:51:08 +01:00
def503c53e build(deps-dev): bump ts-loader from 9.0.0 to 9.1.1
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 9.0.0 to 9.1.1.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v9.0.0...v9.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-26 08:05:58 +00:00
74afae1850 Merge pull request #913 from dolanmiu/dependabot/npm_and_yarn/webpack-5.35.1
build(deps-dev): bump webpack from 5.34.0 to 5.35.1
2021-04-25 23:39:00 +01:00
7db166b19c build(deps-dev): bump webpack from 5.34.0 to 5.35.1
Bumps [webpack](https://github.com/webpack/webpack) from 5.34.0 to 5.35.1.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.34.0...v5.35.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-24 03:11:54 +00:00
0271e4ad40 Merge pull request #905 from dolanmiu/dependabot/npm_and_yarn/types/node-14.14.41
build(deps): bump @types/node from 14.14.39 to 14.14.41
2021-04-24 04:10:26 +01:00
2b010dbfec Merge pull request #908 from dolanmiu/dependabot/npm_and_yarn/webpack-5.34.0
build(deps-dev): bump webpack from 5.33.2 to 5.34.0
2021-04-24 04:10:18 +01:00
a8f38a3d01 Merge pull request #909 from dolanmiu/dependabot/npm_and_yarn/ts-loader-9.0.0
build(deps-dev): bump ts-loader from 8.1.0 to 9.0.0
2021-04-24 04:10:07 +01:00
bd69779a12 Merge pull request #911 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.20.36
build(deps-dev): bump typedoc from 0.20.35 to 0.20.36
2021-04-24 04:09:57 +01:00
571ba2e2c3 build(deps-dev): bump typedoc from 0.20.35 to 0.20.36
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.20.35 to 0.20.36.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.20.35...v0.20.36)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-23 07:50:59 +00:00
7a25165046 build(deps-dev): bump ts-loader from 8.1.0 to 9.0.0
Bumps [ts-loader](https://github.com/TypeStrong/ts-loader) from 8.1.0 to 9.0.0.
- [Release notes](https://github.com/TypeStrong/ts-loader/releases)
- [Changelog](https://github.com/TypeStrong/ts-loader/blob/main/CHANGELOG.md)
- [Commits](https://github.com/TypeStrong/ts-loader/compare/v8.1.0...v9.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-22 14:25:52 +00:00
977fdbb9eb build(deps-dev): bump webpack from 5.33.2 to 5.34.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.33.2 to 5.34.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.33.2...v5.34.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-22 14:24:48 +00:00
2f05186730 build(deps): bump @types/node from 14.14.39 to 14.14.41
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.39 to 14.14.41.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-22 13:53:55 +00:00
38695c3c4b Add page size demo 2021-04-19 00:59:07 +01:00
f2152b3da1 Merge pull request #896 from dolanmiu/dependabot/npm_and_yarn/webpack-5.33.2
build(deps-dev): bump webpack from 5.32.0 to 5.33.2
2021-04-15 12:54:26 +01:00
51dc538cdd Merge pull request #895 from dolanmiu/dependabot/npm_and_yarn/types/sinon-10.0.0
build(deps-dev): bump @types/sinon from 9.0.11 to 10.0.0
2021-04-15 12:54:16 +01:00
c76bb2859a Merge pull request #894 from dolanmiu/dependabot/npm_and_yarn/types/node-14.14.39
build(deps): bump @types/node from 14.14.37 to 14.14.39
2021-04-15 12:54:05 +01:00
0b6f040bba build(deps-dev): bump webpack from 5.32.0 to 5.33.2
Bumps [webpack](https://github.com/webpack/webpack) from 5.32.0 to 5.33.2.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.32.0...v5.33.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-15 08:56:26 +00:00
149908ea62 build(deps-dev): bump @types/sinon from 9.0.11 to 10.0.0
Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 9.0.11 to 10.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-15 08:55:45 +00:00
98f745a3f7 build(deps): bump @types/node from 14.14.37 to 14.14.39
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.37 to 14.14.39.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-15 08:55:36 +00:00
9b840c0d63 Merge pull request #892 from dolanmiu/dependabot/npm_and_yarn/webpack-5.32.0
build(deps-dev): bump webpack from 5.31.0 to 5.32.0
2021-04-13 20:42:20 +01:00
0085b1d128 build(deps-dev): bump webpack from 5.31.0 to 5.32.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.31.0 to 5.32.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.31.0...v5.32.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-13 08:32:48 +00:00
c3ddd576e2 Merge pull request #888 from dolanmiu/dependabot/npm_and_yarn/sinon-10.0.1
build(deps-dev): bump sinon from 10.0.0 to 10.0.1
2021-04-09 12:18:17 +01:00
cf237bcc10 build(deps-dev): bump sinon from 10.0.0 to 10.0.1
Bumps [sinon](https://github.com/sinonjs/sinon) from 10.0.0 to 10.0.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v10.0.0...v10.0.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-09 07:59:59 +00:00
c6ce7fe3a3 Merge pull request #887 from dolanmiu/dependabot/npm_and_yarn/typescript-4.2.4
build(deps-dev): bump typescript from 4.2.3 to 4.2.4
2021-04-08 12:35:30 +01:00
712e612ab1 Merge pull request #886 from dolanmiu/dependabot/npm_and_yarn/webpack-5.31.0
build(deps-dev): bump webpack from 5.30.0 to 5.31.0
2021-04-08 12:35:21 +01:00
161038cc75 build(deps-dev): bump typescript from 4.2.3 to 4.2.4
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.3 to 4.2.4.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-08 09:19:48 +00:00
24aee70b67 build(deps-dev): bump webpack from 5.30.0 to 5.31.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.30.0 to 5.31.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.30.0...v5.31.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-08 09:19:37 +00:00
b486bcf372 Merge pull request #881 from dolanmiu/dependabot/npm_and_yarn/types/chai-4.2.16
build(deps-dev): bump @types/chai from 4.2.15 to 4.2.16
2021-04-06 01:30:53 +01:00
97147bc3d7 Merge pull request #882 from dolanmiu/dependabot/npm_and_yarn/webpack-5.30.0
build(deps-dev): bump webpack from 5.28.0 to 5.30.0
2021-04-06 01:29:29 +01:00
6a0b01e05c Merge pull request #883 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.20.35
build(deps-dev): bump typedoc from 0.20.34 to 0.20.35
2021-04-06 01:28:38 +01:00
e60d9cbbce Merge pull request #884 from dolanmiu/dependabot/npm_and_yarn/types/webpack-5.28.0
build(deps-dev): bump @types/webpack from 5.0.0 to 5.28.0
2021-04-06 01:28:29 +01:00
594045644b build(deps-dev): bump @types/webpack from 5.0.0 to 5.28.0
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 5.0.0 to 5.28.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-05 08:51:44 +00:00
e36022d044 build(deps-dev): bump typedoc from 0.20.34 to 0.20.35
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.20.34 to 0.20.35.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.20.34...v0.20.35)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-05 08:50:54 +00:00
2b0acc2980 build(deps-dev): bump webpack from 5.28.0 to 5.30.0
Bumps [webpack](https://github.com/webpack/webpack) from 5.28.0 to 5.30.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.28.0...v5.30.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-05 08:49:39 +00:00
2058f72c2e build(deps-dev): bump @types/chai from 4.2.15 to 4.2.16
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 4.2.15 to 4.2.16.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-05 08:48:55 +00:00
0788b10106 Merge pull request #762 from dolanmiu/dependabot/npm_and_yarn/replace-in-file-6.2.0
build(deps-dev): bump replace-in-file from 3.4.4 to 6.2.0
2021-04-02 19:40:04 +01:00
7b431e50bc build(deps-dev): bump replace-in-file from 3.4.4 to 6.2.0
Bumps [replace-in-file](https://github.com/adamreisnz/replace-in-file) from 3.4.4 to 6.2.0.
- [Release notes](https://github.com/adamreisnz/replace-in-file/releases)
- [Changelog](https://github.com/adamreisnz/replace-in-file/blob/master/CHANGELOG.md)
- [Commits](https://github.com/adamreisnz/replace-in-file/compare/v3.4.4...v6.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-02 13:42:12 +00:00
633487ca16 Merge pull request #874 from dolanmiu/dependabot/npm_and_yarn/y18n-4.0.1
build(deps): [security] bump y18n from 4.0.0 to 4.0.1
2021-04-02 14:40:36 +01:00
43d1f40baa Merge pull request #875 from dolanmiu/dependabot/npm_and_yarn/yargs-parser-13.1.2
build(deps): [security] bump yargs-parser from 13.1.1 to 13.1.2
2021-04-02 14:40:28 +01:00
aec7f09031 Merge pull request #873 from dolanmiu/dependabot/npm_and_yarn/kind-of-6.0.3
build(deps): bump kind-of from 6.0.2 to 6.0.3
2021-04-02 14:22:36 +01:00
790dfa320e build(deps): [security] bump yargs-parser from 13.1.1 to 13.1.2
Bumps [yargs-parser](https://github.com/yargs/yargs-parser) from 13.1.1 to 13.1.2. **This update includes security fixes.**
- [Release notes](https://github.com/yargs/yargs-parser/releases)
- [Changelog](https://github.com/yargs/yargs-parser/blob/master/docs/CHANGELOG-full.md)
- [Commits](https://github.com/yargs/yargs-parser/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-02 13:19:27 +00:00
260482d9d4 build(deps): [security] bump y18n from 4.0.0 to 4.0.1
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1. **This update includes a security fix.**
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-04-02 13:18:55 +00:00
b699481ae3 build(deps): bump kind-of from 6.0.2 to 6.0.3
Bumps [kind-of](https://github.com/jonschlinkert/kind-of) from 6.0.2 to 6.0.3.
- [Release notes](https://github.com/jonschlinkert/kind-of/releases)
- [Changelog](https://github.com/jonschlinkert/kind-of/blob/master/CHANGELOG.md)
- [Commits](https://github.com/jonschlinkert/kind-of/compare/6.0.2...6.0.3)

Signed-off-by: dependabot[bot] <support@github.com>
2021-04-02 13:16:48 +00:00
0f7260c152 Merge pull request #868 from dolanmiu/feat/webpack-5
Update webpack and testing frameworks
2021-04-02 14:16:08 +01:00
d43d742875 Add remove old artifacts cron job 2021-04-01 15:03:29 +01:00
fceefcf290 Update webpack and testing frameworks 2021-03-31 21:27:40 +01:00
488711dae0 Merge pull request #863 from dolanmiu/dependabot/npm_and_yarn/y18n-3.2.2
build(deps): [security] bump y18n from 3.2.1 to 3.2.2
2021-03-31 05:14:12 +01:00
901847db3e Merge pull request #865 from dolanmiu/dependabot/npm_and_yarn/types/webpack-5.28.0
build(deps-dev): bump @types/webpack from 5.0.0 to 5.28.0
2021-03-31 05:11:56 +01:00
dd7a83753b Version bump 2021-03-31 05:05:17 +01:00
04d2b01e16 build(deps-dev): bump @types/webpack from 5.0.0 to 5.28.0
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 5.0.0 to 5.28.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-30 08:43:13 +00:00
ca9f1c9af4 build(deps): [security] bump y18n from 3.2.1 to 3.2.2
Bumps [y18n](https://github.com/yargs/y18n) from 3.2.1 to 3.2.2. **This update includes a security fix.**
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-29 18:08:14 +00:00
eed7cb9537 Merge pull request #862 from dolanmiu/dependabot/npm_and_yarn/types/node-14.14.37
build(deps): bump @types/node from 14.14.36 to 14.14.37
2021-03-29 16:21:13 +01:00
ec54c7f762 build(deps): bump @types/node from 14.14.36 to 14.14.37
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.36 to 14.14.37.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-29 09:59:01 +00:00
c7b69a3ff5 Merge pull request #858 from izmaelmag/fix/usage-doc-typos
Fixed typos in usage documentation
2021-03-29 03:20:18 +01:00
6892c7aa6c Merge pull request #854 from askoufis/fix-footer-import
Fix footer import
2021-03-29 03:18:55 +01:00
09ec3e682f Merge pull request #860 from dolanmiu/dependabot/npm_and_yarn/types/webpack-5.0.0
build(deps-dev): bump @types/webpack from 4.41.26 to 5.0.0
2021-03-26 14:37:08 +00:00
e3ac9bc9bf Merge pull request #859 from dolanmiu/dependabot/npm_and_yarn/types/node-14.14.36
build(deps): bump @types/node from 14.14.35 to 14.14.36
2021-03-26 14:36:56 +00:00
958045e5c7 build(deps-dev): bump @types/webpack from 4.41.26 to 5.0.0
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.26 to 5.0.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-26 07:38:46 +00:00
0f6f7b8a15 build(deps): bump @types/node from 14.14.35 to 14.14.36
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.35 to 14.14.36.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-26 07:38:06 +00:00
401e4851e1 Merge pull request #855 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.20.34
build(deps-dev): bump typedoc from 0.20.33 to 0.20.34
2021-03-25 17:22:23 +00:00
abc7c8dc72 Fixed typos in usage documentation 2021-03-25 19:21:27 +03:00
7a0cc2f2e7 build(deps-dev): bump typedoc from 0.20.33 to 0.20.34
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.20.33 to 0.20.34.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.20.33...v0.20.34)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-25 07:42:59 +00:00
b374dc0fac Fix footer import 2021-03-25 15:01:11 +11:00
ed409ac1b7 Version bump 2021-03-25 02:55:45 +00:00
4842630e09 Merge pull request #852 from dolanmiu/feat/fix-numbering
#851 Use predictive unique id generation
2021-03-24 03:16:46 +00:00
d29286ab6d Fix tests 2021-03-24 03:09:01 +00:00
ebaf0dfbf0 #851 Use predictive unique id generation 2021-03-24 03:02:58 +00:00
72389e25a1 Merge pull request #850 from dolanmiu/dependabot/npm_and_yarn/sinon-10.0.0
build(deps-dev): bump sinon from 9.2.4 to 10.0.0
2021-03-23 14:34:56 +00:00
799bdcc2f0 build(deps-dev): bump sinon from 9.2.4 to 10.0.0
Bumps [sinon](https://github.com/sinonjs/sinon) from 9.2.4 to 10.0.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v9.2.4...v10.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-23 11:42:01 +00:00
9ec7b4969d Version bump 2021-03-23 01:52:49 +00:00
e78696fbac Add README picture psd 2021-03-23 01:51:25 +00:00
f4102d2e30 Update README.md 2021-03-22 17:09:58 +00:00
658814d9ca Merge pull request #845 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.20.33
build(deps-dev): bump typedoc from 0.20.32 to 0.20.33
2021-03-22 11:47:23 +00:00
fd86122881 Merge pull request #846 from dolanmiu/dependabot/npm_and_yarn/types/mocha-8.2.2
build(deps-dev): bump @types/mocha from 8.2.1 to 8.2.2
2021-03-22 11:47:12 +00:00
ce335c7a3d Merge pull request #844 from dolanmiu/feat/fix-styles-xml
#842 Move table styles to the top
2021-03-22 11:46:12 +00:00
bd456d3864 build(deps-dev): bump @types/mocha from 8.2.1 to 8.2.2
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.2.1 to 8.2.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-22 08:27:13 +00:00
2414c7c356 build(deps-dev): bump typedoc from 0.20.32 to 0.20.33
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.20.32 to 0.20.33.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.20.32...v0.20.33)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-22 08:26:45 +00:00
bc6644be0b #842 Move table styles to the top 2021-03-22 05:54:48 +00:00
46846b6e6c Fix imports 2021-03-22 05:23:30 +00:00
ac4b5839c2 Update README.md 2021-03-21 18:36:15 +00:00
9cf7f3cf54 Version bump 2021-03-21 03:19:18 +00:00
77afb55167 Update StackBlitz links 2021-03-21 03:16:39 +00:00
e86997576f Update README.md 2021-03-21 02:14:03 +00:00
a67e306737 Update README.md 2021-03-20 02:17:57 +00:00
48ea634e08 Update README.md 2021-03-20 02:16:28 +00:00
ea29f515b0 Merge pull request #841 from dolanmiu/feat/workflow-updates
Add workflow and issue template
2021-03-20 01:57:55 +00:00
41d27cb78c Fix demo 2021-03-20 01:27:35 +00:00
ff45c182ce Fix demo 2021-03-20 01:20:14 +00:00
0519ed6d09 Add workflow and issue template 2021-03-20 00:37:09 +00:00
f41e19c251 Merge pull request #840 from dolanmiu/feat/declarative-add-section
Make .addSection fully declarative
2021-03-19 23:52:15 +00:00
329a70c312 Fix demo 2021-03-19 21:40:53 +00:00
419fef5759 Fix demo 2021-03-19 21:09:58 +00:00
3299c557a0 Make .addSection fully declarative 2021-03-19 20:53:56 +00:00
4783812044 Merge pull request #834 from dolanmiu/feat/simpler-images
Make adding images declarative and simple
2021-03-18 04:06:09 +00:00
6e21cdbf17 Fix demos 2021-03-18 03:28:29 +00:00
caf188caae Make adding images declarative and simple 2021-03-18 02:48:37 +00:00
c8db70b3b7 Merge pull request #831 from dolanmiu/dependabot/npm_and_yarn/types/node-14.14.35
build(deps): bump @types/node from 14.14.34 to 14.14.35
2021-03-16 10:17:58 +00:00
eb0479d80b Merge pull request #830 from dolanmiu/dependabot/npm_and_yarn/nanoid-3.1.22
build(deps): bump nanoid from 3.1.21 to 3.1.22
2021-03-16 10:17:46 +00:00
181d56ca80 build(deps): bump @types/node from 14.14.34 to 14.14.35
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.34 to 14.14.35.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-16 07:55:36 +00:00
b1d1b9e9b7 build(deps): bump nanoid from 3.1.21 to 3.1.22
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.21 to 3.1.22.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.21...3.1.22)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-16 07:54:44 +00:00
28685a8761 Add spacing to table float 2021-03-16 03:21:05 +00:00
ecd1596682 Merge pull request #829 from dolanmiu/feat/even-odd-headers
#251 Turning off default headers by default
2021-03-16 03:04:19 +00:00
6746f81da5 Fix tests 2021-03-16 02:26:05 +00:00
c7075d740f #251 Turning off default headers by default 2021-03-16 01:23:23 +00:00
0faac01f6b Merge pull request #828 from dolanmiu/feat/even-odd-headers
Feat/even odd headers
2021-03-16 01:16:34 +00:00
bdfaee2cb3 Update demo 2021-03-16 01:02:33 +00:00
131183ae19 #613 #439 Even and odd headers 2021-03-16 00:57:27 +00:00
8b2aa58198 Merge pull request #827 from dolanmiu/feat/spacing
Add enum to lineRule and create demo
2021-03-15 19:43:35 +00:00
4fe2973473 Add enum to lineRule and create demo 2021-03-15 19:23:40 +00:00
93ec9eed7a Add titlePage to first page header 2021-03-15 19:02:04 +00:00
ba5cb1483b Merge pull request #825 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.20.32
build(deps-dev): bump typedoc from 0.20.30 to 0.20.32
2021-03-15 13:08:23 +00:00
1436f4d4b2 Merge pull request #824 from dolanmiu/dependabot/npm_and_yarn/types/node-14.14.34
build(deps): bump @types/node from 14.14.33 to 14.14.34
2021-03-15 13:08:06 +00:00
107e6ce1d9 build(deps-dev): bump typedoc from 0.20.30 to 0.20.32
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.20.30 to 0.20.32.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.20.30...v0.20.32)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-15 09:14:01 +00:00
2d5e08588c build(deps): bump @types/node from 14.14.33 to 14.14.34
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.33 to 14.14.34.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-15 09:12:26 +00:00
24f95aee8b Add custom bullet point example 2021-03-15 03:46:34 +00:00
c5e9e3b2a0 Fix documentation 2021-03-15 03:02:39 +00:00
0b85e07701 Fix documentation 2021-03-15 02:58:26 +00:00
40b3bc0b90 Merge pull request #822 from dolanmiu/feat/rotating-images
#815 Rotation and flipping images
2021-03-15 02:56:08 +00:00
bd40b11ce4 #815 Rotation and flipping images 2021-03-15 02:41:37 +00:00
a3febae8a3 Inline single use interfaces 2021-03-15 00:11:39 +00:00
18ce200cdb Merge pull request #821 from dolanmiu/feat/text-frame
#269 Text Frame (Text Box)
2021-03-14 18:17:44 +00:00
cc32a7b2d3 Add text frame documentation 2021-03-14 18:12:52 +00:00
e7eca14e1e Fix prettier issues 2021-03-14 17:03:50 +00:00
7f86385b09 #269 Text Frame (Text Box) 2021-03-14 17:00:42 +00:00
2fa8df7cf4 Add more tests 2021-03-14 00:44:12 +00:00
f0e50dd21f Add more tests 2021-03-13 22:43:21 +00:00
0bc36d924f Write tests 2021-03-13 22:10:00 +00:00
4bc0421055 Add tests 2021-03-13 20:23:15 +00:00
cc9a966f53 Improve tests 2021-03-13 19:53:36 +00:00
8aa804db18 Add style to styles demo 2021-03-13 19:52:08 +00:00
b3ffa60f14 Merge pull request #819 from dolanmiu/feat/widow-control
#750 Add widow control
2021-03-13 04:19:31 +00:00
8724fbe7a7 #750 Add widow control 2021-03-13 04:07:44 +00:00
2391375ac0 Merge pull request #817 from dolanmiu/dependabot/npm_and_yarn/nanoid-3.1.21
build(deps): bump nanoid from 3.1.20 to 3.1.21
2021-03-12 11:12:06 +00:00
12817957f4 build(deps): bump nanoid from 3.1.20 to 3.1.21
Bumps [nanoid](https://github.com/ai/nanoid) from 3.1.20 to 3.1.21.
- [Release notes](https://github.com/ai/nanoid/releases)
- [Changelog](https://github.com/ai/nanoid/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ai/nanoid/compare/3.1.20...3.1.21)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-12 07:57:39 +00:00
58f7e5a9a3 Merge pull request #816 from dolanmiu/feat/restart-numbered-lists
#548 #508 Restart numbered lists
2021-03-12 04:04:59 +00:00
0b88cb0ca5 #548 #508 Restart numbered lists 2021-03-12 03:58:05 +00:00
dbaa493ebd Merge pull request #763 from netbymatt/master
Allow styles and headings with numbering
2021-03-11 19:42:30 +00:00
4b5d2d98f9 add tests for numbering paragraph styles 2021-03-11 11:11:46 -06:00
9864cdea16 Merge pull request #814 from dolanmiu/feat/use-context-in-prep-xml
Use context in prep xml
2021-03-11 01:17:14 +00:00
566ac03f9a Use context in prep xml 2021-03-11 01:06:55 +00:00
cf6c4998d0 Merge pull request #813 from dolanmiu/dependabot/npm_and_yarn/types/node-14.14.33
build(deps): bump @types/node from 14.14.32 to 14.14.33
2021-03-10 16:55:09 +00:00
0891e2a8c3 build(deps): bump @types/node from 14.14.32 to 14.14.33
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.32 to 14.14.33.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-10 07:55:14 +00:00
48d9e75707 Merge pull request #511 from dolanmiu/feature/separator
Restart page numbering
2021-03-09 23:11:15 +00:00
cd501bba0a Add tests 2021-03-09 22:59:50 +00:00
57f80e636e Move demos to unique number 2021-03-09 22:57:51 +00:00
89c2e14979 Merge branch 'master' of github.com:dolanmiu/docx into feature/separator
# Conflicts:
#	src/file/document/body/section-properties/section-properties.ts
2021-03-09 22:37:37 +00:00
8c2ba7a452 Merge pull request #810 from dolanmiu/dependabot/npm_and_yarn/docsify-cli-4.4.3
build(deps-dev): bump docsify-cli from 4.4.2 to 4.4.3
2021-03-09 15:20:49 +00:00
cd232496e2 build(deps-dev): bump docsify-cli from 4.4.2 to 4.4.3
Bumps [docsify-cli](https://github.com/docsifyjs/docsify-cli) from 4.4.2 to 4.4.3.
- [Release notes](https://github.com/docsifyjs/docsify-cli/releases)
- [Changelog](https://github.com/docsifyjs/docsify-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/docsifyjs/docsify-cli/compare/v4.4.2...v4.4.3)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-09 08:18:46 +00:00
0cdb1a9286 Add rimraf to build 2021-03-09 03:00:30 +00:00
7ebef8b3b5 #800 Use new typedoc config 2021-03-09 02:23:22 +00:00
e98fe5921c #713 Update chinese demo and refactor 2021-03-09 01:37:22 +00:00
98253c3445 Update tslint rules 2021-03-08 23:17:10 +00:00
9bda9e8375 #801 Add example to offset header and footer 2021-03-08 22:51:46 +00:00
bf4498061a Merge pull request #808 from dolanmiu/dependabot/npm_and_yarn/elliptic-6.5.4
build(deps): [security] bump elliptic from 6.5.3 to 6.5.4
2021-03-08 18:46:15 +00:00
13d0f33af6 build(deps): [security] bump elliptic from 6.5.3 to 6.5.4
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.3 to 6.5.4. **This update includes a security fix.**
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.3...v6.5.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-08 17:18:15 +00:00
d4bc89d141 Merge pull request #806 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.20.30
build(deps-dev): bump typedoc from 0.20.29 to 0.20.30
2021-03-08 10:09:10 +00:00
0c42298dce Merge pull request #805 from dolanmiu/dependabot/npm_and_yarn/types/node-14.14.32
build(deps): bump @types/node from 14.14.31 to 14.14.32
2021-03-08 10:08:59 +00:00
f997515af4 Merge pull request #804 from dolanmiu/dependabot/npm_and_yarn/types/sinon-9.0.11
build(deps-dev): bump @types/sinon from 9.0.10 to 9.0.11
2021-03-08 10:08:49 +00:00
624afb8fba build(deps-dev): bump typedoc from 0.20.29 to 0.20.30
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.20.29 to 0.20.30.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.20.29...v0.20.30)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-08 08:50:22 +00:00
71f8bcffe7 build(deps): bump @types/node from 14.14.31 to 14.14.32
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.14.31 to 14.14.32.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-08 08:50:02 +00:00
e8bdeed63f build(deps-dev): bump @types/sinon from 9.0.10 to 9.0.11
Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 9.0.10 to 9.0.11.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-08 08:49:43 +00:00
2b7ca92ade Merge pull request #484 from dolanmiu/feat/right-indent
Multiple paragraphs in footnotes
2021-03-08 04:43:08 +00:00
fdf0764245 Alter coverage limits 2021-03-08 04:36:53 +00:00
993782129c Simplify for loop 2021-03-08 04:33:15 +00:00
65302dd39b Increase coverage limit 2021-03-08 04:22:20 +00:00
a0d8911e18 Add tests 2021-03-08 04:18:26 +00:00
2d4a452d2e Merge branch 'master' into feat/right-indent
# Conflicts:
#	demo/21-bookmarks.ts
#	package-lock.json
#	src/file/core-properties/properties.ts
#	src/file/file.spec.ts
#	src/file/file.ts
#	src/file/footnotes/footnote/footnote.spec.ts
#	src/file/footnotes/footnote/footnote.ts
#	src/file/footnotes/footnotes.ts
2021-03-08 03:40:11 +00:00
3f2ad04d65 Merge pull request #438 from ramonmata/add-table-option-styleId
Allows specify XML StyleId to be applied in a Table
2021-03-07 22:40:07 +00:00
283c42cb55 Remove unused method 2021-03-07 21:53:16 +00:00
0ec3b64ad7 Add tests 2021-03-07 21:45:59 +00:00
b972f1789e Fix tests 2021-03-07 21:43:30 +00:00
90495d08a6 Merge branch 'master' into add-table-option-styleId
# Conflicts:
#	src/file/table/table.ts
2021-03-07 21:40:42 +00:00
5fc28cb67d Move custom properties to properties 2021-03-07 21:27:38 +00:00
bb6abe5e09 Update README.md 2021-03-07 20:53:25 +00:00
d1a8f983d3 Merge pull request #802 from dolanmiu/dependabot/npm_and_yarn/typescript-4.2.3
build(deps-dev): bump typescript from 4.2.2 to 4.2.3
2021-03-05 10:16:24 +00:00
e169e01002 build(deps-dev): bump typescript from 4.2.2 to 4.2.3
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.2.2 to 4.2.3.
- [Release notes](https://github.com/Microsoft/TypeScript/releases)
- [Commits](https://github.com/Microsoft/TypeScript/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-05 07:59:54 +00:00
e5da573041 Clean up table with improved demo 2021-03-05 03:03:02 +00:00
9557015c6c Merge pull request #798 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.20.29
build(deps-dev): bump typedoc from 0.19.0 to 0.20.29
2021-03-04 11:34:23 +00:00
512d81649f build(deps-dev): bump typedoc from 0.19.0 to 0.20.29
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.19.0 to 0.20.29.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.19.0...v0.20.29)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-04 07:51:09 +00:00
fc1e0dad3f Merge branch 'master' of github.com:dolanmiu/docx 2021-03-04 03:25:50 +00:00
ec22720244 Update README.md 2021-03-04 03:21:03 +00:00
9743dfa8cc Improve docs 2021-03-04 03:10:20 +00:00
805bd94a25 Merge pull request #779 from dolanmiu/dependabot/npm_and_yarn/types/node-14.14.31
build(deps): bump @types/node from 14.6.2 to 14.14.31
2021-03-04 03:09:36 +00:00
c3faf3bbd8 Merge pull request #796 from dolanmiu/feat/table-work
#732 Add line between columns (separate)
2021-03-04 03:09:27 +00:00
5b3427cada Merge pull request #770 from dolanmiu/dependabot/npm_and_yarn/types/chai-4.2.15
build(deps-dev): bump @types/chai from 3.5.2 to 4.2.15
2021-03-04 03:05:09 +00:00
df7a90d3c1 build(deps): bump @types/node from 14.6.2 to 14.14.31
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.6.2 to 14.14.31.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-04 03:03:02 +00:00
f3f65da207 #732 Add line between columns (separate) 2021-03-04 03:02:07 +00:00
9326a0a998 build(deps-dev): bump @types/chai from 3.5.2 to 4.2.15
Bumps [@types/chai](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/chai) from 3.5.2 to 4.2.15.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/chai)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-04 03:00:34 +00:00
909a86df7f Merge pull request #737 from dolanmiu/dependabot/npm_and_yarn/types/sinon-9.0.10
build(deps-dev): bump @types/sinon from 9.0.4 to 9.0.10
2021-03-04 02:57:40 +00:00
a5da9f44e8 build(deps-dev): bump @types/sinon from 9.0.4 to 9.0.10
Bumps [@types/sinon](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/sinon) from 9.0.4 to 9.0.10.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/sinon)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-04 02:25:09 +00:00
2f732e7378 Merge pull request #795 from dolanmiu/feat/table-work
Visual Right to Left Table
2021-03-04 02:17:50 +00:00
31269c85d2 Merge pull request #565 from SoapyD/height_branch
table-row height correction
2021-03-04 02:13:32 +00:00
95556e57df Write documentation on vidi visual 2021-03-04 02:08:09 +00:00
2aa93e6105 #751 Add bidi visual - Visual Right to Left 2021-03-04 02:02:28 +00:00
a026e5bd1f Make table internals declarative 2021-03-04 01:42:58 +00:00
9327f2bfa1 Fix compiler tests 2021-03-04 01:30:42 +00:00
603dd36458 Merge pull request #789 from dolanmiu/feat/compat-mode
#627 Add footnotes relationships
2021-03-02 00:43:00 +00:00
53ababf3a7 Merge pull request #605 from kalda341/custom-properties
Allow custom text properties to be included
2021-03-02 00:40:32 +00:00
3e58910bfc Use document wrapper component 2021-03-02 00:06:11 +00:00
736ca6a46d Merge branch 'master' into custom-properties 2021-03-02 00:01:03 +00:00
f90e84a88d #627 Add footnotes relationships 2021-03-01 23:35:52 +00:00
a79b1e36dc Merge pull request #787 from dolanmiu/dependabot/npm_and_yarn/docsify-4.12.0
build(deps): bump docsify from 4.11.6 to 4.12.0
2021-03-01 21:38:01 +00:00
dd503996a0 build(deps): bump docsify from 4.11.6 to 4.12.0
Bumps [docsify](https://github.com/docsifyjs/docsify) from 4.11.6 to 4.12.0.
- [Release notes](https://github.com/docsifyjs/docsify/releases)
- [Changelog](https://github.com/docsifyjs/docsify/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/docsifyjs/docsify/compare/v4.11.6...v4.12.0)

Signed-off-by: dependabot[bot] <support@github.com>
2021-03-01 19:48:23 +00:00
694ac22dad Merge pull request #786 from dolanmiu/dependabot/npm_and_yarn/typedoc-0.19.0
build(deps-dev): bump typedoc from 0.16.11 to 0.19.0
2021-03-01 17:07:15 +00:00
8435ece00d build(deps-dev): bump typedoc from 0.16.11 to 0.19.0
Bumps [typedoc](https://github.com/TypeStrong/TypeDoc) from 0.16.11 to 0.19.0.
- [Release notes](https://github.com/TypeStrong/TypeDoc/releases)
- [Commits](https://github.com/TypeStrong/TypeDoc/compare/v0.16.11...v0.19.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-03-01 11:54:10 +00:00
cdd22efd79 Merge pull request #785 from dolanmiu/feat/compat-mode
Feat/compat mode
2021-03-01 03:39:11 +00:00
c6e9696be0 #532 Make hyperlinks work on the Header and Footer 2021-03-01 03:28:35 +00:00
655b40d418 Work on moving Document into its own wrapper 2021-02-28 16:04:21 +00:00
60664a2a83 Merge pull request #784 from dolanmiu/feat/compat-mode
#773 Better hyperlink and bookmark syntax
2021-02-28 15:53:21 +00:00
e750735fa4 Add bookmark in footer 2021-02-28 13:09:43 +00:00
0de7116b78 #773 Better hyperlink and bookmark syntax
Allow for images to be hyperlinked as well
2021-02-27 19:23:29 +00:00
45b1f6f9a3 Merge pull request #783 from dolanmiu/feat/compat-mode
Feat/compat mode
2021-02-27 02:06:25 +00:00
4159be5644 Add readonly 2021-02-27 01:42:29 +00:00
10455a534f #332 Compatability mode 2021-02-27 01:40:55 +00:00
84f48446df Merge pull request #781 from khalilmansouri/fix/documentation
Fix documentation typo
2021-02-24 14:08:15 +00:00
32ceaa415e Fix documentation typo 2021-02-24 13:30:40 +01:00
5e06d73f45 Merge pull request #780 from dolanmiu/feat/section-type
#339 Add Section Type
2021-02-23 00:01:14 +00:00
bfd0f0c7bb Fix linting 2021-02-22 21:12:38 +00:00
858a994d13 #339 Add Section Type 2021-02-22 21:04:02 +00:00
bb2f77aa67 Merge pull request #775 from dolanmiu/dependabot/npm_and_yarn/types/mocha-8.2.1
build(deps-dev): bump @types/mocha from 8.2.0 to 8.2.1
2021-02-18 22:25:40 +00:00
48c1559a77 build(deps-dev): bump @types/mocha from 8.2.0 to 8.2.1
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.2.0 to 8.2.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-18 07:58:12 +00:00
a6f77d01ca Merge pull request #769 from dolanmiu/dependabot/npm_and_yarn/jszip-3.6.0
build(deps): bump jszip from 3.5.0 to 3.6.0
2021-02-10 22:51:27 +00:00
4dafa62e17 build(deps): bump jszip from 3.5.0 to 3.6.0
Bumps [jszip](https://github.com/Stuk/jszip) from 3.5.0 to 3.6.0.
- [Release notes](https://github.com/Stuk/jszip/releases)
- [Changelog](https://github.com/Stuk/jszip/blob/master/CHANGES.md)
- [Commits](https://github.com/Stuk/jszip/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-02-10 07:52:30 +00:00
49314ea9d0 fix prettier whitespace 2021-02-04 14:48:57 -06:00
acaaf98e20 Fix spacing 2021-02-03 15:21:15 -06:00
0e2bfe9e3f Allow styles and headings with numbering 2021-02-03 14:53:29 -06:00
d6f363b275 Version bump 2021-01-31 04:54:26 +00:00
118ea57412 Merge pull request #749 from dolanmiu/dependabot/npm_and_yarn/types/webpack-4.41.26
build(deps-dev): bump @types/webpack from 4.41.25 to 4.41.26
2021-01-28 10:18:02 +00:00
7c8be4c8a7 Merge pull request #757 from arran4/jszip-supports-more-datatypes
Added more data types for JSZip to consider using
2021-01-28 10:17:48 +00:00
fa9021596f Merge pull request #759 from dolanmiu/dependabot/npm_and_yarn/sinon-9.2.4
build(deps-dev): bump sinon from 9.2.2 to 9.2.4
2021-01-28 10:15:40 +00:00
3ccf4bdfe3 Ran npm run style.fix added "line_ending" configuration to .editorconfig to match the results 2021-01-26 15:09:12 +11:00
f2480673ec build(deps-dev): bump sinon from 9.2.2 to 9.2.4
Bumps [sinon](https://github.com/sinonjs/sinon) from 9.2.2 to 9.2.4.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v9.2.2...v9.2.4)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-25 08:20:27 +00:00
e93b8032d8 Buffer is required as it was originally there too 2021-01-22 16:48:41 +11:00
5de2d8c7fb Minor change 2021-01-22 16:45:39 +11:00
e355fd3d2e build(deps-dev): bump @types/webpack from 4.41.25 to 4.41.26
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.25 to 4.41.26.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2021-01-12 08:20:34 +00:00
d41ef99c85 Merge pull request #739 from dolanmiu/feat/convenience-functions
Add zIndex property to floating
2020-12-25 02:26:04 +00:00
5ec18d6e01 Add tests and simplify 2020-12-25 02:15:40 +00:00
b4cd3a319c Add documentation 2020-12-25 00:30:58 +00:00
d894bfa167 Add test 2020-12-25 00:29:27 +00:00
d74db948ba Add zIndex property to floating 2020-12-25 00:07:57 +00:00
3ef26c747b Merge pull request #736 from dolanmiu/feat/convenience-functions
Use LevelFormat string enum rather than strings
2020-12-24 17:45:09 +00:00
38c8220e9e Use LevelFormat string enum rather than strings 2020-12-24 04:26:45 +00:00
86f8259b33 Merge pull request #735 from dolanmiu/feat/convenience-functions
Add Convenience functions
2020-12-24 03:44:54 +00:00
502db14bba Add Convenience functions 2020-12-24 03:37:43 +00:00
ef12ada5d7 Add parent to numbered list 2020-12-24 01:50:05 +00:00
977b2b302d Merge pull request #734 from dolanmiu/feat/strong-style
Add declarative break()
2020-12-24 00:21:07 +00:00
17d02a3d1c Fix demos 2020-12-24 00:00:24 +00:00
6100ff4c4e Add declarative break() 2020-12-23 23:31:28 +00:00
8bb73fb25e Merge pull request #729 from dolanmiu/feat/strong-style
Adding TableBorders.NONE convenience object
2020-12-23 00:28:34 +00:00
d6cce4ae15 Adding TableBorders.NONE convenience object 2020-12-22 23:42:02 +00:00
058304d16b Merge pull request #728 from dolanmiu/feat/strong-style
Add strong default style
2020-12-22 22:17:24 +00:00
345d34a2e1 Merge pull request #720 from dolanmiu/dependabot/npm_and_yarn/sinon-9.2.2
build(deps-dev): bump sinon from 9.2.1 to 9.2.2
2020-12-22 21:11:07 +00:00
3839a49d47 Merge pull request #726 from dolanmiu/dependabot/npm_and_yarn/prompt-1.1.0
build(deps-dev): bump prompt from 1.0.0 to 1.1.0
2020-12-22 21:10:57 +00:00
0afe0929a3 Add strong default style 2020-12-22 21:08:10 +00:00
a14a1fbd10 Update character style demo 2020-12-22 20:56:06 +00:00
52f0a6958a build(deps-dev): bump prompt from 1.0.0 to 1.1.0
Bumps [prompt](https://github.com/flatiron/prompt) from 1.0.0 to 1.1.0.
- [Release notes](https://github.com/flatiron/prompt/releases)
- [Changelog](https://github.com/flatiron/prompt/blob/master/CHANGELOG.md)
- [Commits](https://github.com/flatiron/prompt/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-22 08:14:29 +00:00
8bdde98db1 build(deps-dev): bump sinon from 9.2.1 to 9.2.2
Bumps [sinon](https://github.com/sinonjs/sinon) from 9.2.1 to 9.2.2.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/commits/v9.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-15 08:16:05 +00:00
19fc900045 Merge pull request #708 from dolanmiu/dependabot/npm_and_yarn/ts-node-9.1.1
build(deps-dev): bump ts-node from 9.1.0 to 9.1.1
2020-12-15 02:01:08 +00:00
6bdd9b882a Merge pull request #711 from dolanmiu/dependabot/npm_and_yarn/types/mocha-8.2.0
build(deps-dev): bump @types/mocha from 8.0.4 to 8.2.0
2020-12-15 02:00:53 +00:00
0d97d428fa Merge pull request #715 from dolanmiu/dependabot/npm_and_yarn/types/request-promise-4.1.47
build(deps-dev): bump @types/request-promise from 4.1.46 to 4.1.47
2020-12-15 02:00:08 +00:00
a0b42d7bdb Merge pull request #717 from dolanmiu/dependabot/npm_and_yarn/ini-1.3.8
build(deps): bump ini from 1.3.5 to 1.3.8
2020-12-15 01:59:54 +00:00
69ba312a96 build(deps): bump ini from 1.3.5 to 1.3.8
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>
2020-12-11 22:47:35 +00:00
a0c13214e6 build(deps-dev): bump @types/request-promise from 4.1.46 to 4.1.47
Bumps [@types/request-promise](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/request-promise) from 4.1.46 to 4.1.47.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/request-promise)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-11 08:22:49 +00:00
4c8829df28 build(deps-dev): bump @types/mocha from 8.0.4 to 8.2.0
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.0.4 to 8.2.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-09 08:04:12 +00:00
3ee3e95410 build(deps-dev): bump ts-node from 9.1.0 to 9.1.1
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 9.1.0 to 9.1.1.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v9.1.0...v9.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-08 08:49:26 +00:00
806deeaf78 Merge pull request #705 from dolanmiu/dependabot/npm_and_yarn/ts-node-9.1.0
build(deps-dev): bump ts-node from 9.0.0 to 9.1.0
2020-12-04 16:52:27 +00:00
feb121707d build(deps-dev): bump ts-node from 9.0.0 to 9.1.0
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 9.0.0 to 9.1.0.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v9.0.0...v9.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-12-03 08:01:46 +00:00
31c7f034ec Merge pull request #697 from devoidfury/master
Add defaultStyles option to overwrite the core default styles
2020-11-30 23:58:42 +00:00
30ab92652c move file options.defaultStyles to options.styles.default 2020-11-30 10:25:58 -06:00
0407548113 Merge pull request #702 from dolanmiu/dependabot/npm_and_yarn/prettier-2.2.1
build(deps-dev): bump prettier from 2.2.0 to 2.2.1
2020-11-30 14:48:17 +00:00
277845626c build(deps-dev): bump prettier from 2.2.0 to 2.2.1
Bumps [prettier](https://github.com/prettier/prettier) from 2.2.0 to 2.2.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.2.0...2.2.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-30 08:29:40 +00:00
b2af8b970e Merge pull request #693 from dolanmiu/dependabot/npm_and_yarn/prettier-2.2.0
build(deps-dev): bump prettier from 2.1.2 to 2.2.0
2020-11-29 20:16:38 +00:00
542866e18b Merge pull request #699 from dolanmiu/dependabot/npm_and_yarn/highlight.js-9.18.5
build(deps): [security] bump highlight.js from 9.18.1 to 9.18.5
2020-11-29 20:16:26 +00:00
f54192809f build(deps): [security] bump highlight.js from 9.18.1 to 9.18.5
Bumps [highlight.js](https://github.com/highlightjs/highlight.js) from 9.18.1 to 9.18.5. **This update includes a security fix.**
- [Release notes](https://github.com/highlightjs/highlight.js/releases)
- [Changelog](https://github.com/highlightjs/highlight.js/blob/9.18.5/CHANGES.md)
- [Commits](https://github.com/highlightjs/highlight.js/compare/9.18.1...9.18.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-24 23:10:41 +00:00
f3ba62fd88 bugfix path 2020-11-24 13:36:43 -06:00
8d4a07302b Add defaultStyles option to overwrite the core default styles (Heading 1-6, document, hyperlinks, etc) 2020-11-24 13:30:26 -06:00
d504231124 build(deps-dev): bump prettier from 2.1.2 to 2.2.0
Bumps [prettier](https://github.com/prettier/prettier) from 2.1.2 to 2.2.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.1.2...2.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-20 11:14:03 +00:00
173b1e118c Merge pull request #690 from dolanmiu/dependabot/npm_and_yarn/docsify-cli-4.4.2
build(deps-dev): bump docsify-cli from 4.4.1 to 4.4.2
2020-11-17 11:50:18 +00:00
ffba276f0d build(deps-dev): bump docsify-cli from 4.4.1 to 4.4.2
Bumps [docsify-cli](https://github.com/docsifyjs/docsify-cli) from 4.4.1 to 4.4.2.
- [Release notes](https://github.com/docsifyjs/docsify-cli/releases)
- [Changelog](https://github.com/docsifyjs/docsify-cli/blob/master/CHANGELOG.md)
- [Commits](https://github.com/docsifyjs/docsify-cli/compare/v4.4.1...v4.4.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-17 11:13:13 +00:00
b210608e56 Merge pull request #685 from dolanmiu/dependabot/npm_and_yarn/types/mocha-8.0.4
build(deps-dev): bump @types/mocha from 8.0.3 to 8.0.4
2020-11-16 12:53:20 +00:00
74353104dc Merge pull request #687 from dolanmiu/dependabot/npm_and_yarn/types/webpack-4.41.25
build(deps-dev): bump @types/webpack from 4.41.24 to 4.41.25
2020-11-16 12:53:09 +00:00
825136d1c9 Version bump 2020-11-15 23:04:27 +00:00
b2fea471f1 Add workaround to include file in build 2020-11-15 23:03:44 +00:00
e9adb8b0ed build(deps-dev): bump @types/webpack from 4.41.24 to 4.41.25
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.24 to 4.41.25.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-12 08:27:51 +00:00
5d6bc039d0 build(deps-dev): bump @types/mocha from 8.0.3 to 8.0.4
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.0.3 to 8.0.4.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-11-11 07:56:26 +00:00
27638063c8 Update README.md 2020-11-06 02:08:09 +00:00
f6a4d78ab7 Add checks when submitting PR 2020-11-06 01:51:59 +00:00
4061e31400 Merge pull request #679 from dolanmiu/feat/re-name
Re-name paragraph styles
2020-11-06 01:47:49 +00:00
74db67689f Re-name paragraph styles 2020-11-06 00:27:57 +00:00
2213eb28cb Add Github Actions badge 2020-11-05 02:44:05 +00:00
d1b45d416b Fix spacing issue 2020-11-05 00:33:54 +00:00
f72f7e7514 Add build files to demo workflow 2020-11-05 00:17:55 +00:00
0165cfb3e5 Fix typo 2020-11-05 00:11:02 +00:00
ef747486c0 Remove comments 2020-11-04 23:40:59 +00:00
e0b2f59c2f Add initial GitHub Actions workflow 2020-11-04 23:36:28 +00:00
82bdb301f9 Version bump 2020-11-04 02:52:28 +00:00
c7ea26e422 Add tests 2020-11-04 01:28:46 +00:00
34b2029efe Change API of track revisions to declarative 2020-11-04 00:00:16 +00:00
37e610d2b3 Fix typo 2020-10-30 00:13:52 +00:00
4882235d20 Merge pull request #673 from dolanmiu/dependabot/npm_and_yarn/types/webpack-4.41.24
build(deps-dev): bump @types/webpack from 4.41.23 to 4.41.24
2020-10-29 23:56:22 +00:00
1552ebde11 build(deps-dev): bump @types/webpack from 4.41.23 to 4.41.24
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.23 to 4.41.24.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-29 22:54:05 +00:00
d263d0c8a5 Merge pull request #669 from dolanmiu/feat/background-color
Add shading to paragraph
2020-10-29 01:57:28 +00:00
610b2388bb Fix linting 2020-10-29 00:39:45 +00:00
bcb16cef9b Merge pull request #672 from dolanmiu/dependabot/npm_and_yarn/sinon-9.2.1
build(deps-dev): bump sinon from 9.2.0 to 9.2.1
2020-10-28 19:42:18 +00:00
0f3afd94f3 build(deps-dev): bump sinon from 9.2.0 to 9.2.1
Bumps [sinon](https://github.com/sinonjs/sinon) from 9.2.0 to 9.2.1.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-28 15:28:10 +00:00
60eb686d05 Add shading to paragraph 2020-10-28 01:05:31 +00:00
7f5e43fba9 Merge pull request #667 from dolanmiu/feat/background-color
Background color for document
2020-10-27 02:45:19 +00:00
ed52ef358b Background color for document 2020-10-27 01:54:40 +00:00
214afab711 Merge branch 'master' of github.com:dolanmiu/docx 2020-10-24 21:38:30 +01:00
18a1677588 Add documentation reference 2020-10-24 21:38:20 +01:00
cae372e9ad Merge pull request #664 from dolanmiu/dependabot/npm_and_yarn/shortid-2.2.16
build(deps): bump shortid from 2.2.15 to 2.2.16
2020-10-24 21:03:53 +01:00
ea5f9a48ab Fix cantSplit documentation 2020-10-24 20:24:10 +01:00
dcf755e756 build(deps): bump shortid from 2.2.15 to 2.2.16
Bumps [shortid](https://github.com/dylang/shortid) from 2.2.15 to 2.2.16.
- [Release notes](https://github.com/dylang/shortid/releases)
- [Changelog](https://github.com/dylang/shortid/blob/master/CHANGELOG.md)
- [Commits](https://github.com/dylang/shortid/compare/2.2.15...2.2.16)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-24 00:40:43 +00:00
d445c21ea1 Merge pull request #662 from dolanmiu/dependabot/npm_and_yarn/types/webpack-4.41.23
build(deps-dev): bump @types/webpack from 4.41.22 to 4.41.23
2020-10-22 16:51:33 +01:00
6db0449ed0 build(deps-dev): bump @types/webpack from 4.41.22 to 4.41.23
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.22 to 4.41.23.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-21 11:55:53 +00:00
ae37b1980f Update Prettier 2020-10-16 16:20:04 +01:00
96f76906c4 Merge pull request #381 from dolanmiu/feat/math
MathML
2020-10-13 03:08:43 +01:00
19d9619785 Add more math documentation 2020-10-13 03:00:14 +01:00
5be195fd91 Turn math component into array 2020-10-13 02:06:27 +01:00
e36e9e1cf4 Add initial math documentation 2020-10-13 01:23:27 +01:00
102d6aa55c Add prepForXml test 2020-10-12 22:48:38 +01:00
daea8d2868 Make fractions take math component 2020-10-12 22:13:03 +01:00
700a74fd4c More math components 2020-10-10 13:41:26 +01:00
32a84a5ad0 Merge branch 'master' into feat/math 2020-10-08 10:25:45 +01:00
3c9f9474ce Merge pull request #653 from dolanmiu/dependabot/npm_and_yarn/sinon-9.2.0
build(deps-dev): bump sinon from 9.1.0 to 9.2.0
2020-10-07 11:49:11 +01:00
1e10686315 Merge pull request #644 from branzillacorp/track-revisions
basic support for track revisions
2020-10-07 11:48:47 +01:00
cae6405d9a improved signature for deleted text runs, added demo 54 and added documentation for change tracking 2020-10-07 11:44:23 +02:00
a884ce94e5 build(deps-dev): bump sinon from 9.1.0 to 9.2.0
Bumps [sinon](https://github.com/sinonjs/sinon) from 9.1.0 to 9.2.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v9.1.0...v9.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-07 08:55:47 +00:00
065c17de74 style fixes 2020-10-06 11:05:52 +02:00
09db2c528a added InsertedTextRun and DeletedTextRun for Revision Tracking 2020-10-06 11:05:52 +02:00
2adfe532dd add more unit tests for trackRevision settings 2020-10-06 11:05:52 +02:00
6cbe40cecb add settings option to add trackRevisions 2020-10-06 11:05:52 +02:00
6b9467393e Merge pull request #651 from dolanmiu/dependabot/npm_and_yarn/sinon-9.1.0
build(deps-dev): bump sinon from 9.0.3 to 9.1.0
2020-10-05 22:31:28 +01:00
5125e77431 build(deps-dev): bump sinon from 9.0.3 to 9.1.0
Bumps [sinon](https://github.com/sinonjs/sinon) from 9.0.3 to 9.1.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/compare/v9.0.3...v9.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-10-05 19:38:42 +00:00
ab68ae0092 Merge pull request #640 from dolanmiu/dependabot/npm_and_yarn/prettier-2.1.2
build(deps-dev): bump prettier from 2.1.1 to 2.1.2
2020-09-26 17:40:57 +01:00
38079b6171 build(deps-dev): bump prettier from 2.1.1 to 2.1.2
Bumps [prettier](https://github.com/prettier/prettier) from 2.1.1 to 2.1.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.1.1...2.1.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-21 18:43:32 +00:00
d584290f3d Merge pull request #635 from dolanmiu/dependabot/npm_and_yarn/node-fetch-2.6.1
build(deps): [security] bump node-fetch from 2.6.0 to 2.6.1
2020-09-13 03:01:42 +01:00
9b9baa9b4a Merge pull request #636 from netbymatt/master
Fix row height option documentation
2020-09-13 03:01:30 +01:00
c258310560 Merge pull request #1 from netbymatt/netbymatt-patch-1
Fix row height option
2020-09-11 21:10:45 -05:00
af0bf5ced5 Fix row height option 2020-09-11 21:10:10 -05:00
57c480a6c6 build(deps): [security] bump node-fetch from 2.6.0 to 2.6.1
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1. **This update includes a security fix.**
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-11 16:44:55 +00:00
25f7423533 Merge pull request #633 from dolanmiu/dependabot/npm_and_yarn/types/webpack-4.41.22
build(deps-dev): bump @types/webpack from 4.41.21 to 4.41.22
2020-09-08 12:44:14 +01:00
0c068bb03b build(deps-dev): bump @types/webpack from 4.41.21 to 4.41.22
Bumps [@types/webpack](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/webpack) from 4.41.21 to 4.41.22.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/webpack)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-09-07 18:39:58 +00:00
1822473abc Merge branch 'master' of github.com:dolanmiu/docx 2020-09-05 18:52:05 +01:00
93a7d607b2 Update PSD 2020-09-05 18:51:50 +01:00
d45213636c Add Clippy to readme 2020-09-05 18:41:24 +01:00
e196d9d917 Add Clippy the mascot 2020-09-05 18:40:40 +01:00
cf88e50afd Merge pull request #630 from dolanmiu/dependabot/npm_and_yarn/prettier-2.1.1
build(deps-dev): bump prettier from 2.1.0 to 2.1.1
2020-08-31 22:06:05 +01:00
64e5814c31 Merge pull request #631 from dolanmiu/dependabot/npm_and_yarn/types/node-14.6.2
build(deps): bump @types/node from 14.6.0 to 14.6.2
2020-08-31 22:05:54 +01:00
37251c84f8 build(deps): bump @types/node from 14.6.0 to 14.6.2
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.6.0 to 14.6.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-31 19:37:11 +00:00
a576098639 build(deps-dev): bump prettier from 2.1.0 to 2.1.1
Bumps [prettier](https://github.com/prettier/prettier) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.1.0...2.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-31 19:36:39 +00:00
2450fe83ce Merge pull request #624 from dolanmiu/dependabot/npm_and_yarn/ts-node-9.0.0
build(deps-dev): bump ts-node from 8.10.2 to 9.0.0
2020-08-27 01:13:34 +01:00
e1004440d2 Merge pull request #625 from dolanmiu/dependabot/npm_and_yarn/prettier-2.1.0
build(deps-dev): bump prettier from 2.0.5 to 2.1.0
2020-08-27 01:13:15 +01:00
491c7abd1c build(deps-dev): bump prettier from 2.0.5 to 2.1.0
Bumps [prettier](https://github.com/prettier/prettier) from 2.0.5 to 2.1.0.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/master/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.0.5...2.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-24 18:36:24 +00:00
364ce6d856 build(deps-dev): bump ts-node from 8.10.2 to 9.0.0
Bumps [ts-node](https://github.com/TypeStrong/ts-node) from 8.10.2 to 9.0.0.
- [Release notes](https://github.com/TypeStrong/ts-node/releases)
- [Commits](https://github.com/TypeStrong/ts-node/compare/v8.10.2...v9.0.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-24 18:35:48 +00:00
ffb6b73bb7 Merge pull request #618 from dolanmiu/dependabot/npm_and_yarn/dot-prop-4.2.1
build(deps): [security] bump dot-prop from 4.2.0 to 4.2.1
2020-08-21 23:55:11 +01:00
6041c39a26 Merge pull request #619 from dolanmiu/dependabot/npm_and_yarn/types/node-14.6.0
build(deps): bump @types/node from 14.0.27 to 14.6.0
2020-08-21 23:54:59 +01:00
c54f0a52f6 Merge pull request #621 from RayBB/patch-1
remove broken examples link
2020-08-21 23:54:42 +01:00
6b87d9c038 Merge pull request #620 from dolanmiu/dependabot/npm_and_yarn/types/mocha-8.0.3
build(deps-dev): bump @types/mocha from 8.0.2 to 8.0.3
2020-08-21 23:54:21 +01:00
1285304f97 remove broken examples link 2020-08-19 10:54:27 -10:00
58fae6b201 build(deps-dev): bump @types/mocha from 8.0.2 to 8.0.3
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.0.2 to 8.0.3.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-18 08:30:15 +00:00
dc1f3aebe9 build(deps): bump @types/node from 14.0.27 to 14.6.0
Bumps [@types/node](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/node) from 14.0.27 to 14.6.0.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/node)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-18 08:29:38 +00:00
8a189161f2 build(deps): [security] bump dot-prop from 4.2.0 to 4.2.1
Bumps [dot-prop](https://github.com/sindresorhus/dot-prop) from 4.2.0 to 4.2.1. **This update includes a security fix.**
- [Release notes](https://github.com/sindresorhus/dot-prop/releases)
- [Commits](https://github.com/sindresorhus/dot-prop/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-18 08:28:30 +00:00
6667595627 Merge pull request #615 from dolanmiu/dependabot/npm_and_yarn/sinon-9.0.3
build(deps-dev): bump sinon from 9.0.2 to 9.0.3
2020-08-13 01:27:02 +01:00
33befaab09 Merge pull request #616 from dolanmiu/dependabot/npm_and_yarn/types/mocha-8.0.2
build(deps-dev): bump @types/mocha from 8.0.1 to 8.0.2
2020-08-12 22:52:13 +01:00
c91f135c28 build(deps-dev): bump @types/mocha from 8.0.1 to 8.0.2
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.0.1 to 8.0.2.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-12 08:37:49 +00:00
08f9926e60 build(deps-dev): bump sinon from 9.0.2 to 9.0.3
Bumps [sinon](https://github.com/sinonjs/sinon) from 9.0.2 to 9.0.3.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sinonjs/sinon/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-11 08:38:15 +00:00
f323b293fb Merge pull request #606 from dolanmiu/dependabot/npm_and_yarn/types/mocha-8.0.1
build(deps-dev): bump @types/mocha from 8.0.0 to 8.0.1
2020-08-08 01:36:47 +01:00
adc91929b0 Merge pull request #609 from LeovR/patch-1
Fix comment regarding output file name
2020-08-08 01:36:34 +01:00
c63cba5a0c Merge pull request #610 from dolanmiu/dependabot/npm_and_yarn/prismjs-1.21.0
build(deps): [security] bump prismjs from 1.20.0 to 1.21.0
2020-08-08 01:36:01 +01:00
e65e7d6a32 Add custom properties demo 2020-08-08 11:01:21 +12:00
7a48da440b build(deps): [security] bump prismjs from 1.20.0 to 1.21.0
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.20.0 to 1.21.0. **This update includes a security fix.**
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.20.0...v1.21.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-07 22:43:32 +00:00
05dda37b71 Fix comment regarding output file name 2020-08-06 08:56:02 +00:00
fc87a73259 Remove unnecessary properties getter 2020-08-04 09:15:20 +12:00
ec4c4fb5c4 Run updated prettier 2020-08-04 08:50:56 +12:00
ee43585210 build(deps-dev): bump @types/mocha from 8.0.0 to 8.0.1
Bumps [@types/mocha](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/mocha) from 8.0.0 to 8.0.1.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/mocha)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2020-08-03 09:48:31 +00:00
870c222dd5 Allow custom text properties to be included 2020-08-03 17:08:04 +12:00
6b3d1d5579 modifications make to table-row files to correct table-row height property. Code was previously using height.height ini setHeight but should instead be using value. 2020-07-16 12:37:24 +00:00
5bca7d155f Restart page numbering
Add separator option
2020-02-28 18:44:41 +00:00
db7c4da609 Add ability to add multiple text runs to a bookmark 2020-01-01 22:54:42 +00:00
9c11653313 Multiple paragraphs in footnotes 2020-01-01 20:22:42 +00:00
9aab68a8f8 Merge branch 'master' into feat/math
# Conflicts:
#	src/file/paragraph/index.ts
#	src/file/paragraph/paragraph.ts
2019-11-01 02:43:14 +00:00
2100b7b7d2 Updated custom styles 2019-10-24 20:18:52 -05:00
2cf1cce06d Adds demo to show XML StyleId applied to a table 2019-10-24 13:46:39 -05:00
4ca44d335d Adds setStyle to spec 2019-10-21 13:09:44 -05:00
358d578cd7 Moves setStyle to be the first set property
This allows other settings as width to be overriden
2019-10-21 13:09:04 -05:00
c61d24d8d4 Allows user to specify style id for Tables
Allows user to specify the style Id which will be added in the form of:
<w:tblStyle w:val="TableGrid"/>

As specified in table Structure in http://officeopenxml.com/WPtable.php
2019-10-21 11:40:05 -05:00
4f8d435e16 Add Math Summation 2019-08-20 20:40:40 +01:00
a1b9be453b Add math run and fraction 2019-08-15 00:47:55 +01:00
545 changed files with 39711 additions and 12144 deletions

View File

@ -7,6 +7,7 @@ indent_style = space
indent_size = 4 indent_size = 4
insert_final_newline = true insert_final_newline = true
trim_trailing_whitespace = true trim_trailing_whitespace = true
end_of_line = lf
[*.md] [*.md]
max_line_length = off max_line_length = off

9
.github/ISSUE_TEMPLATE.md vendored Normal file
View File

@ -0,0 +1,9 @@
# Thank you for raising an issue to `docx`
Please do not raise an issue unless it is an **issue**.
- Is your issue a feature request? Are you giving ideas to the community? Are you asking for help? Please raise a ticket in the `Discussions` section:
https://github.com/dolanmiu/docx/discussions
- Is your issue a previously asked? Please respond to that thread instead

40
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,40 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
ignore:
- dependency-name: "@types/node"
versions:
- 14.14.22
- 14.14.24
- 14.14.25
- 14.14.26
- 14.14.28
- 14.14.29
- 14.14.30
- 15.0.0
- dependency-name: webpack
versions:
- 5.31.2
- 5.35.0
- dependency-name: ts-loader
versions:
- 9.1.0
- dependency-name: awesome-typescript-loader
versions:
- 5.2.1
- dependency-name: chai
versions:
- 4.2.0
- 4.3.0
- 4.3.1
- 4.3.3
- dependency-name: replace-in-file
versions:
- 6.1.0
- dependency-name: "@types/chai"
versions:
- 4.2.14

60
.github/workflows/default.yml vendored Normal file
View File

@ -0,0 +1,60 @@
name: Default
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: build
path: build
test:
name: Test
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm ci
- name: Test
run: npm run test.coverage
- name: Codecov
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true
verbose: true
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm ci
- name: Lint
run: npm run lint
prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm ci
- name: Prettier
run: npm run style

690
.github/workflows/demos.yml vendored Normal file
View File

@ -0,0 +1,690 @@
name: Demos
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm ci
- name: Build
run: npm run build
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: build
path: build
demos:
name: Run Demos and Validate
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm ci
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: build
path: build
- name: Run Demo
run: npm run ts-node -- ./demo/1-basic.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/2-declaritive-styles.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/3-numbering-and-bullet-points.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/4-basic-table.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/5-images.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/6-page-borders.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/7-landscape.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/8-header-footer.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/9-images-in-header-and-footer.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/10-my-cv.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/11-declaritive-styles-2.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/12-scaling-images.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/13-xml-styles.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/14-page-numbers.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/15-page-break-before.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/16-multiple-sections.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/17-footnotes.ts
- name: Extract Word Document
run: npm run extract
# element r: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}r': This element is not expected.
# - name: Validate XML
# uses: ChristophWurst/xmllint-action@v1
# with:
# xml-file: build/extracted-doc/word/document.xml
# xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/18-image-from-buffer.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/19-export-to-base64.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/20-table-cell-borders.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/21-bookmarks.ts
- name: Extract Word Document
run: npm run extract
# Bad ID - need numeric ID
# - name: Validate XML
# uses: ChristophWurst/xmllint-action@v1
# with:
# xml-file: build/extracted-doc/word/document.xml
# xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/22-right-to-left-text.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/23-base64-images.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/24-images-to-table-cell.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/25-table-xml-styles.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/26-paragraph-borders.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/27-declaritive-styles-3.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/28-table-of-contents.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/29-numbered-lists.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/30-template-document.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/31-tables.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/32-merge-and-shade-table-cells.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/33-sequential-captions.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/34-floating-tables.ts
- name: Extract Word Document
run: npm run extract
# element tblpPr: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}tblpPr', attribute 'overlap': The attribute 'overlap' is not allowed.
# element tblpPr: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}tblpPr': Element content is not allowed, because the content type is empty.
# - name: Validate XML
# uses: ChristophWurst/xmllint-action@v1
# with:
# xml-file: build/extracted-doc/word/document.xml
# xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/35-hyperlinks.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/36-image-to-table-cell.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/37-images-to-header-and-footer.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/38-text-wrapping.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/39-page-numbers.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/40-line-numbers.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/41-merge-table-cells-2.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/42-restart-page-numbers.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/43-images-to-table-cell-2.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/44-multiple-columns.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/45-highlighting-text.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/46-shading-text.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/47-number-of-total-pages-section.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/48-vertical-align.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/49-table-borders.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/50-readme-demo.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/51-character-styles.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/52-japanese.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/53-chinese.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/54-custom-properties.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/55-math.ts
- name: Extract Word Document
run: npm run extract
#: element subHide: Schemas validity error : Element '{http://schemas.openxmlformats.org/officeDocument/2006/math}subHide': This element is not expected. Expected is ( {http://schemas.openxmlformats.org/officeDocument/2006/math}ctrlPr ).
#: element e: Schemas validity error : Element '{http://schemas.openxmlformats.org/officeDocument/2006/math}e': This element is not expected. Expected is ( {http://schemas.openxmlformats.org/officeDocument/2006/math}sub ).
#: element e: Schemas validity error : Element '{http://schemas.openxmlformats.org/officeDocument/2006/math}e': This element is not expected. Expected is ( {http://schemas.openxmlformats.org/officeDocument/2006/math}sup ).
#: element e: Schemas validity error : Element '{http://schemas.openxmlformats.org/officeDocument/2006/math}e': This element is not expected. Expected is ( {http://schemas.openxmlformats.org/officeDocument/2006/math}sub ).
# - name: Validate XML
# uses: ChristophWurst/xmllint-action@v1
# with:
# xml-file: build/extracted-doc/word/document.xml
# xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/56-background-color.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/57-add-parent-numbered-lists.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/58-section-types.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/59-header-footer-margins.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/60-track-revisions.ts
- name: Extract Word Document
run: npm run extract
# element r: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}r': This element is not expected.
# - name: Validate XML
# uses: ChristophWurst/xmllint-action@v1
# with:
# xml-file: build/extracted-doc/word/document.xml
# xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/61-text-frame.ts
- name: Extract Word Document
run: npm run extract
# element left: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}left': This element is not expected. Expected is one of ( {http://schemas.openxmlformats.org/wordprocessingml/2006/main}right, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}between, {http://schemas.openxmlformats.org/wordprocessingml/2006/main}bar ).
# - name: Validate XML
# uses: ChristophWurst/xmllint-action@v1
# with:
# xml-file: build/extracted-doc/word/document.xml
# xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/62-paragraph-spacing.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/63-odd-even-header-footer.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/64-complex-numbering-text.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/65-page-sizes.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/66-fields.ts
- name: Extract Word Document
run: npm run extract
# element bookmarkStart: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}bookmarkStart', attribute '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}id': '-irrswq-ln94j4fdgdjxs' is not a valid value of the atomic type '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_DecimalNumber'.
# element bookmarkEnd: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}bookmarkEnd', attribute '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}id': '-irrswq-ln94j4fdgdjxs' is not a valid value of the atomic type '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}ST_DecimalNumber'.
# - name: Validate XML
# uses: ChristophWurst/xmllint-action@v1
# with:
# xml-file: build/extracted-doc/word/document.xml
# xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/67-column-break.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/68-numbering-instances-and-starting-number.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/69-different-width-columns.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/70-line-numbers-suppression.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
- name: Run Demo
run: npm run ts-node -- ./demo/71-page-borders-2.ts
- name: Extract Word Document
run: npm run extract
- name: Validate XML
uses: ChristophWurst/xmllint-action@v1
with:
xml-file: build/extracted-doc/word/document.xml
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd

43
.github/workflows/github-pages.yml vendored Normal file
View File

@ -0,0 +1,43 @@
name: Github Pages
on:
push:
branches:
- master
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@master
- name: Install Dependencies
run: npm ci
- name: Build 🔧
run: |
npm run typedoc
echo "docx.js.org" > docs/.nojekyll
echo "docx.js.org" > docs/CNAME
- name: Archive Production Artifact
uses: actions/upload-artifact@master
with:
name: docs
path: docs
deploy:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout Repo 🛎️
uses: actions/checkout@master
- name: Install Dependencies
run: npm ci
- name: Download Artifact
uses: actions/download-artifact@master
with:
name: docs
path: docs
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@4.1.5
with:
branch: gh-pages
folder: docs

View File

@ -0,0 +1,26 @@
name: Remove old artifacts
on:
schedule:
# Every day at 1am
- cron: "0 1 * * *"
workflow_dispatch:
inputs:
logLevel:
description: "Log level"
required: true
default: "warning"
jobs:
remove-old-artifacts:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Remove old artifacts
uses: c-hive/gha-remove-artifacts@v1
with:
age: "1 week"
# Optional inputs
# skip-tags: true
# skip-recent: 5

9
.nycrc
View File

@ -1,9 +1,9 @@
{ {
"check-coverage": true, "check-coverage": true,
"lines": 96.81, "lines": 99.32,
"functions": 93.80, "functions": 99.11,
"branches": 92.63, "branches": 96.27,
"statements": 96.80, "statements": 99.32,
"include": [ "include": [
"src/**/*.ts" "src/**/*.ts"
], ],
@ -21,6 +21,5 @@
], ],
"cache": true, "cache": true,
"all": true, "all": true,
"instrument": false,
"sourceMap": true "sourceMap": true
} }

View File

@ -1,63 +0,0 @@
language: node_js
node_js:
- 10
install:
- npm install
- npm install -g codecov
script:
- npm run lint
- npm run test.coverage
- npm run style
- npm run build
- npm run ts-node -- ./demo/1-basic.ts
# - npm run e2e "My Document.docx"
- npm run ts-node -- ./demo/2-declaritive-styles.ts
- npm run ts-node -- ./demo/3-numbering-and-bullet-points.ts
- npm run ts-node -- ./demo/4-basic-table.ts
- npm run ts-node -- ./demo/5-images.ts
- npm run ts-node -- ./demo/6-page-borders.ts
- npm run ts-node -- ./demo/7-landscape.ts
- npm run ts-node -- ./demo/8-header-footer.ts
- npm run ts-node -- ./demo/9-images-in-header-and-footer.ts
- npm run ts-node -- ./demo/10-my-cv.ts
# - npm run e2e "My Document.docx"
- npm run ts-node -- ./demo/11-declaritive-styles-2.ts
- npm run ts-node -- ./demo/12-scaling-images.ts
- npm run ts-node -- ./demo/13-xml-styles.ts
- npm run ts-node -- ./demo/14-page-numbers.ts
- npm run ts-node -- ./demo/15-page-break-before.ts
- npm run ts-node -- ./demo/16-multiple-sections.ts
- npm run ts-node -- ./demo/17-footnotes.ts
- npm run ts-node -- ./demo/18-image-from-buffer.ts
- npm run ts-node -- ./demo/19-export-to-base64.ts
- npm run ts-node -- ./demo/20-table-cell-borders.ts
- npm run ts-node -- ./demo/21-bookmarks.ts
- npm run ts-node -- ./demo/22-right-to-left-text.ts
- npm run ts-node -- ./demo/23-base64-images.ts
- npm run ts-node -- ./demo/24-images-to-table-cell.ts
# - npm run ts-node -- ./demo/demo25.ts
- npm run ts-node -- ./demo/26-paragraph-borders.ts
- npm run ts-node -- ./demo/27-declaritive-styles-3.ts
- npm run ts-node -- ./demo/28-table-of-contents.ts
- npm run ts-node -- ./demo/29-numbered-lists.ts
- npm run ts-node -- ./demo/30-template-document.ts
- npm run ts-node -- ./demo/31-tables.ts
- npm run ts-node -- ./demo/32-merge-and-shade-table-cells.ts
# - npm run e2e "My Document.docx" // Need to fix
- npm run ts-node -- ./demo/33-sequential-captions.ts
- npm run ts-node -- ./demo/34-floating-tables.ts
after_failure:
- "cat /home/travis/builds/dolanmiu/docx/npm-debug.log"
after_success:
- npm run typedoc
- echo "docx.js.org" > docs/.nojekyll
- echo "docx.js.org" > docs/CNAME
- codecov
deploy:
provider: pages
skip-cleanup: true
github-token: $GITHUB_TOKEN
keep-history: true
local-dir: docs
on:
branch: master

View File

@ -10,7 +10,7 @@
[![NPM version][npm-image]][npm-url] [![NPM version][npm-image]][npm-url]
[![Downloads per month][downloads-image]][downloads-url] [![Downloads per month][downloads-image]][downloads-url]
[![Build Status][travis-image]][travis-url] [![GitHub Action Workflow Status][github-actions-workflow-image]][github-actions-workflow-url]
[![Dependency Status][daviddm-image]][daviddm-url] [![Dependency Status][daviddm-image]][daviddm-url]
[![Known Vulnerabilities][snky-image]][snky-url] [![Known Vulnerabilities][snky-image]][snky-url]
[![Chat on Gitter][gitter-image]][gitter-url] [![Chat on Gitter][gitter-image]][gitter-url]
@ -18,7 +18,7 @@
[![codecov][codecov-image]][codecov-url] [![codecov][codecov-image]][codecov-url]
<p align="center"> <p align="center">
<img src="https://i.imgur.com/TCH0YzD.png" alt="drawing" width="800"/> <img src="https://i.imgur.com/QeL1HuU.png" alt="drawing"/>
</p> </p>
# Demo # Demo
@ -28,16 +28,16 @@
Here are examples of `docx` being used with basic `HTML/JS` in a browser environment: Here are examples of `docx` being used with basic `HTML/JS` in a browser environment:
* https://codepen.io/dolanmiu/pen/RwNeObg * https://codepen.io/dolanmiu/pen/RwNeObg
* https://jsfiddle.net/dolanmiu/kqxrj35u/1/ * https://jsfiddle.net/dolanmiu/onadx1gu/
Here is an example of `docx` working in `Angular`: Here is an example of `docx` working in `Angular`:
* https://stackblitz.com/edit/angular-afvxtz * https://stackblitz.com/edit/angular-docx
Here is an example of `docx` working in `React`: Here is an example of `docx` working in `React`:
* https://stackblitz.com/edit/react-ts-qq25sp * https://stackblitz.com/edit/react-docx
* https://stackblitz.com/edit/react-ts-qdqu7z (adding images to Word Document) * https://stackblitz.com/edit/react-docx-images (adding images to Word Document)
Here is an example of `docx` working in `Vue.js`: Here is an example of `docx` working in `Vue.js`:
@ -67,7 +67,7 @@ Please refer to the [documentation at https://docx.js.org/](https://docx.js.org/
# Examples # Examples
Check the `examples` section in the [documentation](https://docx.js.org/#/examples) and the [demo folder](https://github.com/dolanmiu/docx/tree/master/demo) for examples. Check the [demo folder](https://github.com/dolanmiu/docx/tree/master/demo) for examples.
# Contributing # Contributing
@ -83,8 +83,10 @@ Read the contribution guidelines [here](https://docx.js.org/#/contribution-guide
[<img src="https://i.imgur.com/1LjuK2M.png" alt="drawing" height="50"/>](https://turbopatent.com/) [<img src="https://i.imgur.com/1LjuK2M.png" alt="drawing" height="50"/>](https://turbopatent.com/)
[<img src="https://i.imgur.com/dHMg0wF.gif" alt="drawing" height="50"/>](http://www.madisoncres.com/) [<img src="https://i.imgur.com/dHMg0wF.gif" alt="drawing" height="50"/>](http://www.madisoncres.com/)
[<img src="https://i.imgur.com/QEZXU5b.png" alt="drawing" height="50"/>](https://www.beekast.com/) [<img src="https://i.imgur.com/QEZXU5b.png" alt="drawing" height="50"/>](https://www.beekast.com/)
[<img src="https://imgur.com/XVU6aoi.png" alt="drawing" height="50"/>](https://herraizsoto.com/) [<img src="https://i.imgur.com/XVU6aoi.png" alt="drawing" height="50"/>](https://herraizsoto.com/)
[<img src="https://i.imgur.com/fn1xccG.png" alt="drawing" height="50"/>](http://www.ativer.com.br/) [<img src="https://i.imgur.com/fn1xccG.png" alt="drawing" height="50"/>](http://www.ativer.com.br/)
[<img src="https://i.imgur.com/cmykN7c.png" alt="drawing" />](https://www.arity.co/)
[<img src="https://i.imgur.com/PXo25um.png" alt="drawing" height="50"/>](https://www.circadianrisk.com/)
...and many more! ...and many more!
@ -100,8 +102,8 @@ Made with 💖
[npm-url]: https://npmjs.org/package/docx [npm-url]: https://npmjs.org/package/docx
[downloads-image]: https://img.shields.io/npm/dm/docx.svg [downloads-image]: https://img.shields.io/npm/dm/docx.svg
[downloads-url]: https://npmjs.org/package/docx [downloads-url]: https://npmjs.org/package/docx
[travis-image]: https://travis-ci.org/dolanmiu/docx.svg?branch=master [github-actions-workflow-image]: https://github.com/dolanmiu/docx/workflows/Default/badge.svg
[travis-url]: https://travis-ci.org/dolanmiu/docx [github-actions-workflow-url]: https://github.com/dolanmiu/docx/actions
[daviddm-image]: https://david-dm.org/dolanmiu/docx.svg?theme=shields.io [daviddm-image]: https://david-dm.org/dolanmiu/docx.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/dolanmiu/docx [daviddm-url]: https://david-dm.org/dolanmiu/docx
[snky-image]: https://snyk.io/test/github/dolanmiu/docx/badge.svg [snky-image]: https://snyk.io/test/github/dolanmiu/docx/badge.svg

View File

@ -3,24 +3,26 @@
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun } from "../build"; import { Document, Packer, Paragraph, TextRun } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
doc.addSection({ {
properties: {}, properties: {},
children: [
new Paragraph({
children: [ children: [
new TextRun("Hello World"), new Paragraph({
new TextRun({ children: [
text: "Foo Bar", new TextRun("Hello World"),
bold: true, new TextRun({
}), text: "Foo Bar",
new TextRun({ bold: true,
text: "\tGithub is the best", }),
bold: true, new TextRun({
text: "\tGithub is the best",
bold: true,
}),
],
}), }),
], ],
}), },
], ],
}); });

View File

@ -9,7 +9,46 @@ const PHONE_NUMBER = "07534563401";
const PROFILE_URL = "https://www.linkedin.com/in/dolan1"; const PROFILE_URL = "https://www.linkedin.com/in/dolan1";
const EMAIL = "docx@com"; const EMAIL = "docx@com";
const experiences = [ interface Experience {
readonly isCurrent: boolean;
readonly summary: string;
readonly title: string;
readonly startDate: {
readonly month: number;
readonly year: number;
};
readonly endDate?: {
readonly month: number;
readonly year: number;
};
readonly company: {
readonly name: string;
};
}
interface Education {
readonly degree: string;
readonly fieldOfStudy: string;
readonly notes: string;
readonly schoolName: string;
readonly startDate: {
readonly year: number;
};
readonly endDate: {
readonly year: number;
};
}
interface Skill {
readonly name: string;
}
interface Achivement {
readonly issuer: string;
readonly name: string;
}
const experiences: Experience[] = [
{ {
isCurrent: true, isCurrent: true,
summary: "Full-stack developer working with Angular and Java. Working for the iShares platform", summary: "Full-stack developer working with Angular and Java. Working for the iShares platform",
@ -75,12 +114,11 @@ const experiences = [
}, },
]; ];
const education = [ const education: Education[] = [
{ {
degree: "Master of Science (MSc)", degree: "Master of Science (MSc)",
fieldOfStudy: "Computer Science", fieldOfStudy: "Computer Science",
notes: notes: "Exam Results: 1st Class with Distinction, Dissertation: 1st Class with Distinction\n\nRelevant Courses: Java and C# Programming, Software Engineering, Artificial Intelligence, \nComputational Photography, Algorithmics, Architecture and Hardware.\n\nCreated a Windows 8 game in JavaScript for the dissertation. \n\nCreated an award-winning 3D stereoscopic game in C# using XNA.",
"Exam Results: 1st Class with Distinction, Dissertation: 1st Class with Distinction\n\nRelevant Courses: Java and C# Programming, Software Engineering, Artificial Intelligence, \nComputational Photography, Algorithmics, Architecture and Hardware.\n\nCreated a Windows 8 game in JavaScript for the dissertation. \n\nCreated an award-winning 3D stereoscopic game in C# using XNA.",
schoolName: "University College London", schoolName: "University College London",
startDate: { startDate: {
year: 2012, year: 2012,
@ -92,8 +130,7 @@ const education = [
{ {
degree: "Bachelor of Engineering (BEng)", degree: "Bachelor of Engineering (BEng)",
fieldOfStudy: "Material Science and Engineering", fieldOfStudy: "Material Science and Engineering",
notes: notes: "Exam Results: 2:1, Dissertation: 1st Class with Distinction\n\nRelevant courses: C Programming, Mathematics and Business for Engineers.",
"Exam Results: 2:1, Dissertation: 1st Class with Distinction\n\nRelevant courses: C Programming, Mathematics and Business for Engineers.",
schoolName: "Imperial College London", schoolName: "Imperial College London",
startDate: { startDate: {
year: 2009, year: 2009,
@ -104,7 +141,7 @@ const education = [
}, },
]; ];
const skills = [ const skills: Skill[] = [
{ {
name: "Angular", name: "Angular",
}, },
@ -119,7 +156,7 @@ const skills = [
}, },
]; ];
const achievements = [ const achievements: Achivement[] = [
{ {
issuer: "Oracle", issuer: "Oracle",
name: "Oracle Certified Expert", name: "Oracle Certified Expert",
@ -128,71 +165,76 @@ const achievements = [
class DocumentCreator { class DocumentCreator {
// tslint:disable-next-line: typedef // tslint:disable-next-line: typedef
public create([experiences, educations, skills, achivements]): Document { public create([experiences, educations, skills, achivements]: [Experience[], Education[], Skill[], Achivement[]]): Document {
const document = new Document(); const document = new Document({
sections: [
{
children: [
new Paragraph({
text: "Dolan Miu",
heading: HeadingLevel.TITLE,
}),
this.createContactInfo(PHONE_NUMBER, PROFILE_URL, EMAIL),
this.createHeading("Education"),
...educations
.map((education) => {
const arr: Paragraph[] = [];
arr.push(
this.createInstitutionHeader(
education.schoolName,
`${education.startDate.year} - ${education.endDate.year}`,
),
);
arr.push(this.createRoleText(`${education.fieldOfStudy} - ${education.degree}`));
document.addSection({ const bulletPoints = this.splitParagraphIntoBullets(education.notes);
children: [ bulletPoints.forEach((bulletPoint) => {
new Paragraph({ arr.push(this.createBullet(bulletPoint));
text: "Dolan Miu", });
heading: HeadingLevel.TITLE,
}),
this.createContactInfo(PHONE_NUMBER, PROFILE_URL, EMAIL),
this.createHeading("Education"),
...educations
.map((education) => {
const arr: Paragraph[] = [];
arr.push(
this.createInstitutionHeader(education.schoolName, `${education.startDate.year} - ${education.endDate.year}`),
);
arr.push(this.createRoleText(`${education.fieldOfStudy} - ${education.degree}`));
const bulletPoints = this.splitParagraphIntoBullets(education.notes); return arr;
bulletPoints.forEach((bulletPoint) => { })
arr.push(this.createBullet(bulletPoint)); .reduce((prev, curr) => prev.concat(curr), []),
}); this.createHeading("Experience"),
...experiences
.map((position) => {
const arr: Paragraph[] = [];
return arr; arr.push(
}) this.createInstitutionHeader(
.reduce((prev, curr) => prev.concat(curr), []), position.company.name,
this.createHeading("Experience"), this.createPositionDateText(position.startDate, position.endDate, position.isCurrent),
...experiences ),
.map((position) => { );
const arr: Paragraph[] = []; arr.push(this.createRoleText(position.title));
arr.push( const bulletPoints = this.splitParagraphIntoBullets(position.summary);
this.createInstitutionHeader(
position.company.name,
this.createPositionDateText(position.startDate, position.endDate, position.isCurrent),
),
);
arr.push(this.createRoleText(position.title));
const bulletPoints = this.splitParagraphIntoBullets(position.summary); bulletPoints.forEach((bulletPoint) => {
arr.push(this.createBullet(bulletPoint));
});
bulletPoints.forEach((bulletPoint) => { return arr;
arr.push(this.createBullet(bulletPoint)); })
}); .reduce((prev, curr) => prev.concat(curr), []),
this.createHeading("Skills, Achievements and Interests"),
return arr; this.createSubHeading("Skills"),
}) this.createSkillList(skills),
.reduce((prev, curr) => prev.concat(curr), []), this.createSubHeading("Achievements"),
this.createHeading("Skills, Achievements and Interests"), ...this.createAchivementsList(achivements),
this.createSubHeading("Skills"), this.createSubHeading("Interests"),
this.createSkillList(skills), this.createInterests("Programming, Technology, Music Production, Web Design, 3D Modelling, Dancing."),
this.createSubHeading("Achievements"), this.createHeading("References"),
...this.createAchivementsList(achivements), new Paragraph(
this.createSubHeading("Interests"), "Dr. Dean Mohamedally Director of Postgraduate Studies Department of Computer Science, University College London Malet Place, Bloomsbury, London WC1E d.mohamedally@ucl.ac.uk",
this.createInterests("Programming, Technology, Music Production, Web Design, 3D Modelling, Dancing."), ),
this.createHeading("References"), new Paragraph("More references upon request"),
new Paragraph( new Paragraph({
"Dr. Dean Mohamedally Director of Postgraduate Studies Department of Computer Science, University College London Malet Place, Bloomsbury, London WC1E d.mohamedally@ucl.ac.uk", text: "This CV was generated in real-time based on my Linked-In profile from my personal website www.dolan.bio.",
), alignment: AlignmentType.CENTER,
new Paragraph("More references upon request"), }),
new Paragraph({ ],
text: "This CV was generated in real-time based on my Linked-In profile from my personal website www.dolan.bio.", },
alignment: AlignmentType.CENTER,
}),
], ],
}); });
@ -204,7 +246,10 @@ class DocumentCreator {
alignment: AlignmentType.CENTER, alignment: AlignmentType.CENTER,
children: [ children: [
new TextRun(`Mobile: ${phoneNumber} | LinkedIn: ${profileUrl} | Email: ${email}`), new TextRun(`Mobile: ${phoneNumber} | LinkedIn: ${profileUrl} | Email: ${email}`),
new TextRun("Address: 58 Elm Avenue, Kent ME4 6ER, UK").break(), new TextRun({
text: "Address: 58 Elm Avenue, Kent ME4 6ER, UK",
break: 1,
}),
], ],
}); });
} }

View File

@ -3,10 +3,11 @@
import * as fs from "fs"; import * as fs from "fs";
import { import {
AlignmentType, AlignmentType,
convertInchesToTwip,
Document, Document,
Footer, Footer,
HeadingLevel, HeadingLevel,
Media, ImageRun,
Packer, Packer,
Paragraph, Paragraph,
Table, Table,
@ -14,17 +15,59 @@ import {
TableRow, TableRow,
TabStopPosition, TabStopPosition,
UnderlineType, UnderlineType,
LevelFormat,
} from "../build"; } from "../build";
const table = new Table({
rows: [
new TableRow({
children: [
new TableCell({
children: [new Paragraph("Test cell 1.")],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [new Paragraph("Test cell 2.")],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [new Paragraph("Test cell 3.")],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [new Paragraph("Test cell 4.")],
}),
],
}),
],
});
const doc = new Document({ const doc = new Document({
styles: { numbering:{
paragraphStyles: [ config:[{
reference: 'ref1',
levels: [
{ {
id: "Heading1", level: 0,
name: "Heading 1", format: LevelFormat.DECIMAL,
basedOn: "Normal", text: '%1)',
next: "Normal", start: 50,
quickFormat: true, }
],
}]
},
styles: {
default: {
heading1: {
run: { run: {
font: "Calibri", font: "Calibri",
size: 52, size: 52,
@ -40,12 +83,7 @@ const doc = new Document({
spacing: { line: 340 }, spacing: { line: 340 },
}, },
}, },
{ heading2: {
id: "Heading2",
name: "Heading 2",
basedOn: "Normal",
next: "Normal",
quickFormat: true,
run: { run: {
font: "Calibri", font: "Calibri",
size: 26, size: 26,
@ -55,12 +93,7 @@ const doc = new Document({
spacing: { line: 340 }, spacing: { line: 340 },
}, },
}, },
{ heading3: {
id: "Heading3",
name: "Heading 3",
basedOn: "Normal",
next: "Normal",
quickFormat: true,
run: { run: {
font: "Calibri", font: "Calibri",
size: 26, size: 26,
@ -70,12 +103,7 @@ const doc = new Document({
spacing: { line: 276 }, spacing: { line: 276 },
}, },
}, },
{ heading4: {
id: "Heading4",
name: "Heading 4",
basedOn: "Normal",
next: "Normal",
quickFormat: true,
run: { run: {
font: "Calibri", font: "Calibri",
size: 26, size: 26,
@ -85,6 +113,8 @@ const doc = new Document({
alignment: AlignmentType.JUSTIFIED, alignment: AlignmentType.JUSTIFIED,
}, },
}, },
},
paragraphStyles: [
{ {
id: "normalPara", id: "normalPara",
name: "Normal Para", name: "Normal Para",
@ -128,7 +158,7 @@ const doc = new Document({
}, },
paragraph: { paragraph: {
spacing: { line: 276 }, spacing: { line: 276 },
indent: { left: 720 }, indent: { left: convertInchesToTwip(0.5) },
}, },
}, },
{ {
@ -140,121 +170,142 @@ const doc = new Document({
}, },
}, },
{ {
id: "ListParagraph", id: "numberedPara",
name: "List Paragraph", name: "Numbered Para",
basedOn: "Normal", basedOn: "Normal",
next: "Normal",
quickFormat: true, quickFormat: true,
run: {
font: "Calibri",
size: 26,
bold: true,
},
paragraph: {
spacing: { line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 },
rightTabStop: TabStopPosition.MAX,
leftTabStop: 453.543307087,
numbering : {
reference: 'ref1',
instance: 0,
level: 0,
}
},
}, },
], ],
}, },
}); sections: [
{
const image = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif")); properties: {
page: {
const table = new Table({ margin: {
rows: [ top: 700,
new TableRow({ right: 700,
children: [ bottom: 700,
new TableCell({ left: 700,
children: [new Paragraph("Test cell 1.")], },
},
},
footers: {
default: new Footer({
children: [
new Paragraph({
text: "1",
style: "normalPara",
alignment: AlignmentType.RIGHT,
}),
],
}), }),
], },
}),
new TableRow({
children: [
new TableCell({
children: [new Paragraph("Test cell 2.")],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [new Paragraph("Test cell 3.")],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [new Paragraph("Test cell 4.")],
}),
],
}),
],
});
const image1 = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"));
const image2 = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"));
doc.addSection({
properties: {
top: 700,
right: 700,
bottom: 700,
left: 700,
},
footers: {
default: new Footer({
children: [ children: [
new Paragraph({ new Paragraph({
text: "1", children: [
new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
new Paragraph({
text: "HEADING",
heading: HeadingLevel.HEADING_1,
alignment: AlignmentType.CENTER,
}),
new Paragraph({
text: "Ref. :",
style: "normalPara", style: "normalPara",
alignment: AlignmentType.RIGHT, }),
new Paragraph({
text: "Date :",
style: "normalPara",
}),
new Paragraph({
text: "To,",
style: "normalPara",
}),
new Paragraph({
text: "The Superindenting Engineer,(O &M)",
style: "normalPara",
}),
new Paragraph({
text: "Sub : ",
style: "normalPara",
}),
new Paragraph({
text: "Ref. : ",
style: "normalPara",
}),
new Paragraph({
text: "Sir,",
style: "normalPara",
}),
new Paragraph({
text: "BRIEF DESCRIPTION",
style: "normalPara",
}),
table,
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
new Paragraph({
text: "Test",
style: "normalPara2",
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
new Paragraph({
text: "Test 2",
style: "normalPara2",
}),
new Paragraph({
text: "Numbered paragraph that has numbering attached to custom styles",
style: "numberedPara",
}),
new Paragraph({
text: "Numbered para would show up in the styles pane at Word",
style: "numberedPara",
}), }),
], ],
}), },
},
children: [
new Paragraph(image),
new Paragraph({
text: "HEADING",
heading: HeadingLevel.HEADING_1,
alignment: AlignmentType.CENTER,
}),
new Paragraph({
text: "Ref. :",
style: "normalPara",
}),
new Paragraph({
text: "Date :",
style: "normalPara",
}),
new Paragraph({
text: "To,",
style: "normalPara",
}),
new Paragraph({
text: "The Superindenting Engineer,(O &M)",
style: "normalPara",
}),
new Paragraph({
text: "Sub : ",
style: "normalPara",
}),
new Paragraph({
text: "Ref. : ",
style: "normalPara",
}),
new Paragraph({
text: "Sir,",
style: "normalPara",
}),
new Paragraph({
text: "BRIEF DESCRIPTION",
style: "normalPara",
}),
table,
new Paragraph(image1),
new Paragraph({
text: "Test",
style: "normalPara2",
}),
new Paragraph(image2),
new Paragraph({
text: "Test 2",
style: "normalPara2",
}),
], ],
}); });

View File

@ -1,17 +1,60 @@
// Scaling images // Scaling images
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Media, Packer, Paragraph } from "../build"; import { Document, ImageRun, Packer, Paragraph } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
const image = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"), 50, 50); {
const image2 = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"), 100, 100); children: [
const image3 = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"), 250, 250); new Paragraph("Hello World"),
const image4 = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"), 400, 400); new Paragraph({
children: [
doc.addSection({ new ImageRun({
children: [new Paragraph("Hello World"), new Paragraph(image), new Paragraph(image2), new Paragraph(image3), new Paragraph(image4)], data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 50,
height: 50,
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 250,
height: 250,
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 400,
height: 400,
},
}),
],
}),
],
},
],
}); });
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {

View File

@ -7,23 +7,24 @@ const styles = fs.readFileSync("./demo/assets/custom-styles.xml", "utf-8");
const doc = new Document({ const doc = new Document({
title: "Title", title: "Title",
externalStyles: styles, externalStyles: styles,
}); sections: [
{
doc.addSection({ children: [
children: [ new Paragraph({
new Paragraph({ text: "Cool Heading Text",
text: "Cool Heading Text", heading: HeadingLevel.HEADING_1,
heading: HeadingLevel.HEADING_1, }),
}), new Paragraph({
new Paragraph({ text: 'This is a custom named style from the template "MyFancyStyle"',
text: 'This is a custom named style from the template "MyFancyStyle"', style: "MyFancyStyle",
style: "MyFancyStyle", }),
}), new Paragraph("Some normal text"),
new Paragraph("Some normal text"), new Paragraph({
new Paragraph({ text: "MyFancyStyle again",
text: "MyFancyStyle again", style: "MyFancyStyle",
style: "MyFancyStyle", }),
}), ],
},
], ],
}); });

View File

@ -1,44 +1,77 @@
// Page numbers // Page numbers
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { AlignmentType, Document, Header, Packer, PageBreak, PageNumber, Paragraph, TextRun } from "../build"; import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, Paragraph, TextRun } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
doc.addSection({ {
headers: { properties: {
default: new Header({ titlePage: true,
children: [ },
new Paragraph({ headers: {
alignment: AlignmentType.RIGHT, default: new Header({
children: [ children: [
new TextRun("My Title "), new Paragraph({
new TextRun({ alignment: AlignmentType.RIGHT,
children: ["Page ", PageNumber.CURRENT], children: [
new TextRun("My Title "),
new TextRun({
children: ["Page ", PageNumber.CURRENT],
}),
],
}), }),
], ],
}), }),
], first: new Header({
}),
first: new Header({
children: [
new Paragraph({
alignment: AlignmentType.RIGHT,
children: [ children: [
new TextRun("First Page Header "), new Paragraph({
new TextRun({ alignment: AlignmentType.RIGHT,
children: ["Page ", PageNumber.CURRENT], children: [
new TextRun("First Page Header "),
new TextRun({
children: ["Page ", PageNumber.CURRENT],
}),
],
}), }),
], ],
}), }),
},
footers: {
default: new Footer({
children: [
new Paragraph({
alignment: AlignmentType.RIGHT,
children: [
new TextRun("My Title "),
new TextRun({
children: ["Footer - Page ", PageNumber.CURRENT],
}),
],
}),
],
}),
first: new Footer({
children: [
new Paragraph({
alignment: AlignmentType.RIGHT,
children: [
new TextRun("First Page Footer "),
new TextRun({
children: ["Page ", PageNumber.CURRENT],
}),
],
}),
],
}),
},
children: [
new Paragraph({
children: [new TextRun("First Page"), new PageBreak()],
}),
new Paragraph("Second Page"),
], ],
}), },
},
children: [
new Paragraph({
children: [new TextRun("First Page"), new PageBreak()],
}),
new Paragraph("Second Page"),
], ],
}); });

View File

@ -3,15 +3,17 @@
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph } from "../build"; import { Document, Packer, Paragraph } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
doc.addSection({ {
children: [ children: [
new Paragraph("Hello World"), new Paragraph("Hello World"),
new Paragraph({ new Paragraph({
text: "Hello World on another page", text: "Hello World on another page",
pageBreakBefore: true, pageBreakBefore: true,
}), }),
],
},
], ],
}); });

View File

@ -1,121 +1,144 @@
// Multiple sections and headers // Multiple sections and headers
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Footer, Header, Packer, PageNumber, PageNumberFormat, PageOrientation, Paragraph, TextRun } from "../build"; import { Document, Footer, Header, Packer, PageNumber, NumberFormat, PageOrientation, Paragraph, TextRun } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
{
children: [new Paragraph("Hello World")],
},
{
properties: {
page: {
pageNumbers: {
start: 1,
formatType: NumberFormat.DECIMAL,
},
},
},
headers: {
default: new Header({
children: [new Paragraph("First Default Header on another page")],
}),
},
footers: {
default: new Footer({
children: [new Paragraph("Footer on another page")],
}),
},
doc.addSection({ children: [new Paragraph("hello")],
children: [new Paragraph("Hello World")], },
}); {
properties: {
doc.addSection({ page: {
headers: { size: {
default: new Header({ orientation: PageOrientation.LANDSCAPE,
children: [new Paragraph("First Default Header on another page")], },
}), pageNumbers: {
}, start: 1,
footers: { formatType: NumberFormat.DECIMAL,
default: new Footer({ },
children: [new Paragraph("Footer on another page")], },
}), },
}, headers: {
properties: { default: new Header({
pageNumberStart: 1, children: [new Paragraph("Second Default Header on another page")],
pageNumberFormatType: PageNumberFormat.DECIMAL, }),
}, },
children: [new Paragraph("hello")], footers: {
}); default: new Footer({
children: [new Paragraph("Footer on another page")],
doc.addSection({ }),
headers: { },
default: new Header({ children: [new Paragraph("hello in landscape")],
children: [new Paragraph("Second Default Header on another page")], },
}), {
}, properties: {
footers: { page: {
default: new Footer({ size: {
children: [new Paragraph("Footer on another page")], orientation: PageOrientation.PORTRAIT,
}), },
}, },
size: { },
orientation: PageOrientation.LANDSCAPE, headers: {
}, default: new Header({
properties: {
pageNumberStart: 1,
pageNumberFormatType: PageNumberFormat.DECIMAL,
},
children: [new Paragraph("hello in landscape")],
});
doc.addSection({
headers: {
default: new Header({
children: [
new Paragraph({
children: [ children: [
new TextRun({ new Paragraph({
children: ["Page number: ", PageNumber.CURRENT], children: [
new TextRun({
children: ["Page number: ", PageNumber.CURRENT],
}),
],
}), }),
], ],
}), }),
], },
}),
},
size: {
orientation: PageOrientation.PORTRAIT,
},
children: [new Paragraph("Page number in the header must be 2, because it continues from the previous section.")],
});
doc.addSection({ children: [new Paragraph("Page number in the header must be 2, because it continues from the previous section.")],
headers: { },
default: new Header({ {
children: [ properties: {
new Paragraph({ page: {
size: {
orientation: PageOrientation.PORTRAIT,
},
pageNumbers: {
formatType: NumberFormat.UPPER_ROMAN,
},
},
},
headers: {
default: new Header({
children: [ children: [
new TextRun({ new Paragraph({
children: ["Page number: ", PageNumber.CURRENT], children: [
new TextRun({
children: ["Page number: ", PageNumber.CURRENT],
}),
],
}), }),
], ],
}), }),
], },
}),
},
properties: {
pageNumberFormatType: PageNumberFormat.UPPER_ROMAN,
orientation: PageOrientation.PORTRAIT,
},
children: [
new Paragraph(
"Page number in the header must be III, because it continues from the previous section, but is defined as upper roman.",
),
],
});
doc.addSection({
headers: {
default: new Header({
children: [ children: [
new Paragraph({ new Paragraph(
"Page number in the header must be III, because it continues from the previous section, but is defined as upper roman.",
),
],
},
{
properties: {
page: {
size: {
orientation: PageOrientation.PORTRAIT,
},
pageNumbers: {
start: 25,
formatType: NumberFormat.DECIMAL,
},
},
},
headers: {
default: new Header({
children: [ children: [
new TextRun({ new Paragraph({
children: ["Page number: ", PageNumber.CURRENT], children: [
new TextRun({
children: ["Page number: ", PageNumber.CURRENT],
}),
],
}), }),
], ],
}), }),
},
children: [
new Paragraph(
"Page number in the header must be 25, because it is defined to start at 25 and to be decimal in this section.",
),
], ],
}), },
},
size: {
orientation: PageOrientation.PORTRAIT,
},
properties: {
pageNumberFormatType: PageNumberFormat.DECIMAL,
pageNumberStart: 25,
},
children: [
new Paragraph("Page number in the header must be 25, because it is defined to start at 25 and to be decimal in this section."),
], ],
}); });

View File

@ -4,49 +4,49 @@ import * as fs from "fs";
import { Document, FootnoteReferenceRun, Packer, Paragraph, TextRun } from "../build"; import { Document, FootnoteReferenceRun, Packer, Paragraph, TextRun } from "../build";
const doc = new Document({ const doc = new Document({
footnotes: [ footnotes: {
new Paragraph("Foo"), 1: { children: [new Paragraph("Foo"), new Paragraph("Bar")] },
new Paragraph("Test"), 2: { children: [new Paragraph("Test")] },
new Paragraph("My amazing reference"), 3: { children: [new Paragraph("My amazing reference")] },
new Paragraph("Foo1"), 4: { children: [new Paragraph("Foo1")] },
new Paragraph("Test1"), 5: { children: [new Paragraph("Test1")] },
new Paragraph("My amazing reference1"), 6: { children: [new Paragraph("My amazing reference1")] },
], },
}); sections: [
{
doc.addSection({
children: [
new Paragraph({
children: [ children: [
new TextRun({ new Paragraph({
children: ["Hello", new FootnoteReferenceRun(1)], children: [
new TextRun({
children: ["Hello", new FootnoteReferenceRun(1)],
}),
new TextRun({
children: [" World!", new FootnoteReferenceRun(2)],
}),
],
}), }),
new TextRun({ new Paragraph({
children: [" World!", new FootnoteReferenceRun(2)], children: [new TextRun("Hello World"), new FootnoteReferenceRun(3)],
}), }),
], ],
}), },
new Paragraph({ {
children: [new TextRun("Hello World"), new FootnoteReferenceRun(3)],
}),
],
});
doc.addSection({
children: [
new Paragraph({
children: [ children: [
new TextRun({ new Paragraph({
children: ["Hello", new FootnoteReferenceRun(4)], children: [
new TextRun({
children: ["Hello", new FootnoteReferenceRun(4)],
}),
new TextRun({
children: [" World!", new FootnoteReferenceRun(5)],
}),
],
}), }),
new TextRun({ new Paragraph({
children: [" World!", new FootnoteReferenceRun(5)], children: [new TextRun("Hello World"), new FootnoteReferenceRun(6)],
}), }),
], ],
}), },
new Paragraph({
children: [new TextRun("Hello World"), new FootnoteReferenceRun(6)],
}),
], ],
}); });

View File

@ -1,19 +1,27 @@
// Insert image from a buffer // Insert image from a buffer
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Media, Packer, Paragraph } from "../build"; import { Document, ImageRun, Packer, Paragraph } from "../build";
const doc = new Document();
const imageBase64Data = `iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAACzVBMVEUAAAAAAAAAAAAAAAA/AD8zMzMqKiokJCQfHx8cHBwZGRkuFxcqFSonJyckJCQiIiIfHx8eHh4cHBwoGhomGSYkJCQhISEfHx8eHh4nHR0lHBwkGyQjIyMiIiIgICAfHx8mHh4lHh4kHR0jHCMiGyIhISEgICAfHx8lHx8kHh4jHR0hHCEhISEgICAlHx8kHx8jHh4jHh4iHSIhHCEhISElICAkHx8jHx8jHh4iHh4iHSIhHSElICAkICAjHx8jHx8iHh4iHh4hHiEhHSEkICAjHx8iHx8iHx8hHh4hHiEkHSEjHSAjHx8iHx8iHx8hHh4kHiEkHiEjHSAiHx8hHx8hHh4kHiEjHiAjHSAiHx8iHx8hHx8kHh4jHiEjHiAjHiAiICAiHx8kHx8jHh4jHiEjHiAiHiAiHSAiHx8jHx8jHx8jHiAiHiAiHiAiHSAiHx8jHx8jHx8iHiAiHiAiHiAjHx8jHx8jHx8jHx8iHiAiHiAiHiAjHx8jHx8jHx8iHx8iHSAiHiAjHiAjHx8jHx8hHx8iHx8iHyAiHiAjHiAjHiAjHh4hHx8iHx8iHx8iHyAjHSAjHiAjHiAjHh4hHx8iHx8iHx8jHyAjHiAhHh4iHx8iHx8jHyAjHSAjHSAhHiAhHh4iHx8iHx8jHx8jHyAjHSAjHSAiHh4iHh4jHx8jHx8jHyAjHyAhHSAhHSAiHh4iHh4jHx8jHx8jHyAhHyAhHSAiHSAiHh4jHh4jHx8jHx8jHyAhHyAhHSAiHSAjHR4jHh4jHx8jHx8hHyAhHyAiHSAjHSAjHR4jHh4jHx8hHx8hHyAhHyAiHyAjHSAjHR4jHR4hHh4hHx8hHyAiHyAjHyAjHSAjHR4jHR4hHh4hHx8hHyAjHyAjHyAjHSAjHR4hHR4hHR4hHx8iHyAjHyAjHyAjHSAhHR4hHR4hHR4hHx8jHyAjHyAjHyAjHyC9S2xeAAAA7nRSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFxgZGhscHR4fICEiIyQlJicoKSorLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZISUpLTE1OUFFSU1RVVllaW1xdXmBhYmNkZWZnaGprbG1ub3Byc3R1dnd4eXp8fn+AgYKDhIWGiImKi4yNj5CRkpOUlZaXmJmam5ydnp+goaKjpKaoqqusra6vsLGys7S1tri5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+fkZpVQAABcBJREFUGBntwftjlQMcBvDnnLNL22qzJjWlKLHFVogyty3SiFq6EZliqZGyhnSxsLlMRahYoZKRFcul5dKFCatYqWZaNKvWtrPz/A2+7/b27qRzec/lPfvl/XxgMplMJpPJZDKZAtA9HJ3ppnIez0KnSdtC0RCNznHdJrbrh85wdSlVVRaEXuoGamYi5K5430HNiTiEWHKJg05eRWgNfKeV7RxbqUhGKPV/207VupQ8is0IoX5vtFC18SqEHaK4GyHTZ2kzVR8PBTCO4oANIZL4ShNVZcOhKKeYg9DoWdhI1ec3os2VFI0JCIUez5+i6st0qJZRrEAIJCw+QdW223BG/EmKwTBc/IJ/qfp2FDrkUnwFo8U9dZyqnaPhxLqfYjyM1S3vb6p+GGOBszsojoTDSDFz6qj66R4LzvYJxVMwUNRjf1H1ywQr/megg2RzLximy8waqvbda8M5iijegVEiHjlM1W/3h+FcXesphsMY4dMOUnUgOxyuPEzxPQwRNvV3qg5Nj4BreyimwADWe/dRVTMjEm6MoGLzGwtystL6RyOY3qSqdlYU3FpLZw1VW0sK5943MvUCKwJ1noNtjs6Ohge76Zq9ZkfpigU5WWkDYuCfbs1U5HWFR8/Qq4a9W0uK5k4ZmdrTCl8spGIePLPlbqqsc1Afe83O0hULc8alDYiBd7ZyitYMeBfR55rR2fOKP6ioPk2dGvZ+UVI0d8rtqT2tcCexlqK2F3wRn5Q+YVbBqrLKOupkr9lZujAOrmS0UpTb4JeIPkNHZ+cXr6uoPk2vyuBSPhWLEKj45PQJuQWryyqP0Z14uGLdROHIRNBEXDR09EP5r62rOHCazhrD4VKPwxTH+sIA3ZPTJ+YuWV22n+IruHFDC8X2CBjnPoolcGc2FYUwzmsUWXDHsoGKLBhmN0VvuBVfTVE/AAbpaid5CB4MbaLY1QXGuIViLTyZQcVyGGMuxWPwaA0Vk2GI9RRp8Ci2iuLkIBjhT5LNUfAspZFiTwyC72KK7+DNg1SsRvCNp3gZXq2k4iEEXSHFJHgVXUlxejCCbTvFAHiXdIJiXxyCK7KJ5FHoMZGK9xBcwyg2QpdlVMxEUM2iyIMuXXZQNF+HswxMsSAAJRQjoE//eoqDCXBSTO6f1xd+O0iyNRY6jaWi1ALNYCocZROj4JdEikroVkjFk9DcStXxpdfCD2MoXodu4RUU9ptxxmXssOfxnvDVcxRTod9FxyhqLoAqis5aPhwTDp9spRgEH2Q6KLbYoKqlaKTm6Isp0C/sJMnjFvhiERXPQvUNRe9p29lhR04CdBpC8Sl8YiuncIxEuzUUg4Dkgj+paVozygY9plPMh28SaymO9kabAopREGF3vt9MzeFFl8G7lRSZ8FFGK8XX4VA8QjEd7XrM3M0OXz8YCy+qKBLgq3wqnofiTorF0Ax56Rg1J1elW+BBAsVe+My6iYq7IK6keBdOIseV2qn5Pb8f3MqkWAXf9ThM8c8lAOIotuFsF875lRrH5klRcG0+xcPwQ1oLxfeRAP4heQTnGL78X2rqlw2DK59SXAV/zKaiGMAuko5InCt68mcOan5+ohf+z1pP8lQY/GHZQMV4YD3FpXDp4qerqbF/lBWBswyi+AL+ia+maLgcRRQj4IYlY/UpauqKBsPJAxQF8NM1TRQ/RudSPAD34rK3scOuR8/HGcspxsJfOVS8NZbiGXiUtPgINU3v3WFDmx8pEuG3EiqKKVbCC1vm2iZqap5LAtCtleQf8F9sFYWDohzeJczYyQ4V2bEZFGsQgJRGqqqhS2phHTWn9lDkIhBTqWqxQZ+IsRvtdHY9AvI2VX2hW68nfqGmuQsCEl3JdjfCF8OW1bPdtwhQ0gm2mQzfRE3a7KCYj0BNZJs8+Kxf/r6WtTEI2FIqlsMfFgRB5A6KUnSe/vUkX0AnuvUIt8SjM1m6wWQymUwmk8lkMgXRf5vi8rLQxtUhAAAAAElFTkSuQmCC`; const imageBase64Data = `iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAACzVBMVEUAAAAAAAAAAAAAAAA/AD8zMzMqKiokJCQfHx8cHBwZGRkuFxcqFSonJyckJCQiIiIfHx8eHh4cHBwoGhomGSYkJCQhISEfHx8eHh4nHR0lHBwkGyQjIyMiIiIgICAfHx8mHh4lHh4kHR0jHCMiGyIhISEgICAfHx8lHx8kHh4jHR0hHCEhISEgICAlHx8kHx8jHh4jHh4iHSIhHCEhISElICAkHx8jHx8jHh4iHh4iHSIhHSElICAkICAjHx8jHx8iHh4iHh4hHiEhHSEkICAjHx8iHx8iHx8hHh4hHiEkHSEjHSAjHx8iHx8iHx8hHh4kHiEkHiEjHSAiHx8hHx8hHh4kHiEjHiAjHSAiHx8iHx8hHx8kHh4jHiEjHiAjHiAiICAiHx8kHx8jHh4jHiEjHiAiHiAiHSAiHx8jHx8jHx8jHiAiHiAiHiAiHSAiHx8jHx8jHx8iHiAiHiAiHiAjHx8jHx8jHx8jHx8iHiAiHiAiHiAjHx8jHx8jHx8iHx8iHSAiHiAjHiAjHx8jHx8hHx8iHx8iHyAiHiAjHiAjHiAjHh4hHx8iHx8iHx8iHyAjHSAjHiAjHiAjHh4hHx8iHx8iHx8jHyAjHiAhHh4iHx8iHx8jHyAjHSAjHSAhHiAhHh4iHx8iHx8jHx8jHyAjHSAjHSAiHh4iHh4jHx8jHx8jHyAjHyAhHSAhHSAiHh4iHh4jHx8jHx8jHyAhHyAhHSAiHSAiHh4jHh4jHx8jHx8jHyAhHyAhHSAiHSAjHR4jHh4jHx8jHx8hHyAhHyAiHSAjHSAjHR4jHh4jHx8hHx8hHyAhHyAiHyAjHSAjHR4jHR4hHh4hHx8hHyAiHyAjHyAjHSAjHR4jHR4hHh4hHx8hHyAjHyAjHyAjHSAjHR4hHR4hHR4hHx8iHyAjHyAjHyAjHSAhHR4hHR4hHR4hHx8jHyAjHyAjHyAjHyC9S2xeAAAA7nRSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFxgZGhscHR4fICEiIyQlJicoKSorLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZISUpLTE1OUFFSU1RVVllaW1xdXmBhYmNkZWZnaGprbG1ub3Byc3R1dnd4eXp8fn+AgYKDhIWGiImKi4yNj5CRkpOUlZaXmJmam5ydnp+goaKjpKaoqqusra6vsLGys7S1tri5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+fkZpVQAABcBJREFUGBntwftjlQMcBvDnnLNL22qzJjWlKLHFVogyty3SiFq6EZliqZGyhnSxsLlMRahYoZKRFcul5dKFCatYqWZaNKvWtrPz/A2+7/b27qRzec/lPfvl/XxgMplMJpPJZDKZAtA9HJ3ppnIez0KnSdtC0RCNznHdJrbrh85wdSlVVRaEXuoGamYi5K5430HNiTiEWHKJg05eRWgNfKeV7RxbqUhGKPV/207VupQ8is0IoX5vtFC18SqEHaK4GyHTZ2kzVR8PBTCO4oANIZL4ShNVZcOhKKeYg9DoWdhI1ec3os2VFI0JCIUez5+i6st0qJZRrEAIJCw+QdW223BG/EmKwTBc/IJ/qfp2FDrkUnwFo8U9dZyqnaPhxLqfYjyM1S3vb6p+GGOBszsojoTDSDFz6qj66R4LzvYJxVMwUNRjf1H1ywQr/megg2RzLximy8waqvbda8M5iijegVEiHjlM1W/3h+FcXesphsMY4dMOUnUgOxyuPEzxPQwRNvV3qg5Nj4BreyimwADWe/dRVTMjEm6MoGLzGwtystL6RyOY3qSqdlYU3FpLZw1VW0sK5943MvUCKwJ1noNtjs6Ohge76Zq9ZkfpigU5WWkDYuCfbs1U5HWFR8/Qq4a9W0uK5k4ZmdrTCl8spGIePLPlbqqsc1Afe83O0hULc8alDYiBd7ZyitYMeBfR55rR2fOKP6ioPk2dGvZ+UVI0d8rtqT2tcCexlqK2F3wRn5Q+YVbBqrLKOupkr9lZujAOrmS0UpTb4JeIPkNHZ+cXr6uoPk2vyuBSPhWLEKj45PQJuQWryyqP0Z14uGLdROHIRNBEXDR09EP5r62rOHCazhrD4VKPwxTH+sIA3ZPTJ+YuWV22n+IruHFDC8X2CBjnPoolcGc2FYUwzmsUWXDHsoGKLBhmN0VvuBVfTVE/AAbpaid5CB4MbaLY1QXGuIViLTyZQcVyGGMuxWPwaA0Vk2GI9RRp8Ci2iuLkIBjhT5LNUfAspZFiTwyC72KK7+DNg1SsRvCNp3gZXq2k4iEEXSHFJHgVXUlxejCCbTvFAHiXdIJiXxyCK7KJ5FHoMZGK9xBcwyg2QpdlVMxEUM2iyIMuXXZQNF+HswxMsSAAJRQjoE//eoqDCXBSTO6f1xd+O0iyNRY6jaWi1ALNYCocZROj4JdEikroVkjFk9DcStXxpdfCD2MoXodu4RUU9ptxxmXssOfxnvDVcxRTod9FxyhqLoAqis5aPhwTDp9spRgEH2Q6KLbYoKqlaKTm6Isp0C/sJMnjFvhiERXPQvUNRe9p29lhR04CdBpC8Sl8YiuncIxEuzUUg4Dkgj+paVozygY9plPMh28SaymO9kabAopREGF3vt9MzeFFl8G7lRSZ8FFGK8XX4VA8QjEd7XrM3M0OXz8YCy+qKBLgq3wqnofiTorF0Ax56Rg1J1elW+BBAsVe+My6iYq7IK6keBdOIseV2qn5Pb8f3MqkWAXf9ThM8c8lAOIotuFsF875lRrH5klRcG0+xcPwQ1oLxfeRAP4heQTnGL78X2rqlw2DK59SXAV/zKaiGMAuko5InCt68mcOan5+ohf+z1pP8lQY/GHZQMV4YD3FpXDp4qerqbF/lBWBswyi+AL+ia+maLgcRRQj4IYlY/UpauqKBsPJAxQF8NM1TRQ/RudSPAD34rK3scOuR8/HGcspxsJfOVS8NZbiGXiUtPgINU3v3WFDmx8pEuG3EiqKKVbCC1vm2iZqap5LAtCtleQf8F9sFYWDohzeJczYyQ4V2bEZFGsQgJRGqqqhS2phHTWn9lDkIhBTqWqxQZ+IsRvtdHY9AvI2VX2hW68nfqGmuQsCEl3JdjfCF8OW1bPdtwhQ0gm2mQzfRE3a7KCYj0BNZJs8+Kxf/r6WtTEI2FIqlsMfFgRB5A6KUnSe/vUkX0AnuvUIt8SjM1m6wWQymUwmk8lkMgXRf5vi8rLQxtUhAAAAAElFTkSuQmCC`;
const image = Media.addImage(doc, Buffer.from(imageBase64Data, "base64"), 100, 100); const doc = new Document({
sections: [
doc.addSection({ {
children: [ children: [
new Paragraph({ new Paragraph({
children: [image], children: [
}), new ImageRun({
data: Buffer.from(imageBase64Data, "base64"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
],
},
], ],
}); });

View File

@ -3,23 +3,25 @@
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun } from "../build"; import { Document, Packer, Paragraph, TextRun } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
doc.addSection({ {
children: [
new Paragraph({
children: [ children: [
new TextRun("Hello World"), new Paragraph({
new TextRun({ children: [
text: "Foo", new TextRun("Hello World"),
bold: true, new TextRun({
}), text: "Foo",
new TextRun({ bold: true,
text: "\tBar", }),
bold: true, new TextRun({
text: "\tBar",
bold: true,
}),
],
}), }),
], ],
}), },
], ],
}); });

View File

@ -1,25 +1,30 @@
// Example on how to customise the look at feel using Styles // Example on how to customise the look at feel using Styles
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { AlignmentType, Document, HeadingLevel, Packer, Paragraph, TextRun, UnderlineType } from "../build"; import {
AlignmentType,
convertInchesToTwip,
Document,
HeadingLevel,
LevelFormat,
Packer,
Paragraph,
TextRun,
UnderlineType,
} from "../build";
const doc = new Document({ const doc = new Document({
creator: "Clippy", creator: "Clippy",
title: "Sample Document", title: "Sample Document",
description: "A brief example of using docx", description: "A brief example of using docx",
styles: { styles: {
paragraphStyles: [ default: {
{ heading1: {
id: "Heading1",
name: "Heading 1",
basedOn: "Normal",
next: "Normal",
quickFormat: true,
run: { run: {
size: 28, size: 28,
bold: true, bold: true,
italics: true, italics: true,
color: "red", color: "FF0000",
}, },
paragraph: { paragraph: {
spacing: { spacing: {
@ -27,12 +32,7 @@ const doc = new Document({
}, },
}, },
}, },
{ heading2: {
id: "Heading2",
name: "Heading 2",
basedOn: "Normal",
next: "Normal",
quickFormat: true,
run: { run: {
size: 26, size: 26,
bold: true, bold: true,
@ -48,6 +48,13 @@ const doc = new Document({
}, },
}, },
}, },
listParagraph: {
run: {
color: "#FF0000",
},
},
},
paragraphStyles: [
{ {
id: "aside", id: "aside",
name: "Aside", name: "Aside",
@ -59,7 +66,7 @@ const doc = new Document({
}, },
paragraph: { paragraph: {
indent: { indent: {
left: 720, left: convertInchesToTwip(0.5),
}, },
spacing: { spacing: {
line: 276, line: 276,
@ -75,12 +82,6 @@ const doc = new Document({
spacing: { line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 }, spacing: { line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 },
}, },
}, },
{
id: "ListParagraph",
name: "List Paragraph",
basedOn: "Normal",
quickFormat: true,
},
], ],
}, },
numbering: { numbering: {
@ -90,7 +91,7 @@ const doc = new Document({
levels: [ levels: [
{ {
level: 0, level: 0,
format: "lowerLetter", format: LevelFormat.LOWER_LETTER,
text: "%1)", text: "%1)",
alignment: AlignmentType.LEFT, alignment: AlignmentType.LEFT,
}, },
@ -98,78 +99,91 @@ const doc = new Document({
}, },
], ],
}, },
}); sections: [
{
doc.addSection({
children: [
new Paragraph({
text: "Test heading1, bold and italicized",
heading: HeadingLevel.HEADING_1,
}),
new Paragraph("Some simple content"),
new Paragraph({
text: "Test heading2 with double red underline",
heading: HeadingLevel.HEADING_2,
}),
new Paragraph({
text: "Option1",
numbering: {
reference: "my-crazy-numbering",
level: 0,
},
}),
new Paragraph({
text: "Option5 -- override 2 to 5",
numbering: {
reference: "my-crazy-numbering",
level: 0,
},
}),
new Paragraph({
text: "Option3",
numbering: {
reference: "my-crazy-numbering",
level: 0,
},
}),
new Paragraph({
children: [ children: [
new TextRun({ new Paragraph({
text: "Some monospaced content", text: "Test heading1, bold and italicized",
font: { heading: HeadingLevel.HEADING_1,
name: "Monospace", }),
new Paragraph("Some simple content"),
new Paragraph({
text: "Test heading2 with double red underline",
heading: HeadingLevel.HEADING_2,
}),
new Paragraph({
text: "Option1",
numbering: {
reference: "my-crazy-numbering",
level: 0,
},
style: "aside",
}),
new Paragraph({
text: "Option5 -- override 2 to 5",
numbering: {
reference: "my-crazy-numbering",
level: 0,
}, },
}), }),
], new Paragraph({
}), text: "Option3",
new Paragraph({ numbering: {
text: "An aside, in light gray italics and indented", reference: "my-crazy-numbering",
style: "aside", level: 0,
}), },
new Paragraph({
text: "This is normal, but well-spaced text",
style: "wellSpaced",
}),
new Paragraph({
children: [
new TextRun({
text: "This is a bold run,",
bold: true,
}), }),
new TextRun(" switching to normal "), new Paragraph({
new TextRun({ children: [
text: "and then underlined ", new TextRun({
underline: {}, text: "Some monospaced content",
font: {
name: "Monospace",
},
}),
],
}), }),
new TextRun({ new Paragraph({
text: "and then emphasis-mark ", text: "An aside, in light gray italics and indented",
emphasisMark: {}, style: "aside",
}), }),
new TextRun({ new Paragraph({
text: "and back to normal.", text: "This is normal, but well-spaced text",
style: "wellSpaced",
}),
new Paragraph({
children: [
new TextRun({
text: "This is a bold run,",
bold: true,
}),
new TextRun(" switching to normal "),
new TextRun({
text: "and then underlined ",
underline: {},
}),
new TextRun({
text: "and then emphasis-mark ",
emphasisMark: {},
}),
new TextRun({
text: "and back to normal.",
}),
],
}),
new Paragraph({
style: "Strong",
children: [
new TextRun({
text: "Strong Style",
}),
new TextRun({
text: " - Very strong.",
}),
],
}), }),
], ],
}), },
], ],
}); });

View File

@ -3,101 +3,105 @@
import * as fs from "fs"; import * as fs from "fs";
import { BorderStyle, Document, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; import { BorderStyle, Document, Packer, Paragraph, Table, TableCell, TableRow } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
const table = new Table({ {
rows: [
new TableRow({
children: [ children: [
new TableCell({ new Table({
children: [], rows: [
}), new TableRow({
new TableCell({ children: [
children: [], new TableCell({
}), children: [],
new TableCell({ }),
children: [], new TableCell({
}), children: [],
new TableCell({ }),
children: [], new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [],
}),
new TableCell({
children: [new Paragraph("Hello")],
borders: {
top: {
style: BorderStyle.DASH_DOT_STROKED,
size: 3,
color: "FF0000",
},
bottom: {
style: BorderStyle.DOUBLE,
size: 3,
color: "0000FF",
},
left: {
style: BorderStyle.DASH_DOT_STROKED,
size: 3,
color: "00FF00",
},
right: {
style: BorderStyle.DASH_DOT_STROKED,
size: 3,
color: "#ff8000",
},
},
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
],
}),
],
}), }),
], ],
}), },
new TableRow({
children: [
new TableCell({
children: [],
}),
new TableCell({
children: [new Paragraph("Hello")],
borders: {
top: {
style: BorderStyle.DASH_DOT_STROKED,
size: 3,
color: "red",
},
bottom: {
style: BorderStyle.DOUBLE,
size: 3,
color: "blue",
},
left: {
style: BorderStyle.DASH_DOT_STROKED,
size: 3,
color: "green",
},
right: {
style: BorderStyle.DASH_DOT_STROKED,
size: 3,
color: "#ff8000",
},
},
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
],
}),
], ],
}); });
doc.addSection({ children: [table] });
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer); fs.writeFileSync("My Document.docx", buffer);
}); });

View File

@ -1,7 +1,7 @@
// This demo shows how to create bookmarks then link to them with internal hyperlinks // This demo shows how to create bookmarks then link to them with internal hyperlinks
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Bookmark, Document, HeadingLevel, HyperlinkRef, HyperlinkType, Packer, PageBreak, Paragraph } from "../build"; import { Bookmark, Document, Footer, HeadingLevel, InternalHyperlink, Packer, PageBreak, Paragraph, TextRun, PageReference } from "../build";
const LOREM_IPSUM = const LOREM_IPSUM =
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam mi velit, convallis convallis scelerisque nec, faucibus nec leo. Phasellus at posuere mauris, tempus dignissim velit. Integer et tortor dolor. Duis auctor efficitur mattis. Vivamus ut metus accumsan tellus auctor sollicitudin venenatis et nibh. Cras quis massa ac metus fringilla venenatis. Proin rutrum mauris purus, ut suscipit magna consectetur id. Integer consectetur sollicitudin ante, vitae faucibus neque efficitur in. Praesent ultricies nibh lectus. Mauris pharetra id odio eget iaculis. Duis dictum, risus id pellentesque rutrum, lorem quam malesuada massa, quis ullamcorper turpis urna a diam. Cras vulputate metus vel massa porta ullamcorper. Etiam porta condimentum nulla nec tristique. Sed nulla urna, pharetra non tortor sed, sollicitudin molestie diam. Maecenas enim leo, feugiat eget vehicula id, sollicitudin vitae ante."; "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam mi velit, convallis convallis scelerisque nec, faucibus nec leo. Phasellus at posuere mauris, tempus dignissim velit. Integer et tortor dolor. Duis auctor efficitur mattis. Vivamus ut metus accumsan tellus auctor sollicitudin venenatis et nibh. Cras quis massa ac metus fringilla venenatis. Proin rutrum mauris purus, ut suscipit magna consectetur id. Integer consectetur sollicitudin ante, vitae faucibus neque efficitur in. Praesent ultricies nibh lectus. Mauris pharetra id odio eget iaculis. Duis dictum, risus id pellentesque rutrum, lorem quam malesuada massa, quis ullamcorper turpis urna a diam. Cras vulputate metus vel massa porta ullamcorper. Etiam porta condimentum nulla nec tristique. Sed nulla urna, pharetra non tortor sed, sollicitudin molestie diam. Maecenas enim leo, feugiat eget vehicula id, sollicitudin vitae ante.";
@ -10,28 +10,65 @@ const doc = new Document({
creator: "Clippy", creator: "Clippy",
title: "Sample Document", title: "Sample Document",
description: "A brief example of using docx with bookmarks and internal hyperlinks", description: "A brief example of using docx with bookmarks and internal hyperlinks",
hyperlinks: { sections: [
myAnchorId: { {
text: "Hyperlink", footers: {
type: HyperlinkType.INTERNAL, default: new Footer({
children: [
new Paragraph({
children: [
new InternalHyperlink({
children: [
new TextRun({
text: "Click here!",
style: "Hyperlink",
}),
],
anchor: "myAnchorId",
}),
],
}),
],
}),
},
children: [
new Paragraph({
heading: HeadingLevel.HEADING_1,
children: [
new Bookmark({
id: "myAnchorId",
children: [new TextRun("Lorem Ipsum")],
}),
],
}),
new Paragraph("\n"),
new Paragraph(LOREM_IPSUM),
new Paragraph({
children: [new PageBreak()],
}),
new Paragraph({
children: [
new InternalHyperlink({
children: [
new TextRun({
text: "Styled",
bold: true,
style: "Hyperlink",
}),
new TextRun({
text: " Anchor Text",
style: "Hyperlink",
}),
],
anchor: "myAnchorId",
}),
],
}),
new Paragraph({
children: [new TextRun("The bookmark can be seen on page "), new PageReference("myAnchorId")],
}),
],
}, },
},
});
doc.addSection({
children: [
new Paragraph({
heading: HeadingLevel.HEADING_1,
children: [new Bookmark("myAnchorId", "Lorem Ipsum")],
}),
new Paragraph("\n"),
new Paragraph(LOREM_IPSUM),
new Paragraph({
children: [new PageBreak()],
}),
new Paragraph({
children: [new HyperlinkRef("myAnchorId")],
}),
], ],
}); });

View File

@ -1,41 +1,68 @@
// This demo shows right to left for special languages // This demo shows right to left for special languages
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun } from "../build"; import { Document, Packer, Paragraph, Table, TableCell, TableRow, TextRun } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
doc.addSection({ {
children: [
new Paragraph({
bidirectional: true,
children: [ children: [
new TextRun({ new Paragraph({
text: "שלום עולם", bidirectional: true,
rightToLeft: true, children: [
new TextRun({
text: "שלום עולם",
rightToLeft: true,
}),
],
}),
new Paragraph({
bidirectional: true,
children: [
new TextRun({
text: "שלום עולם",
bold: true,
rightToLeft: true,
}),
],
}),
new Paragraph({
bidirectional: true,
children: [
new TextRun({
text: "שלום עולם",
italics: true,
rightToLeft: true,
}),
],
}),
new Table({
visuallyRightToLeft: true,
rows: [
new TableRow({
children: [
new TableCell({
children: [new Paragraph("שלום עולם")],
}),
new TableCell({
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [],
}),
new TableCell({
children: [new Paragraph("שלום עולם")],
}),
],
}),
],
}), }),
], ],
}), },
new Paragraph({
bidirectional: true,
children: [
new TextRun({
text: "שלום עולם",
bold: true,
rightToLeft: true,
}),
],
}),
new Paragraph({
bidirectional: true,
children: [
new TextRun({
text: "שלום עולם",
italics: true,
rightToLeft: true,
}),
],
}),
], ],
}); });

View File

@ -1,29 +1,83 @@
// This demo adds an image to the Media cache, and then insert to the document afterwards // This demo adds an image to the Media cache, and then insert to the document afterwards
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Media, Packer, Paragraph, TextRun } from "../build"; import { Document, ImageRun, Packer, Paragraph, TextRun } from "../build";
const doc = new Document();
const image = Media.addImage(doc, fs.readFileSync("./demo/images/image1.jpeg"));
const image2 = Media.addImage(doc, fs.readFileSync("./demo/images/dog.png"));
const image3 = Media.addImage(doc, fs.readFileSync("./demo/images/cat.jpg"));
const image4 = Media.addImage(doc, fs.readFileSync("./demo/images/parrots.bmp"));
const image5 = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"));
const imageBase64Data = `iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAACzVBMVEUAAAAAAAAAAAAAAAA/AD8zMzMqKiokJCQfHx8cHBwZGRkuFxcqFSonJyckJCQiIiIfHx8eHh4cHBwoGhomGSYkJCQhISEfHx8eHh4nHR0lHBwkGyQjIyMiIiIgICAfHx8mHh4lHh4kHR0jHCMiGyIhISEgICAfHx8lHx8kHh4jHR0hHCEhISEgICAlHx8kHx8jHh4jHh4iHSIhHCEhISElICAkHx8jHx8jHh4iHh4iHSIhHSElICAkICAjHx8jHx8iHh4iHh4hHiEhHSEkICAjHx8iHx8iHx8hHh4hHiEkHSEjHSAjHx8iHx8iHx8hHh4kHiEkHiEjHSAiHx8hHx8hHh4kHiEjHiAjHSAiHx8iHx8hHx8kHh4jHiEjHiAjHiAiICAiHx8kHx8jHh4jHiEjHiAiHiAiHSAiHx8jHx8jHx8jHiAiHiAiHiAiHSAiHx8jHx8jHx8iHiAiHiAiHiAjHx8jHx8jHx8jHx8iHiAiHiAiHiAjHx8jHx8jHx8iHx8iHSAiHiAjHiAjHx8jHx8hHx8iHx8iHyAiHiAjHiAjHiAjHh4hHx8iHx8iHx8iHyAjHSAjHiAjHiAjHh4hHx8iHx8iHx8jHyAjHiAhHh4iHx8iHx8jHyAjHSAjHSAhHiAhHh4iHx8iHx8jHx8jHyAjHSAjHSAiHh4iHh4jHx8jHx8jHyAjHyAhHSAhHSAiHh4iHh4jHx8jHx8jHyAhHyAhHSAiHSAiHh4jHh4jHx8jHx8jHyAhHyAhHSAiHSAjHR4jHh4jHx8jHx8hHyAhHyAiHSAjHSAjHR4jHh4jHx8hHx8hHyAhHyAiHyAjHSAjHR4jHR4hHh4hHx8hHyAiHyAjHyAjHSAjHR4jHR4hHh4hHx8hHyAjHyAjHyAjHSAjHR4hHR4hHR4hHx8iHyAjHyAjHyAjHSAhHR4hHR4hHR4hHx8jHyAjHyAjHyAjHyC9S2xeAAAA7nRSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFxgZGhscHR4fICEiIyQlJicoKSorLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZISUpLTE1OUFFSU1RVVllaW1xdXmBhYmNkZWZnaGprbG1ub3Byc3R1dnd4eXp8fn+AgYKDhIWGiImKi4yNj5CRkpOUlZaXmJmam5ydnp+goaKjpKaoqqusra6vsLGys7S1tri5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+fkZpVQAABcBJREFUGBntwftjlQMcBvDnnLNL22qzJjWlKLHFVogyty3SiFq6EZliqZGyhnSxsLlMRahYoZKRFcul5dKFCatYqWZaNKvWtrPz/A2+7/b27qRzec/lPfvl/XxgMplMJpPJZDKZAtA9HJ3ppnIez0KnSdtC0RCNznHdJrbrh85wdSlVVRaEXuoGamYi5K5430HNiTiEWHKJg05eRWgNfKeV7RxbqUhGKPV/207VupQ8is0IoX5vtFC18SqEHaK4GyHTZ2kzVR8PBTCO4oANIZL4ShNVZcOhKKeYg9DoWdhI1ec3os2VFI0JCIUez5+i6st0qJZRrEAIJCw+QdW223BG/EmKwTBc/IJ/qfp2FDrkUnwFo8U9dZyqnaPhxLqfYjyM1S3vb6p+GGOBszsojoTDSDFz6qj66R4LzvYJxVMwUNRjf1H1ywQr/megg2RzLximy8waqvbda8M5iijegVEiHjlM1W/3h+FcXesphsMY4dMOUnUgOxyuPEzxPQwRNvV3qg5Nj4BreyimwADWe/dRVTMjEm6MoGLzGwtystL6RyOY3qSqdlYU3FpLZw1VW0sK5943MvUCKwJ1noNtjs6Ohge76Zq9ZkfpigU5WWkDYuCfbs1U5HWFR8/Qq4a9W0uK5k4ZmdrTCl8spGIePLPlbqqsc1Afe83O0hULc8alDYiBd7ZyitYMeBfR55rR2fOKP6ioPk2dGvZ+UVI0d8rtqT2tcCexlqK2F3wRn5Q+YVbBqrLKOupkr9lZujAOrmS0UpTb4JeIPkNHZ+cXr6uoPk2vyuBSPhWLEKj45PQJuQWryyqP0Z14uGLdROHIRNBEXDR09EP5r62rOHCazhrD4VKPwxTH+sIA3ZPTJ+YuWV22n+IruHFDC8X2CBjnPoolcGc2FYUwzmsUWXDHsoGKLBhmN0VvuBVfTVE/AAbpaid5CB4MbaLY1QXGuIViLTyZQcVyGGMuxWPwaA0Vk2GI9RRp8Ci2iuLkIBjhT5LNUfAspZFiTwyC72KK7+DNg1SsRvCNp3gZXq2k4iEEXSHFJHgVXUlxejCCbTvFAHiXdIJiXxyCK7KJ5FHoMZGK9xBcwyg2QpdlVMxEUM2iyIMuXXZQNF+HswxMsSAAJRQjoE//eoqDCXBSTO6f1xd+O0iyNRY6jaWi1ALNYCocZROj4JdEikroVkjFk9DcStXxpdfCD2MoXodu4RUU9ptxxmXssOfxnvDVcxRTod9FxyhqLoAqis5aPhwTDp9spRgEH2Q6KLbYoKqlaKTm6Isp0C/sJMnjFvhiERXPQvUNRe9p29lhR04CdBpC8Sl8YiuncIxEuzUUg4Dkgj+paVozygY9plPMh28SaymO9kabAopREGF3vt9MzeFFl8G7lRSZ8FFGK8XX4VA8QjEd7XrM3M0OXz8YCy+qKBLgq3wqnofiTorF0Ax56Rg1J1elW+BBAsVe+My6iYq7IK6keBdOIseV2qn5Pb8f3MqkWAXf9ThM8c8lAOIotuFsF875lRrH5klRcG0+xcPwQ1oLxfeRAP4heQTnGL78X2rqlw2DK59SXAV/zKaiGMAuko5InCt68mcOan5+ohf+z1pP8lQY/GHZQMV4YD3FpXDp4qerqbF/lBWBswyi+AL+ia+maLgcRRQj4IYlY/UpauqKBsPJAxQF8NM1TRQ/RudSPAD34rK3scOuR8/HGcspxsJfOVS8NZbiGXiUtPgINU3v3WFDmx8pEuG3EiqKKVbCC1vm2iZqap5LAtCtleQf8F9sFYWDohzeJczYyQ4V2bEZFGsQgJRGqqqhS2phHTWn9lDkIhBTqWqxQZ+IsRvtdHY9AvI2VX2hW68nfqGmuQsCEl3JdjfCF8OW1bPdtwhQ0gm2mQzfRE3a7KCYj0BNZJs8+Kxf/r6WtTEI2FIqlsMfFgRB5A6KUnSe/vUkX0AnuvUIt8SjM1m6wWQymUwmk8lkMgXRf5vi8rLQxtUhAAAAAElFTkSuQmCC`; const imageBase64Data = `iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAACzVBMVEUAAAAAAAAAAAAAAAA/AD8zMzMqKiokJCQfHx8cHBwZGRkuFxcqFSonJyckJCQiIiIfHx8eHh4cHBwoGhomGSYkJCQhISEfHx8eHh4nHR0lHBwkGyQjIyMiIiIgICAfHx8mHh4lHh4kHR0jHCMiGyIhISEgICAfHx8lHx8kHh4jHR0hHCEhISEgICAlHx8kHx8jHh4jHh4iHSIhHCEhISElICAkHx8jHx8jHh4iHh4iHSIhHSElICAkICAjHx8jHx8iHh4iHh4hHiEhHSEkICAjHx8iHx8iHx8hHh4hHiEkHSEjHSAjHx8iHx8iHx8hHh4kHiEkHiEjHSAiHx8hHx8hHh4kHiEjHiAjHSAiHx8iHx8hHx8kHh4jHiEjHiAjHiAiICAiHx8kHx8jHh4jHiEjHiAiHiAiHSAiHx8jHx8jHx8jHiAiHiAiHiAiHSAiHx8jHx8jHx8iHiAiHiAiHiAjHx8jHx8jHx8jHx8iHiAiHiAiHiAjHx8jHx8jHx8iHx8iHSAiHiAjHiAjHx8jHx8hHx8iHx8iHyAiHiAjHiAjHiAjHh4hHx8iHx8iHx8iHyAjHSAjHiAjHiAjHh4hHx8iHx8iHx8jHyAjHiAhHh4iHx8iHx8jHyAjHSAjHSAhHiAhHh4iHx8iHx8jHx8jHyAjHSAjHSAiHh4iHh4jHx8jHx8jHyAjHyAhHSAhHSAiHh4iHh4jHx8jHx8jHyAhHyAhHSAiHSAiHh4jHh4jHx8jHx8jHyAhHyAhHSAiHSAjHR4jHh4jHx8jHx8hHyAhHyAiHSAjHSAjHR4jHh4jHx8hHx8hHyAhHyAiHyAjHSAjHR4jHR4hHh4hHx8hHyAiHyAjHyAjHSAjHR4jHR4hHh4hHx8hHyAjHyAjHyAjHSAjHR4hHR4hHR4hHx8iHyAjHyAjHyAjHSAhHR4hHR4hHR4hHx8jHyAjHyAjHyAjHyC9S2xeAAAA7nRSTlMAAQIDBAUGBwgJCgsMDQ4PEBESExQVFxgZGhscHR4fICEiIyQlJicoKSorLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZISUpLTE1OUFFSU1RVVllaW1xdXmBhYmNkZWZnaGprbG1ub3Byc3R1dnd4eXp8fn+AgYKDhIWGiImKi4yNj5CRkpOUlZaXmJmam5ydnp+goaKjpKaoqqusra6vsLGys7S1tri5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+fkZpVQAABcBJREFUGBntwftjlQMcBvDnnLNL22qzJjWlKLHFVogyty3SiFq6EZliqZGyhnSxsLlMRahYoZKRFcul5dKFCatYqWZaNKvWtrPz/A2+7/b27qRzec/lPfvl/XxgMplMJpPJZDKZAtA9HJ3ppnIez0KnSdtC0RCNznHdJrbrh85wdSlVVRaEXuoGamYi5K5430HNiTiEWHKJg05eRWgNfKeV7RxbqUhGKPV/207VupQ8is0IoX5vtFC18SqEHaK4GyHTZ2kzVR8PBTCO4oANIZL4ShNVZcOhKKeYg9DoWdhI1ec3os2VFI0JCIUez5+i6st0qJZRrEAIJCw+QdW223BG/EmKwTBc/IJ/qfp2FDrkUnwFo8U9dZyqnaPhxLqfYjyM1S3vb6p+GGOBszsojoTDSDFz6qj66R4LzvYJxVMwUNRjf1H1ywQr/megg2RzLximy8waqvbda8M5iijegVEiHjlM1W/3h+FcXesphsMY4dMOUnUgOxyuPEzxPQwRNvV3qg5Nj4BreyimwADWe/dRVTMjEm6MoGLzGwtystL6RyOY3qSqdlYU3FpLZw1VW0sK5943MvUCKwJ1noNtjs6Ohge76Zq9ZkfpigU5WWkDYuCfbs1U5HWFR8/Qq4a9W0uK5k4ZmdrTCl8spGIePLPlbqqsc1Afe83O0hULc8alDYiBd7ZyitYMeBfR55rR2fOKP6ioPk2dGvZ+UVI0d8rtqT2tcCexlqK2F3wRn5Q+YVbBqrLKOupkr9lZujAOrmS0UpTb4JeIPkNHZ+cXr6uoPk2vyuBSPhWLEKj45PQJuQWryyqP0Z14uGLdROHIRNBEXDR09EP5r62rOHCazhrD4VKPwxTH+sIA3ZPTJ+YuWV22n+IruHFDC8X2CBjnPoolcGc2FYUwzmsUWXDHsoGKLBhmN0VvuBVfTVE/AAbpaid5CB4MbaLY1QXGuIViLTyZQcVyGGMuxWPwaA0Vk2GI9RRp8Ci2iuLkIBjhT5LNUfAspZFiTwyC72KK7+DNg1SsRvCNp3gZXq2k4iEEXSHFJHgVXUlxejCCbTvFAHiXdIJiXxyCK7KJ5FHoMZGK9xBcwyg2QpdlVMxEUM2iyIMuXXZQNF+HswxMsSAAJRQjoE//eoqDCXBSTO6f1xd+O0iyNRY6jaWi1ALNYCocZROj4JdEikroVkjFk9DcStXxpdfCD2MoXodu4RUU9ptxxmXssOfxnvDVcxRTod9FxyhqLoAqis5aPhwTDp9spRgEH2Q6KLbYoKqlaKTm6Isp0C/sJMnjFvhiERXPQvUNRe9p29lhR04CdBpC8Sl8YiuncIxEuzUUg4Dkgj+paVozygY9plPMh28SaymO9kabAopREGF3vt9MzeFFl8G7lRSZ8FFGK8XX4VA8QjEd7XrM3M0OXz8YCy+qKBLgq3wqnofiTorF0Ax56Rg1J1elW+BBAsVe+My6iYq7IK6keBdOIseV2qn5Pb8f3MqkWAXf9ThM8c8lAOIotuFsF875lRrH5klRcG0+xcPwQ1oLxfeRAP4heQTnGL78X2rqlw2DK59SXAV/zKaiGMAuko5InCt68mcOan5+ohf+z1pP8lQY/GHZQMV4YD3FpXDp4qerqbF/lBWBswyi+AL+ia+maLgcRRQj4IYlY/UpauqKBsPJAxQF8NM1TRQ/RudSPAD34rK3scOuR8/HGcspxsJfOVS8NZbiGXiUtPgINU3v3WFDmx8pEuG3EiqKKVbCC1vm2iZqap5LAtCtleQf8F9sFYWDohzeJczYyQ4V2bEZFGsQgJRGqqqhS2phHTWn9lDkIhBTqWqxQZ+IsRvtdHY9AvI2VX2hW68nfqGmuQsCEl3JdjfCF8OW1bPdtwhQ0gm2mQzfRE3a7KCYj0BNZJs8+Kxf/r6WtTEI2FIqlsMfFgRB5A6KUnSe/vUkX0AnuvUIt8SjM1m6wWQymUwmk8lkMgXRf5vi8rLQxtUhAAAAAElFTkSuQmCC`;
const image6 = Media.addImage(doc, Buffer.from(imageBase64Data, "base64"), 100, 100);
doc.addSection({ const doc = new Document({
children: [ sections: [
new Paragraph({ {
children: [new TextRun("Hello World"), image5], children: [
}), new Paragraph({
new Paragraph(image), children: [
new Paragraph(image2), new TextRun("Hello World"),
new Paragraph(image3), new ImageRun({
new Paragraph(image4), data: fs.readFileSync("./demo/images/parrots.bmp"),
new Paragraph(image6), transformation: {
width: 100,
height: 100,
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/image1.jpeg"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/dog.png"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/cat.jpg"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/parrots.bmp"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: Buffer.from(imageBase64Data, "base64"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
],
},
], ],
}); });

View File

@ -1,85 +1,97 @@
// Add image to table cell // Add image to table cell
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Media, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; import { Document, ImageRun, Packer, Paragraph, Table, TableCell, TableRow } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
const image = Media.addImage(doc, fs.readFileSync("./demo/images/image1.jpeg")); {
const table = new Table({
rows: [
new TableRow({
children: [ children: [
new TableCell({ new Table({
children: [], rows: [
}), new TableRow({
new TableCell({ children: [
children: [], new TableCell({
}), children: [],
new TableCell({ }),
children: [], new TableCell({
}), children: [],
new TableCell({ }),
children: [], new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [],
}),
new TableCell({
children: [
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/image1.jpeg"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [new Paragraph("Hello")],
}),
new TableCell({
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
],
}),
],
}), }),
], ],
}), },
new TableRow({
children: [
new TableCell({
children: [],
}),
new TableCell({
children: [new Paragraph(image)],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [new Paragraph("Hello")],
}),
new TableCell({
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
new TableCell({
children: [],
}),
],
}),
], ],
}); });
doc.addSection({
children: [table],
});
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer); fs.writeFileSync("My Document.docx", buffer);
}); });

View File

@ -0,0 +1,51 @@
// Example of how you would create a table and add data to it
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Packer, Paragraph, Table, TableCell, TableRow, WidthType } from "../build";
const styles = fs.readFileSync("./demo/assets/custom-styles.xml", "utf-8");
// Create a table and pass the XML Style
const table = new Table({
style: "MyCustomTableStyle",
width: {
size: 9070,
type: WidthType.DXA,
},
rows: [
new TableRow({
children: [
new TableCell({
children: [new Paragraph("Header Colum 1")],
}),
new TableCell({
children: [new Paragraph("Header Colum 2")],
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [new Paragraph("Column Content 3")],
}),
new TableCell({
children: [new Paragraph("Column Content 2")],
}),
],
}),
],
});
const doc = new Document({
title: "Title",
externalStyles: styles,
sections: [
{
children: [table],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -1,30 +1,32 @@
// Creates two paragraphs, one with a border and one without // Creates two paragraphs, one with a border and one without
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph } from "../build"; import { BorderStyle, Document, Packer, Paragraph } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
doc.addSection({ {
children: [ children: [
new Paragraph("No border!"), new Paragraph("No border!"),
new Paragraph({ new Paragraph({
text: "I have borders on my top and bottom sides!", text: "I have borders on my top and bottom sides!",
border: { border: {
top: { top: {
color: "auto", color: "auto",
space: 1, space: 1,
value: "single", style: BorderStyle.SINGLE,
size: 6, size: 6,
}, },
bottom: { bottom: {
color: "auto", color: "auto",
space: 1, space: 1,
value: "single", style: BorderStyle.SINGLE,
size: 6, size: 6,
}, },
}, },
}), }),
],
},
], ],
}); });

View File

@ -1,7 +1,7 @@
// Custom styles using JavaScript configuration // Custom styles using JavaScript configuration
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, HeadingLevel, Packer, Paragraph, UnderlineType } from "../build"; import { Document, convertInchesToTwip, HeadingLevel, Packer, Paragraph, UnderlineType } from "../build";
const doc = new Document({ const doc = new Document({
styles: { styles: {
@ -17,7 +17,7 @@ const doc = new Document({
}, },
paragraph: { paragraph: {
indent: { indent: {
left: 720, left: convertInchesToTwip(0.5),
}, },
spacing: { spacing: {
line: 276, line: 276,
@ -47,18 +47,19 @@ const doc = new Document({
}, },
], ],
}, },
}); sections: [
{
doc.addSection({ children: [
children: [ new Paragraph({
new Paragraph({ text: "Hello",
text: "Hello", style: "myWonkyStyle",
style: "myWonkyStyle", }),
}), new Paragraph({
new Paragraph({ text: "World",
text: "World", heading: HeadingLevel.HEADING_2,
heading: HeadingLevel.HEADING_2, }),
}), ],
},
], ],
}); });

View File

@ -3,7 +3,15 @@
import * as fs from "fs"; import * as fs from "fs";
import { File, HeadingLevel, Packer, Paragraph, StyleLevel, TableOfContents } from "../build"; import { File, HeadingLevel, Packer, Paragraph, StyleLevel, TableOfContents } from "../build";
// WordprocessingML docs for TableOfContents can be found here:
// http://officeopenxml.com/WPtableOfContents.php
// Let's define the properties for generate a TOC for heading 1-5 and MySpectacularStyle,
// making the entries be hyperlinks for the paragraph
const doc = new File({ const doc = new File({
features: {
updateFields: true,
},
styles: { styles: {
paragraphStyles: [ paragraphStyles: [
{ {
@ -19,43 +27,38 @@ const doc = new File({
}, },
], ],
}, },
}); sections: [
{
// WordprocessingML docs for TableOfContents can be found here: children: [
// http://officeopenxml.com/WPtableOfContents.php new TableOfContents("Summary", {
hyperlink: true,
// Let's define the properties for generate a TOC for heading 1-5 and MySpectacularStyle, headingStyleRange: "1-5",
// making the entries be hyperlinks for the paragraph stylesWithLevels: [new StyleLevel("MySpectacularStyle", 1)],
}),
doc.addSection({ new Paragraph({
children: [ text: "Header #1",
new TableOfContents("Summary", { heading: HeadingLevel.HEADING_1,
hyperlink: true, pageBreakBefore: true,
headingStyleRange: "1-5", }),
stylesWithLevels: [new StyleLevel("MySpectacularStyle", 1)], new Paragraph("I'm a little text very nicely written.'"),
}), new Paragraph({
new Paragraph({ text: "Header #2",
text: "Header #1", heading: HeadingLevel.HEADING_1,
heading: HeadingLevel.HEADING_1, pageBreakBefore: true,
pageBreakBefore: true, }),
}), new Paragraph("I'm a other text very nicely written.'"),
new Paragraph("I'm a little text very nicely written.'"), new Paragraph({
new Paragraph({ text: "Header #2.1",
text: "Header #2", heading: HeadingLevel.HEADING_2,
heading: HeadingLevel.HEADING_1, }),
pageBreakBefore: true, new Paragraph("I'm a another text very nicely written.'"),
}), new Paragraph({
new Paragraph("I'm a other text very nicely written.'"), text: "My Spectacular Style #1",
new Paragraph({ style: "MySpectacularStyle",
text: "Header #2.1", pageBreakBefore: true,
heading: HeadingLevel.HEADING_2, }),
}), ],
new Paragraph("I'm a another text very nicely written.'"), },
new Paragraph({
text: "My Spectacular Style #1",
style: "MySpectacularStyle",
pageBreakBefore: true,
}),
], ],
}); });

View File

@ -1,7 +1,8 @@
// Numbered lists // Numbered lists
// The lists can also be restarted by specifying the instance number
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { AlignmentType, Document, Packer, Paragraph } from "../build"; import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, LevelFormat, Packer, Paragraph } from "../build";
const doc = new Document({ const doc = new Document({
numbering: { numbering: {
@ -10,12 +11,12 @@ const doc = new Document({
levels: [ levels: [
{ {
level: 0, level: 0,
format: "upperRoman", format: LevelFormat.UPPER_ROMAN,
text: "%1", text: "%1",
alignment: AlignmentType.START, alignment: AlignmentType.START,
style: { style: {
paragraph: { paragraph: {
indent: { left: 720, hanging: 260 }, indent: { left: convertInchesToTwip(0.5), hanging: convertInchesToTwip(0.18) },
}, },
}, },
}, },
@ -26,89 +27,256 @@ const doc = new Document({
levels: [ levels: [
{ {
level: 0, level: 0,
format: "decimal", format: LevelFormat.DECIMAL,
text: "%1", text: "%1",
alignment: AlignmentType.START, alignment: AlignmentType.START,
style: { style: {
paragraph: { paragraph: {
indent: { left: 720, hanging: 260 }, indent: { left: convertInchesToTwip(0.5), hanging: convertInchesToTwip(0.18) },
}, },
}, },
}, },
], ],
reference: "my-number-numbering-reference", reference: "my-number-numbering-reference",
}, },
{
levels: [
{
level: 0,
format: LevelFormat.DECIMAL_ZERO,
text: "[%1]",
alignment: AlignmentType.START,
style: {
paragraph: {
indent: { left: convertInchesToTwip(0.5), hanging: convertInchesToTwip(0.18) },
},
},
},
],
reference: "padded-numbering-reference",
},
], ],
}, },
}); sections: [
{
doc.addSection({ children: [
children: [ new Paragraph({
new Paragraph({ text: "line with contextual spacing",
text: "line with contextual spacing", numbering: {
numbering: { reference: "my-crazy-reference",
reference: "my-crazy-reference", level: 0,
level: 0, },
}, contextualSpacing: true,
contextualSpacing: true, spacing: {
spacing: { before: 200,
before: 200, },
}, }),
}), new Paragraph({
new Paragraph({ text: "line with contextual spacing",
text: "line with contextual spacing", numbering: {
numbering: { reference: "my-crazy-reference",
reference: "my-crazy-reference", level: 0,
level: 0, },
}, contextualSpacing: true,
contextualSpacing: true, spacing: {
spacing: { before: 200,
before: 200, },
}, }),
}), new Paragraph({
new Paragraph({ text: "line without contextual spacing",
text: "line without contextual spacing", numbering: {
numbering: { reference: "my-crazy-reference",
reference: "my-crazy-reference", level: 0,
level: 0, },
}, contextualSpacing: false,
contextualSpacing: false, spacing: {
spacing: { before: 200,
before: 200, },
}, }),
}), new Paragraph({
new Paragraph({ text: "line without contextual spacing",
text: "line without contextual spacing", numbering: {
numbering: { reference: "my-crazy-reference",
reference: "my-crazy-reference", level: 0,
level: 0, },
}, contextualSpacing: false,
contextualSpacing: false, spacing: {
spacing: { before: 200,
before: 200, },
}, }),
}), new Paragraph({
new Paragraph({ text: "Step 1 - Add sugar",
text: "Step 1 - Add sugar", numbering: {
numbering: { reference: "my-number-numbering-reference",
reference: "my-number-numbering-reference", level: 0,
level: 0, },
}, }),
}), new Paragraph({
new Paragraph({ text: "Step 2 - Add wheat",
text: "Step 2 - Add wheat", numbering: {
numbering: { reference: "my-number-numbering-reference",
reference: "my-number-numbering-reference", level: 0,
level: 0, },
}, }),
}), new Paragraph({
new Paragraph({ text: "Step 3 - Put in oven",
text: "Step 3 - Put in oven", numbering: {
numbering: { reference: "my-number-numbering-reference",
reference: "my-number-numbering-reference", level: 0,
level: 0, },
}, }),
}), new Paragraph({
text: "Next",
heading: HeadingLevel.HEADING_2,
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
instance: 2,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
instance: 2,
},
}),
new Paragraph({
text: "Next",
heading: HeadingLevel.HEADING_2,
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
instance: 3,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
instance: 3,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
instance: 3,
},
}),
new Paragraph({
text: "Next",
heading: HeadingLevel.HEADING_2,
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "test",
numbering: {
reference: "padded-numbering-reference",
level: 0,
},
}),
],
},
], ],
}); });

View File

@ -1,7 +1,7 @@
// Numbering and bullet points example // Numbering and bullet points example
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { AlignmentType, Document, Packer, Paragraph } from "../build"; import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, LevelFormat, Packer, Paragraph } from "../build";
const doc = new Document({ const doc = new Document({
numbering: { numbering: {
@ -11,40 +11,40 @@ const doc = new Document({
levels: [ levels: [
{ {
level: 0, level: 0,
format: "upperRoman", format: LevelFormat.UPPER_ROMAN,
text: "%1", text: "%1",
alignment: AlignmentType.START, alignment: AlignmentType.START,
style: { style: {
paragraph: { paragraph: {
indent: { left: 720, hanging: 260 }, indent: { left: convertInchesToTwip(0.5), hanging: convertInchesToTwip(0.18) },
}, },
}, },
}, },
{ {
level: 1, level: 1,
format: "decimal", format: LevelFormat.DECIMAL,
text: "%2.", text: "%2.",
alignment: AlignmentType.START, alignment: AlignmentType.START,
style: { style: {
paragraph: { paragraph: {
indent: { left: 1440, hanging: 980 }, indent: { left: convertInchesToTwip(1), hanging: convertInchesToTwip(0.68) },
}, },
}, },
}, },
{ {
level: 2, level: 2,
format: "lowerLetter", format: LevelFormat.LOWER_LETTER,
text: "%3)", text: "%3)",
alignment: AlignmentType.START, alignment: AlignmentType.START,
style: { style: {
paragraph: { paragraph: {
indent: { left: 2160, hanging: 1700 }, indent: { left: convertInchesToTwip(1.5), hanging: convertInchesToTwip(1.18) },
}, },
}, },
}, },
{ {
level: 3, level: 3,
format: "upperLetter", format: LevelFormat.UPPER_LETTER,
text: "%4)", text: "%4)",
alignment: AlignmentType.START, alignment: AlignmentType.START,
style: { style: {
@ -55,85 +55,199 @@ const doc = new Document({
}, },
], ],
}, },
{
reference: "my-unique-bullet-points",
levels: [
{
level: 0,
format: LevelFormat.BULLET,
text: "\u1F60",
alignment: AlignmentType.LEFT,
style: {
paragraph: {
indent: { left: convertInchesToTwip(0.5), hanging: convertInchesToTwip(0.25) },
},
},
},
{
level: 1,
format: LevelFormat.BULLET,
text: "\u00A5",
alignment: AlignmentType.LEFT,
style: {
paragraph: {
indent: { left: convertInchesToTwip(1), hanging: convertInchesToTwip(0.25) },
},
},
},
{
level: 2,
format: LevelFormat.BULLET,
text: "\u273F",
alignment: AlignmentType.LEFT,
style: {
paragraph: {
indent: { left: 2160, hanging: convertInchesToTwip(0.25) },
},
},
},
{
level: 3,
format: LevelFormat.BULLET,
text: "\u267A",
alignment: AlignmentType.LEFT,
style: {
paragraph: {
indent: { left: 2880, hanging: convertInchesToTwip(0.25) },
},
},
},
{
level: 4,
format: LevelFormat.BULLET,
text: "\u2603",
alignment: AlignmentType.LEFT,
style: {
paragraph: {
indent: { left: 3600, hanging: convertInchesToTwip(0.25) },
},
},
},
],
},
], ],
}, },
}); sections: [
{
doc.addSection({ children: [
children: [ new Paragraph({
new Paragraph({ text: "Hey you",
text: "Hey you", numbering: {
numbering: { reference: "my-crazy-numbering",
reference: "my-crazy-numbering", level: 0,
level: 0, },
}, }),
}), new Paragraph({
new Paragraph({ text: "What's up fam",
text: "What's up fam", numbering: {
numbering: { reference: "my-crazy-numbering",
reference: "my-crazy-numbering", level: 1,
level: 1, },
}, }),
}), new Paragraph({
new Paragraph({ text: "Hello World 2",
text: "Hello World 2", numbering: {
numbering: { reference: "my-crazy-numbering",
reference: "my-crazy-numbering", level: 1,
level: 1, },
}, }),
}), new Paragraph({
new Paragraph({ text: "Yeah boi",
text: "Yeah boi", numbering: {
numbering: { reference: "my-crazy-numbering",
reference: "my-crazy-numbering", level: 2,
level: 2, },
}, }),
}), new Paragraph({
new Paragraph({ text: "Hey you",
text: "Hey you", bullet: {
bullet: { level: 0,
level: 0, },
}, }),
}), new Paragraph({
new Paragraph({ text: "What's up fam",
text: "What's up fam", bullet: {
bullet: { level: 1,
level: 1, },
}, }),
}), new Paragraph({
new Paragraph({ text: "Hello World 2",
text: "Hello World 2", bullet: {
bullet: { level: 2,
level: 2, },
}, }),
}), new Paragraph({
new Paragraph({ text: "Yeah boi",
text: "Yeah boi", bullet: {
bullet: { level: 3,
level: 3, },
}, }),
}), new Paragraph({
new Paragraph({ text: "101 MSXFM",
text: "101 MSXFM", numbering: {
numbering: { reference: "my-crazy-numbering",
reference: "my-crazy-numbering", level: 3,
level: 3, },
}, }),
}), new Paragraph({
new Paragraph({ text: "back to level 1",
text: "back to level 1", numbering: {
numbering: { reference: "my-crazy-numbering",
reference: "my-crazy-numbering", level: 1,
level: 1, },
}, }),
}), new Paragraph({
new Paragraph({ text: "back to level 0",
text: "back to level 0", numbering: {
numbering: { reference: "my-crazy-numbering",
reference: "my-crazy-numbering", level: 0,
level: 0, },
}, }),
}), new Paragraph({
text: "Custom Bullet points",
heading: HeadingLevel.HEADING_1,
}),
new Paragraph({
text: "What's up fam",
numbering: {
reference: "my-unique-bullet-points",
level: 0,
},
}),
new Paragraph({
text: "Hey you",
numbering: {
reference: "my-unique-bullet-points",
level: 0,
},
}),
new Paragraph({
text: "What's up fam",
numbering: {
reference: "my-unique-bullet-points",
level: 1,
},
}),
new Paragraph({
text: "Hello World 2",
numbering: {
reference: "my-unique-bullet-points",
level: 2,
},
}),
new Paragraph({
text: "Yeah boi",
numbering: {
reference: "my-unique-bullet-points",
level: 3,
},
}),
new Paragraph({
text: "my Awesome numbering",
numbering: {
reference: "my-unique-bullet-points",
level: 4,
},
}),
new Paragraph({
text: "Back to level 1",
numbering: {
reference: "my-unique-bullet-points",
level: 1,
},
}),
],
},
], ],
}); });

View File

@ -12,16 +12,21 @@ fs.readFile(filePath, (err, data) => {
} }
importDotx.extract(data).then((templateDocument) => { importDotx.extract(data).then((templateDocument) => {
const doc = new Document(undefined, { const doc = new Document(
template: templateDocument, {
}); sections: [
{
doc.addSection({ properties: {
properties: { titlePage: templateDocument.titlePageIsDefined,
titlePage: templateDocument.titlePageIsDefined, },
children: [new Paragraph("Hello World")],
},
],
}, },
children: [new Paragraph("Hello World")], {
}); template: templateDocument,
},
);
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer); fs.writeFileSync("My Document.docx", buffer);

View File

@ -3,74 +3,76 @@
import * as fs from "fs"; import * as fs from "fs";
import { Document, HeadingLevel, Packer, Paragraph, Table, TableCell, TableRow, VerticalAlign, TextDirection } from "../build"; import { Document, HeadingLevel, Packer, Paragraph, Table, TableCell, TableRow, VerticalAlign, TextDirection } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
const table = new Table({ {
rows: [
new TableRow({
children: [ children: [
new TableCell({ new Table({
children: [new Paragraph({}), new Paragraph({})], rows: [
verticalAlign: VerticalAlign.CENTER, new TableRow({
}), children: [
new TableCell({ new TableCell({
children: [new Paragraph({}), new Paragraph({})], children: [new Paragraph({}), new Paragraph({})],
verticalAlign: VerticalAlign.CENTER, verticalAlign: VerticalAlign.CENTER,
}), }),
new TableCell({ new TableCell({
children: [new Paragraph({ text: "bottom to top" }), new Paragraph({})], children: [new Paragraph({}), new Paragraph({})],
textDirection: TextDirection.BOTTOM_TO_TOP_LEFT_TO_RIGHT, verticalAlign: VerticalAlign.CENTER,
}), }),
new TableCell({ new TableCell({
children: [new Paragraph({ text: "top to bottom" }), new Paragraph({})], children: [new Paragraph({ text: "bottom to top" }), new Paragraph({})],
textDirection: TextDirection.TOP_TO_BOTTOM_RIGHT_TO_LEFT, textDirection: TextDirection.BOTTOM_TO_TOP_LEFT_TO_RIGHT,
}),
new TableCell({
children: [new Paragraph({ text: "top to bottom" }), new Paragraph({})],
textDirection: TextDirection.TOP_TO_BOTTOM_RIGHT_TO_LEFT,
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [
new Paragraph({
text:
"Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah",
heading: HeadingLevel.HEADING_1,
}),
],
}),
new TableCell({
children: [
new Paragraph({
text: "This text should be in the middle of the cell",
}),
],
verticalAlign: VerticalAlign.CENTER,
}),
new TableCell({
children: [
new Paragraph({
text: "Text above should be vertical from bottom to top",
}),
],
verticalAlign: VerticalAlign.CENTER,
}),
new TableCell({
children: [
new Paragraph({
text: "Text above should be vertical from top to bottom",
}),
],
verticalAlign: VerticalAlign.CENTER,
}),
],
}),
],
}), }),
], ],
}), },
new TableRow({
children: [
new TableCell({
children: [
new Paragraph({
text:
"Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah",
heading: HeadingLevel.HEADING_1,
}),
],
}),
new TableCell({
children: [
new Paragraph({
text: "This text should be in the middle of the cell",
}),
],
verticalAlign: VerticalAlign.CENTER,
}),
new TableCell({
children: [
new Paragraph({
text: "Text above should be vertical from bottom to top",
}),
],
verticalAlign: VerticalAlign.CENTER,
}),
new TableCell({
children: [
new Paragraph({
text: "Text above should be vertical from top to bottom",
}),
],
verticalAlign: VerticalAlign.CENTER,
}),
],
}),
], ],
}); });
doc.addSection({
children: [table],
});
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer); fs.writeFileSync("My Document.docx", buffer);
}); });

View File

@ -2,9 +2,20 @@
// Also includes an example on how to center tables // Also includes an example on how to center tables
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { AlignmentType, BorderStyle, Document, HeadingLevel, Packer, Paragraph, ShadingType, Table, TableCell, TableRow, WidthType } from "../build"; import {
AlignmentType,
const doc = new Document(); BorderStyle,
convertInchesToTwip,
Document,
HeadingLevel,
Packer,
Paragraph,
ShadingType,
Table,
TableCell,
TableRow,
WidthType,
} from "../build";
const table = new Table({ const table = new Table({
rows: [ rows: [
@ -37,10 +48,10 @@ const table2 = new Table({
new TableCell({ new TableCell({
children: [new Paragraph("World")], children: [new Paragraph("World")],
margins: { margins: {
top: 1000, top: convertInchesToTwip(0.69),
bottom: 1000, bottom: convertInchesToTwip(0.69),
left: 1000, left: convertInchesToTwip(0.69),
right: 1000, right: convertInchesToTwip(0.69),
}, },
columnSpan: 3, columnSpan: 3,
}), }),
@ -64,7 +75,7 @@ const table2 = new Table({
size: 100, size: 100,
type: WidthType.AUTO, type: WidthType.AUTO,
}, },
columnWidths: [1000, 1000, 1000], columnWidths: [convertInchesToTwip(0.69), convertInchesToTwip(0.69), convertInchesToTwip(0.69)],
}); });
const table3 = new Table({ const table3 = new Table({
@ -87,7 +98,7 @@ const table3 = new Table({
children: [new Paragraph("Bar1")], children: [new Paragraph("Bar1")],
shading: { shading: {
fill: "b79c2f", fill: "b79c2f",
val: ShadingType.REVERSE_DIAGONAL_STRIPE, type: ShadingType.REVERSE_DIAGONAL_STRIPE,
color: "auto", color: "auto",
}, },
}), }),
@ -95,7 +106,7 @@ const table3 = new Table({
children: [new Paragraph("Bar2")], children: [new Paragraph("Bar2")],
shading: { shading: {
fill: "42c5f4", fill: "42c5f4",
val: ShadingType.PERCENT_95, type: ShadingType.PERCENT_95,
color: "auto", color: "auto",
}, },
}), }),
@ -103,7 +114,7 @@ const table3 = new Table({
children: [new Paragraph("Bar3")], children: [new Paragraph("Bar3")],
shading: { shading: {
fill: "880aa8", fill: "880aa8",
val: ShadingType.PERCENT_10, type: ShadingType.PERCENT_10,
color: "e2df0b", color: "e2df0b",
}, },
}), }),
@ -111,7 +122,7 @@ const table3 = new Table({
children: [new Paragraph("Bar4")], children: [new Paragraph("Bar4")],
shading: { shading: {
fill: "FF0000", fill: "FF0000",
val: ShadingType.CLEAR, type: ShadingType.CLEAR,
color: "auto", color: "auto",
}, },
}), }),
@ -119,14 +130,14 @@ const table3 = new Table({
}), }),
], ],
width: { width: {
size: 7000, size: convertInchesToTwip(4.86),
type: WidthType.DXA, type: WidthType.DXA,
}, },
margins: { margins: {
top: 400, top: convertInchesToTwip(0.27),
bottom: 400, bottom: convertInchesToTwip(0.27),
right: 400, right: convertInchesToTwip(0.27),
left: 400, left: convertInchesToTwip(0.27),
}, },
}); });
@ -213,22 +224,22 @@ const borders = {
top: { top: {
style: BorderStyle.DASH_SMALL_GAP, style: BorderStyle.DASH_SMALL_GAP,
size: 1, size: 1,
color: "red", color: "FF0000",
}, },
bottom: { bottom: {
style: BorderStyle.DASH_SMALL_GAP, style: BorderStyle.DASH_SMALL_GAP,
size: 1, size: 1,
color: "red", color: "FF0000",
}, },
left: { left: {
style: BorderStyle.DASH_SMALL_GAP, style: BorderStyle.DASH_SMALL_GAP,
size: 1, size: 1,
color: "red", color: "FF0000",
}, },
right: { right: {
style: BorderStyle.DASH_SMALL_GAP, style: BorderStyle.DASH_SMALL_GAP,
size: 1, size: 1,
color: "red", color: "FF0000",
}, },
}; };
@ -355,9 +366,7 @@ const table8 = new Table({
], ],
}), }),
new TableRow({ new TableRow({
children: [ children: [new TableCell({ children: [new Paragraph("4,1")] })],
new TableCell({ children: [new Paragraph("4,1")] }),
],
}), }),
], ],
width: { width: {
@ -365,30 +374,33 @@ const table8 = new Table({
type: WidthType.PERCENTAGE, type: WidthType.PERCENTAGE,
}, },
}); });
const doc = new Document({
doc.addSection({ sections: [
children: [ {
table, children: [
new Paragraph({ table,
text: "Another table", new Paragraph({
heading: HeadingLevel.HEADING_2, text: "Another table",
}), heading: HeadingLevel.HEADING_2,
table2, }),
new Paragraph({ table2,
text: "Another table", new Paragraph({
heading: HeadingLevel.HEADING_2, text: "Another table",
}), heading: HeadingLevel.HEADING_2,
table3, }),
new Paragraph("Merging columns 1"), table3,
table4, new Paragraph("Merging columns 1"),
new Paragraph("Merging columns 2"), table4,
table5, new Paragraph("Merging columns 2"),
new Paragraph("Merging columns 3"), table5,
table6, new Paragraph("Merging columns 3"),
new Paragraph("Merging columns 4"), table6,
table7, new Paragraph("Merging columns 4"),
new Paragraph("Merging columns 5"), table7,
table8, new Paragraph("Merging columns 5"),
table8,
],
},
], ],
}); });

View File

@ -3,42 +3,44 @@
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph, SequentialIdentifier, TextRun } from "../build"; import { Document, Packer, Paragraph, SequentialIdentifier, TextRun } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
doc.addSection({ {
children: [
new Paragraph({
children: [ children: [
new TextRun("Hello World 1->"), new Paragraph({
new SequentialIdentifier("Caption"), children: [
new TextRun(" text after sequencial caption 2->"), new TextRun("Hello World 1->"),
new SequentialIdentifier("Caption"), new SequentialIdentifier("Caption"),
new TextRun(" text after sequencial caption 2->"),
new SequentialIdentifier("Caption"),
],
}),
new Paragraph({
children: [
new TextRun("Hello World 1->"),
new SequentialIdentifier("Label"),
new TextRun(" text after sequencial caption 2->"),
new SequentialIdentifier("Label"),
],
}),
new Paragraph({
children: [
new TextRun("Hello World 1->"),
new SequentialIdentifier("Another"),
new TextRun(" text after sequencial caption 3->"),
new SequentialIdentifier("Label"),
],
}),
new Paragraph({
children: [
new TextRun("Hello World 2->"),
new SequentialIdentifier("Another"),
new TextRun(" text after sequencial caption 4->"),
new SequentialIdentifier("Label"),
],
}),
], ],
}), },
new Paragraph({
children: [
new TextRun("Hello World 1->"),
new SequentialIdentifier("Label"),
new TextRun(" text after sequencial caption 2->"),
new SequentialIdentifier("Label"),
],
}),
new Paragraph({
children: [
new TextRun("Hello World 1->"),
new SequentialIdentifier("Another"),
new TextRun(" text after sequencial caption 3->"),
new SequentialIdentifier("Label"),
],
}),
new Paragraph({
children: [
new TextRun("Hello World 2->"),
new SequentialIdentifier("Another"),
new TextRun(" text after sequencial caption 4->"),
new SequentialIdentifier("Label"),
],
}),
], ],
}); });

View File

@ -16,8 +16,6 @@ import {
WidthType, WidthType,
} from "../build"; } from "../build";
const doc = new Document();
const table = new Table({ const table = new Table({
rows: [ rows: [
new TableRow({ new TableRow({
@ -45,6 +43,10 @@ const table = new Table({
relativeHorizontalPosition: RelativeHorizontalPosition.RIGHT, relativeHorizontalPosition: RelativeHorizontalPosition.RIGHT,
relativeVerticalPosition: RelativeVerticalPosition.BOTTOM, relativeVerticalPosition: RelativeVerticalPosition.BOTTOM,
overlap: OverlapType.NEVER, overlap: OverlapType.NEVER,
leftFromText: 1000,
rightFromText: 2000,
topFromText: 1500,
bottomFromText: 30,
}, },
width: { width: {
size: 4535, size: 4535,
@ -53,8 +55,12 @@ const table = new Table({
layout: TableLayoutType.FIXED, layout: TableLayoutType.FIXED,
}); });
doc.addSection({ const doc = new Document({
children: [table], sections: [
{
children: [table],
},
],
}); });
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {

View File

@ -1,33 +1,148 @@
// Example on how to add hyperlinks to websites // Example on how to add hyperlinks to websites
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, HyperlinkRef, HyperlinkType, Packer, Paragraph, Media } from "../build"; import { Document, ExternalHyperlink, Footer, FootnoteReferenceRun, ImageRun, Packer, Paragraph, TextRun } from "../build";
const doc = new Document({ const doc = new Document({
hyperlinks: { footnotes: {
myCoolLink: { 1: {
link: "http://www.example.com", children: [
text: "Hyperlink", new Paragraph({
type: HyperlinkType.EXTERNAL, children: [
}, new TextRun("Click here for the "),
myOtherLink: { new ExternalHyperlink({
link: "http://www.google.com", children: [
text: "Google Link", new TextRun({
type: HyperlinkType.EXTERNAL, text: "Footnotes external hyperlink",
style: "Hyperlink",
}),
],
link: "http://www.example.com",
}),
],
}),
],
}, },
}, },
}); sections: [
{
const image1 = Media.addImage(doc, fs.readFileSync("./demo/images/image1.jpeg")); footers: {
default: new Footer({
doc.addSection({ children: [
children: [ new Paragraph({
new Paragraph({ children: [
children: [new HyperlinkRef("myCoolLink")], new TextRun("Click here for the "),
}), new ExternalHyperlink({
new Paragraph({ children: [
children: [image1, new HyperlinkRef("myOtherLink")], new TextRun({
}), text: "Footer external hyperlink",
style: "Hyperlink",
}),
],
link: "http://www.example.com",
}),
],
}),
],
}),
},
headers: {
default: new Footer({
children: [
new Paragraph({
children: [
new TextRun("Click here for the "),
new ExternalHyperlink({
children: [
new TextRun({
text: "Header external hyperlink",
style: "Hyperlink",
}),
],
link: "http://www.google.com",
}),
],
}),
],
}),
},
children: [
new Paragraph({
children: [
new ExternalHyperlink({
children: [
new TextRun({
text: "Anchor Text",
style: "Hyperlink",
}),
],
link: "http://www.example.com",
}),
new FootnoteReferenceRun(1),
],
}),
new Paragraph({
children: [
new ExternalHyperlink({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/image1.jpeg"),
transformation: {
width: 100,
height: 100,
},
}),
],
link: "http://www.google.com",
}),
new ExternalHyperlink({
children: [
new TextRun({
text: "BBC News Link",
style: "Hyperlink",
}),
],
link: "https://www.bbc.co.uk/news",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "This is a hyperlink with formatting: ",
}),
new ExternalHyperlink({
children: [
new TextRun({
text: "A ",
style: "Hyperlink",
}),
new TextRun({
text: "single ",
bold: true,
style: "Hyperlink",
}),
new TextRun({
text: "link",
doubleStrike: true,
style: "Hyperlink",
}),
new TextRun({
text: "1",
superScript: true,
style: "Hyperlink",
}),
new TextRun({
text: "!",
style: "Hyperlink",
}),
],
link: "http://www.example.com",
}),
],
}),
],
},
], ],
}); });

View File

@ -1,10 +1,7 @@
// Add image to table cell in a header and body // Add image to table cell in a header and body
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Header, Media, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; import { Document, Header, ImageRun, Packer, Paragraph, Table, TableCell, TableRow } from "../build";
const doc = new Document();
const image = Media.addImage(doc, fs.readFileSync("./demo/images/image1.jpeg"));
const table = new Table({ const table = new Table({
rows: [ rows: [
@ -30,7 +27,19 @@ const table = new Table({
children: [], children: [],
}), }),
new TableCell({ new TableCell({
children: [new Paragraph(image)], children: [
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/image1.jpeg"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
],
}), }),
], ],
}), }),
@ -58,13 +67,17 @@ const table = new Table({
}); });
// Adding same table in the body and in the header // Adding same table in the body and in the header
doc.addSection({ const doc = new Document({
headers: { sections: [
default: new Header({ {
headers: {
default: new Header({
children: [table],
}),
},
children: [table], children: [table],
}), },
}, ],
children: [table],
}); });
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {

View File

@ -1,20 +1,53 @@
// Add images to header and footer // Add images to header and footer
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Header, Media, Packer, Paragraph } from "../build"; import { Document, Header, ImageRun, Packer, Paragraph } from "../build";
const doc = new Document(); const doc = new Document({
const image = Media.addImage(doc, fs.readFileSync("./demo/images/image1.jpeg")); sections: [
const image1 = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif")); {
const image2 = Media.addImage(doc, fs.readFileSync("./demo/images/image1.jpeg")); headers: {
default: new Header({
doc.addSection({ children: [
headers: { new Paragraph({
default: new Header({ children: [
children: [new Paragraph(image), new Paragraph(image1), new Paragraph(image2)], new ImageRun({
}), data: fs.readFileSync("./demo/images/image1.jpeg"),
}, transformation: {
children: [new Paragraph("Hello World")], width: 100,
height: 100,
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/image1.jpeg"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
],
}),
},
children: [new Paragraph("Hello World")],
},
],
}); });
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {

View File

@ -2,41 +2,50 @@
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
// import { Document, Packer, Paragraph } from "../build"; // import { Document, Packer, Paragraph } from "../build";
import { Document, Media, Packer, Paragraph, TextWrappingSide, TextWrappingType } from "../build"; import { Document, ImageRun, Packer, Paragraph, TextWrappingSide, TextWrappingType } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
const image = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"), 200, 200, { {
floating: { children: [
horizontalPosition: { new Paragraph(
offset: 2014400, "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vehicula nec nulla vitae efficitur. Ut interdum mauris eu ipsum rhoncus, nec pharetra velit placerat. Sed vehicula libero ac urna molestie, id pharetra est pellentesque. Praesent iaculis vehicula fringilla. Duis pretium gravida orci eu vestibulum. Mauris tincidunt ipsum dolor, ut ornare dolor pellentesque id. Integer in nulla gravida, lacinia ante non, commodo ex. Vivamus vulputate nisl id lectus finibus vulputate. Ut et nisl mi. Cras fermentum augue arcu, ac accumsan elit euismod id. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed ac posuere nisi. Pellentesque tincidunt vehicula bibendum. Phasellus eleifend viverra nisl.",
),
new Paragraph(
"Proin ac purus faucibus, porttitor magna ut, cursus nisl. Vivamus ante purus, porta accumsan nibh eget, eleifend dignissim odio. Integer sed dictum est, aliquam lacinia justo. Donec ultrices auctor venenatis. Etiam interdum et elit nec elementum. Pellentesque nec viverra mauris. Etiam suscipit leo nec velit fringilla mattis. Pellentesque justo lacus, sodales eu condimentum in, dapibus finibus lacus. Morbi vitae nibh sit amet sem molestie feugiat. In non porttitor enim.",
),
new Paragraph(
"Ut eget diam cursus quam accumsan interdum at id ante. Ut mollis mollis arcu, eu scelerisque dui tempus in. Quisque aliquam, augue quis ornare aliquam, ex purus ultrices mauris, ut porta dolor dolor nec justo. Nunc a tempus odio, eu viverra arcu. Suspendisse vitae nibh nec mi pharetra tempus. Mauris ut ullamcorper sapien, et sagittis sapien. Vestibulum in urna metus. In scelerisque, massa id bibendum tempus, quam orci rutrum turpis, a feugiat nisi ligula id metus. Praesent id dictum purus. Proin interdum ipsum nulla.",
),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 200,
height: 200,
},
floating: {
horizontalPosition: {
offset: 2014400,
},
verticalPosition: {
offset: 2014400,
},
wrap: {
type: TextWrappingType.SQUARE,
side: TextWrappingSide.BOTH_SIDES,
},
margins: {
top: 201440,
bottom: 201440,
},
},
}),
],
}),
],
}, },
verticalPosition: {
offset: 2014400,
},
wrap: {
type: TextWrappingType.SQUARE,
side: TextWrappingSide.BOTH_SIDES,
},
margins: {
top: 201440,
bottom: 201440,
},
},
});
doc.addSection({
children: [
new Paragraph(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque vehicula nec nulla vitae efficitur. Ut interdum mauris eu ipsum rhoncus, nec pharetra velit placerat. Sed vehicula libero ac urna molestie, id pharetra est pellentesque. Praesent iaculis vehicula fringilla. Duis pretium gravida orci eu vestibulum. Mauris tincidunt ipsum dolor, ut ornare dolor pellentesque id. Integer in nulla gravida, lacinia ante non, commodo ex. Vivamus vulputate nisl id lectus finibus vulputate. Ut et nisl mi. Cras fermentum augue arcu, ac accumsan elit euismod id. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Sed ac posuere nisi. Pellentesque tincidunt vehicula bibendum. Phasellus eleifend viverra nisl.",
),
new Paragraph(
"Proin ac purus faucibus, porttitor magna ut, cursus nisl. Vivamus ante purus, porta accumsan nibh eget, eleifend dignissim odio. Integer sed dictum est, aliquam lacinia justo. Donec ultrices auctor venenatis. Etiam interdum et elit nec elementum. Pellentesque nec viverra mauris. Etiam suscipit leo nec velit fringilla mattis. Pellentesque justo lacus, sodales eu condimentum in, dapibus finibus lacus. Morbi vitae nibh sit amet sem molestie feugiat. In non porttitor enim.",
),
new Paragraph(
"Ut eget diam cursus quam accumsan interdum at id ante. Ut mollis mollis arcu, eu scelerisque dui tempus in. Quisque aliquam, augue quis ornare aliquam, ex purus ultrices mauris, ut porta dolor dolor nec justo. Nunc a tempus odio, eu viverra arcu. Suspendisse vitae nibh nec mi pharetra tempus. Mauris ut ullamcorper sapien, et sagittis sapien. Vestibulum in urna metus. In scelerisque, massa id bibendum tempus, quam orci rutrum turpis, a feugiat nisi ligula id metus. Praesent id dictum purus. Proin interdum ipsum nulla.",
),
new Paragraph(image),
], ],
}); });

View File

@ -1,66 +1,72 @@
// Example how to display page numbers // Example how to display page numbers
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, PageNumberFormat, Paragraph, TextRun } from "../build"; import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, NumberFormat, Paragraph, TextRun } from "../build";
const doc = new Document({}); const doc = new Document({
sections: [
doc.addSection({ {
headers: { properties: {
default: new Header({ page: {
children: [ pageNumbers: {
new Paragraph({ start: 1,
formatType: NumberFormat.DECIMAL,
},
},
},
headers: {
default: new Header({
children: [ children: [
new TextRun("Foo Bar corp. "), new Paragraph({
new TextRun({ children: [
children: ["Page Number ", PageNumber.CURRENT], new TextRun("Foo Bar corp. "),
}), new TextRun({
new TextRun({ children: ["Page Number ", PageNumber.CURRENT],
children: [" to ", PageNumber.TOTAL_PAGES], }),
new TextRun({
children: [" to ", PageNumber.TOTAL_PAGES],
}),
],
}), }),
], ],
}), }),
], },
}), footers: {
}, default: new Footer({
footers: {
default: new Footer({
children: [
new Paragraph({
alignment: AlignmentType.CENTER,
children: [ children: [
new TextRun("Foo Bar corp. "), new Paragraph({
new TextRun({ alignment: AlignmentType.CENTER,
children: ["Page Number: ", PageNumber.CURRENT], children: [
}), new TextRun("Foo Bar corp. "),
new TextRun({ new TextRun({
children: [" to ", PageNumber.TOTAL_PAGES], children: ["Page Number: ", PageNumber.CURRENT],
}),
new TextRun({
children: [" to ", PageNumber.TOTAL_PAGES],
}),
],
}), }),
], ],
}), }),
},
children: [
new Paragraph({
children: [new TextRun("Hello World 1"), new PageBreak()],
}),
new Paragraph({
children: [new TextRun("Hello World 2"), new PageBreak()],
}),
new Paragraph({
children: [new TextRun("Hello World 3"), new PageBreak()],
}),
new Paragraph({
children: [new TextRun("Hello World 4"), new PageBreak()],
}),
new Paragraph({
children: [new TextRun("Hello World 5"), new PageBreak()],
}),
], ],
}), },
},
properties: {
pageNumberStart: 1,
pageNumberFormatType: PageNumberFormat.DECIMAL,
},
children: [
new Paragraph({
children: [new TextRun("Hello World 1"), new PageBreak()],
}),
new Paragraph({
children: [new TextRun("Hello World 2"), new PageBreak()],
}),
new Paragraph({
children: [new TextRun("Hello World 3"), new PageBreak()],
}),
new Paragraph({
children: [new TextRun("Hello World 4"), new PageBreak()],
}),
new Paragraph({
children: [new TextRun("Hello World 5"), new PageBreak()],
}),
], ],
}); });

View File

@ -1,11 +1,93 @@
// Example of how you would create a table and add data to it // Example of how you would create a table and add data to it
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; import { Document, Packer, Paragraph, Table, TableCell, TableRow, WidthType } from "../build";
const doc = new Document();
const table = new Table({ const table = new Table({
columnWidths: [3505, 5505],
rows: [
new TableRow({
children: [
new TableCell({
width: {
size: 3505,
type: WidthType.DXA,
},
children: [new Paragraph("Hello")],
}),
new TableCell({
width: {
size: 5505,
type: WidthType.DXA,
},
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
width: {
size: 3505,
type: WidthType.DXA,
},
children: [],
}),
new TableCell({
width: {
size: 5505,
type: WidthType.DXA,
},
children: [new Paragraph("World")],
}),
],
}),
],
});
const table2 = new Table({
columnWidths: [4505, 4505],
rows: [
new TableRow({
children: [
new TableCell({
width: {
size: 4505,
type: WidthType.DXA,
},
children: [new Paragraph("Hello")],
}),
new TableCell({
width: {
size: 4505,
type: WidthType.DXA,
},
children: [],
}),
],
}),
new TableRow({
children: [
new TableCell({
width: {
size: 4505,
type: WidthType.DXA,
},
children: [],
}),
new TableCell({
width: {
size: 4505,
type: WidthType.DXA,
},
children: [new Paragraph("World")],
}),
],
}),
],
});
const table3 = new Table({
rows: [ rows: [
new TableRow({ new TableRow({
children: [ children: [
@ -30,8 +112,19 @@ const table = new Table({
], ],
}); });
doc.addSection({ const doc = new Document({
children: [table], sections: [
{
children: [
new Paragraph({ text: "Table with skewed widths" }),
table,
new Paragraph({ text: "Table with equal widths" }),
table2,
new Paragraph({ text: "Table without setting widths" }),
table3,
],
},
],
}); });
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {

View File

@ -3,24 +3,28 @@
import * as fs from "fs"; import * as fs from "fs";
import { Document, HeadingLevel, LineNumberRestartFormat, Packer, Paragraph } from "../build"; import { Document, HeadingLevel, LineNumberRestartFormat, Packer, Paragraph } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
doc.addSection({ {
properties: { properties: {
lineNumberCountBy: 1, lineNumbers: {
lineNumberRestart: LineNumberRestartFormat.CONTINUOUS, countBy: 1,
}, restart: LineNumberRestartFormat.CONTINUOUS,
children: [ },
new Paragraph({ },
text: "Hello", children: [
heading: HeadingLevel.HEADING_1, new Paragraph({
}), text: "Hello",
new Paragraph( heading: HeadingLevel.HEADING_1,
"Himenaeos duis luctus nullam fermentum lobortis potenti vivamus non dis, sed facilisis ultricies scelerisque aenean risus hac senectus. Adipiscing id venenatis justo ante gravida placerat, ac curabitur dis pellentesque proin bibendum risus, aliquam porta taciti vulputate primis. Tortor ipsum fermentum quam vel convallis primis nisl praesent tincidunt, lobortis quisque felis vitae condimentum class ut sem nam, aenean potenti pretium ac amet lacinia himenaeos mi. Aliquam nisl turpis hendrerit est morbi malesuada, augue interdum mus inceptos curabitur tristique, parturient feugiat sodales nulla facilisi. Aliquam non pulvinar purus nulla ex integer, velit faucibus vitae at bibendum quam, risus elit aenean adipiscing posuere.", }),
), new Paragraph(
new Paragraph( "Himenaeos duis luctus nullam fermentum lobortis potenti vivamus non dis, sed facilisis ultricies scelerisque aenean risus hac senectus. Adipiscing id venenatis justo ante gravida placerat, ac curabitur dis pellentesque proin bibendum risus, aliquam porta taciti vulputate primis. Tortor ipsum fermentum quam vel convallis primis nisl praesent tincidunt, lobortis quisque felis vitae condimentum class ut sem nam, aenean potenti pretium ac amet lacinia himenaeos mi. Aliquam nisl turpis hendrerit est morbi malesuada, augue interdum mus inceptos curabitur tristique, parturient feugiat sodales nulla facilisi. Aliquam non pulvinar purus nulla ex integer, velit faucibus vitae at bibendum quam, risus elit aenean adipiscing posuere.",
"Sed laoreet id mattis egestas nam mollis elit lacinia convallis dui tincidunt ultricies habitant, pharetra per maximus interdum neque tempor risus efficitur morbi imperdiet senectus. Lectus laoreet senectus finibus inceptos donec potenti fermentum, ultrices eleifend odio suscipit magnis tellus maximus nibh, ac sit nullam eget felis himenaeos. Diam class sem magnis aenean commodo faucibus id proin mi, nullam sodales nec mus parturient ornare ad inceptos velit hendrerit, bibendum placerat eleifend integer facilisis urna dictumst suspendisse.", ),
), new Paragraph(
"Sed laoreet id mattis egestas nam mollis elit lacinia convallis dui tincidunt ultricies habitant, pharetra per maximus interdum neque tempor risus efficitur morbi imperdiet senectus. Lectus laoreet senectus finibus inceptos donec potenti fermentum, ultrices eleifend odio suscipit magnis tellus maximus nibh, ac sit nullam eget felis himenaeos. Diam class sem magnis aenean commodo faucibus id proin mi, nullam sodales nec mus parturient ornare ad inceptos velit hendrerit, bibendum placerat eleifend integer facilisis urna dictumst suspendisse.",
),
],
},
], ],
}); });

View File

@ -3,8 +3,6 @@
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; import { Document, Packer, Paragraph, Table, TableCell, TableRow } from "../build";
const doc = new Document();
const table = new Table({ const table = new Table({
rows: [ rows: [
new TableRow({ new TableRow({
@ -252,8 +250,12 @@ const table2 = new Table({
], ],
}); });
doc.addSection({ const doc = new Document({
children: [table, new Paragraph(""), table2], sections: [
{
children: [table, new Paragraph(""), table2],
},
],
}); });
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {

View File

@ -0,0 +1,93 @@
// Page numbers - Start from 0 on a new section
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { AlignmentType, Document, Header, Packer, PageBreak, PageNumber, PageNumberSeparator, Paragraph, TextRun } from "../build";
const doc = new Document({
sections: [
{
headers: {
default: new Header({
children: [
new Paragraph({
alignment: AlignmentType.RIGHT,
children: [
new TextRun("My Title "),
new TextRun({
children: ["Page ", PageNumber.CURRENT],
}),
],
}),
],
}),
first: new Header({
children: [
new Paragraph({
alignment: AlignmentType.RIGHT,
children: [
new TextRun("First Page Header "),
new TextRun({
children: ["Page ", PageNumber.CURRENT],
}),
],
}),
],
}),
},
children: [
new Paragraph({
children: [new TextRun("First Page"), new PageBreak()],
}),
new Paragraph("Second Page"),
],
},
{
properties: {
page: {
pageNumbers: {
start: 1,
separator: PageNumberSeparator.EM_DASH,
},
},
},
headers: {
default: new Header({
children: [
new Paragraph({
alignment: AlignmentType.RIGHT,
children: [
new TextRun("My Title "),
new TextRun({
children: ["Page ", PageNumber.CURRENT],
}),
],
}),
],
}),
first: new Header({
children: [
new Paragraph({
alignment: AlignmentType.RIGHT,
children: [
new TextRun("First Page Header of Second section"),
new TextRun({
children: ["Page ", PageNumber.CURRENT],
}),
],
}),
],
}),
},
children: [
new Paragraph({
children: [new TextRun("Third Page"), new PageBreak()],
}),
new Paragraph("Fourth Page"),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -3,8 +3,6 @@
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; import { Document, Packer, Paragraph, Table, TableCell, TableRow } from "../build";
const doc = new Document();
const table = new Table({ const table = new Table({
rows: [ rows: [
new TableRow({ new TableRow({
@ -75,8 +73,12 @@ const table = new Table({
], ],
}); });
doc.addSection({ const doc = new Document({
children: [table], sections: [
{
children: [table],
},
],
}); });
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {

View File

@ -3,35 +3,51 @@
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph } from "../build"; import { Document, Packer, Paragraph } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
doc.addSection({ {
properties: { properties: {
column: { column: {
space: 708, space: 708,
count: 2, count: 2,
},
},
children: [
new Paragraph("This text will be split into 2 columns on a page."),
new Paragraph(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
),
],
}, },
}, {
children: [ properties: {
new Paragraph("This text will be split into 2 columns on a page."), column: {
new Paragraph( space: 708,
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.", count: 3,
), },
], },
}); children: [
new Paragraph("This text will be split into 3 columns on a page."),
doc.addSection({ new Paragraph(
properties: { "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
column: { ),
space: 708, ],
count: 3, },
{
properties: {
column: {
space: 708,
count: 2,
separate: true,
},
},
children: [
new Paragraph("This text will be split into 2 columns on a page."),
new Paragraph(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
),
],
}, },
},
children: [
new Paragraph("This text will be split into 3 columns on a page."),
new Paragraph(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
),
], ],
}); });

View File

@ -3,31 +3,33 @@
import * as fs from "fs"; import * as fs from "fs";
import { AlignmentType, Document, Header, Packer, Paragraph, TextRun } from "../build"; import { AlignmentType, Document, Header, Packer, Paragraph, TextRun } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
doc.addSection({ {
headers: { headers: {
default: new Header({ default: new Header({
children: [
new Paragraph({
alignment: AlignmentType.RIGHT,
children: [ children: [
new TextRun({ new Paragraph({
text: "Hello World", alignment: AlignmentType.RIGHT,
color: "red", children: [
bold: true, new TextRun({
size: 24, text: "Hello World",
font: { color: "FF0000",
name: "Garamond", bold: true,
}, size: 24,
highlight: "yellow", font: {
name: "Garamond",
},
highlight: "yellow",
}),
],
}), }),
], ],
}), }),
], },
}), children: [],
}, },
children: [], ],
}); });
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {

View File

@ -3,35 +3,62 @@
import * as fs from "fs"; import * as fs from "fs";
import { AlignmentType, Document, Header, Packer, Paragraph, ShadingType, TextRun } from "../build"; import { AlignmentType, Document, Header, Packer, Paragraph, ShadingType, TextRun } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
doc.addSection({ {
headers: { headers: {
default: new Header({ default: new Header({
children: [
new Paragraph({
alignment: AlignmentType.RIGHT,
children: [ children: [
new TextRun({ new Paragraph({
text: "Hello World", alignment: AlignmentType.RIGHT,
color: "red", children: [
bold: true, new TextRun({
size: 24, text: "Hello World",
font: { color: "FF0000",
name: "Garamond", bold: true,
}, size: 24,
font: {
name: "Garamond",
},
shading: {
type: ShadingType.REVERSE_DIAGONAL_STRIPE,
color: "00FFFF",
fill: "FF0000",
},
}),
],
}),
new Paragraph({
shading: { shading: {
type: ShadingType.REVERSE_DIAGONAL_STRIPE, type: ShadingType.DIAGONAL_CROSS,
color: "00FFFF", color: "00FFFF",
fill: "FF0000", fill: "FF0000",
}, },
children: [
new TextRun({
text: "Hello World for entire paragraph",
}),
],
}),
],
}),
},
children: [
new Paragraph({
children: [
new TextRun({
emboss: true,
text: "Embossed text - hello world",
}),
new TextRun({
imprint: true,
text: "Imprinted text - hello world",
}), }),
], ],
}), }),
], ],
}), },
}, ],
children: [],
}); });
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {

View File

@ -1,9 +1,7 @@
// Multiple sections with total number of pages in each section // Multiple sections with total number of pages in each section
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, PageNumberFormat, Paragraph, TextRun } from "../build"; import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, NumberFormat, Paragraph, TextRun } from "../build";
const doc = new Document();
const header = new Header({ const header = new Header({
children: [ children: [
@ -26,39 +24,50 @@ const footer = new Footer({
children: [new Paragraph("Foo Bar corp. ")], children: [new Paragraph("Foo Bar corp. ")],
}); });
doc.addSection({ const doc = new Document({
headers: { sections: [
default: header, {
}, properties: {
footers: { page: {
default: footer, pageNumbers: {
}, start: 1,
properties: { formatType: NumberFormat.DECIMAL,
pageNumberStart: 1, },
pageNumberFormatType: PageNumberFormat.DECIMAL, },
}, },
children: [ headers: {
new Paragraph({ default: header,
children: [new TextRun("Section 1"), new PageBreak(), new TextRun("Section 1"), new PageBreak()], },
}), footers: {
], default: footer,
}); },
children: [
doc.addSection({ new Paragraph({
headers: { children: [new TextRun("Section 1"), new PageBreak(), new TextRun("Section 1"), new PageBreak()],
default: header, }),
}, ],
footers: { },
default: footer, {
}, properties: {
properties: { page: {
pageNumberStart: 1, pageNumbers: {
pageNumberFormatType: PageNumberFormat.DECIMAL, start: 1,
}, formatType: NumberFormat.DECIMAL,
children: [ },
new Paragraph({ },
children: [new TextRun("Section 2"), new PageBreak(), new TextRun("Section 2"), new PageBreak()], },
}), headers: {
default: header,
},
footers: {
default: footer,
},
children: [
new Paragraph({
children: [new TextRun("Section 2"), new PageBreak(), new TextRun("Section 2"), new PageBreak()],
}),
],
},
], ],
}); });

View File

@ -1,28 +1,30 @@
// Example of making content of section vertically aligned // Example of making content of section vertically aligned
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph, SectionVerticalAlignValue, TextRun } from "../build"; import { Document, Packer, Paragraph, VerticalAlign, TextRun } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
doc.addSection({ {
properties: { properties: {
verticalAlign: SectionVerticalAlignValue.CENTER, verticalAlign: VerticalAlign.CENTER,
}, },
children: [
new Paragraph({
children: [ children: [
new TextRun("Hello World"), new Paragraph({
new TextRun({ children: [
text: "Foo Bar", new TextRun("Hello World"),
bold: true, new TextRun({
}), text: "Foo Bar",
new TextRun({ bold: true,
text: "\tGithub is the best", }),
bold: true, new TextRun({
text: "\tGithub is the best",
bold: true,
}),
],
}), }),
], ],
}), },
], ],
}); });

View File

@ -1,15 +1,47 @@
// Add custom borders to the table itself // Add custom borders and no-borders to the table itself
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { BorderStyle, Document, Packer, Paragraph, Table, TableCell, TableRow } from "../build"; import {
BorderStyle,
const doc = new Document(); Document,
HeadingLevel,
Packer,
Paragraph,
Table,
TableBorders,
TableCell,
TableRow,
TextDirection,
VerticalAlign,
} from "../build";
const table = new Table({ const table = new Table({
rows: [ rows: [
new TableRow({ new TableRow({
children: [ children: [
new TableCell({ new TableCell({
borders: {
top: {
style: BorderStyle.DASH_SMALL_GAP,
size: 1,
color: "ff0000",
},
bottom: {
style: BorderStyle.DASH_SMALL_GAP,
size: 1,
color: "ff0000",
},
left: {
style: BorderStyle.DASH_SMALL_GAP,
size: 1,
color: "ff0000",
},
right: {
style: BorderStyle.DASH_SMALL_GAP,
size: 1,
color: "ff0000",
},
},
children: [new Paragraph("Hello")], children: [new Paragraph("Hello")],
}), }),
new TableCell({ new TableCell({
@ -30,7 +62,105 @@ const table = new Table({
], ],
}); });
doc.addSection({ children: [table] }); // Using the no-border convenience object. It is the same as writing this manually:
// const borders = {
// top: {
// style: BorderStyle.NONE,
// size: 0,
// color: "auto",
// },
// bottom: {
// style: BorderStyle.NONE,
// size: 0,
// color: "auto",
// },
// left: {
// style: BorderStyle.NONE,
// size: 0,
// color: "auto",
// },
// right: {
// style: BorderStyle.NONE,
// size: 0,
// color: "auto",
// },
// insideHorizontal: {
// style: BorderStyle.NONE,
// size: 0,
// color: "auto",
// },
// insideVertical: {
// style: BorderStyle.NONE,
// size: 0,
// color: "auto",
// },
// };
const noBorderTable = new Table({
borders: TableBorders.NONE,
rows: [
new TableRow({
children: [
new TableCell({
children: [new Paragraph({}), new Paragraph({})],
verticalAlign: VerticalAlign.CENTER,
}),
new TableCell({
children: [new Paragraph({}), new Paragraph({})],
verticalAlign: VerticalAlign.CENTER,
}),
new TableCell({
children: [new Paragraph({ text: "bottom to top" }), new Paragraph({})],
textDirection: TextDirection.BOTTOM_TO_TOP_LEFT_TO_RIGHT,
}),
new TableCell({
children: [new Paragraph({ text: "top to bottom" }), new Paragraph({})],
textDirection: TextDirection.TOP_TO_BOTTOM_RIGHT_TO_LEFT,
}),
],
}),
new TableRow({
children: [
new TableCell({
children: [
new Paragraph({
text:
"Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah",
heading: HeadingLevel.HEADING_1,
}),
],
}),
new TableCell({
children: [
new Paragraph({
text: "This text should be in the middle of the cell",
}),
],
verticalAlign: VerticalAlign.CENTER,
}),
new TableCell({
children: [
new Paragraph({
text: "Text above should be vertical from bottom to top",
}),
],
verticalAlign: VerticalAlign.CENTER,
}),
new TableCell({
children: [
new Paragraph({
text: "Text above should be vertical from top to bottom",
}),
],
verticalAlign: VerticalAlign.CENTER,
}),
],
}),
],
});
const doc = new Document({
sections: [{ children: [table, new Paragraph("Hello"), noBorderTable] }],
});
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer); fs.writeFileSync("My Document.docx", buffer);

View File

@ -1,59 +1,133 @@
// Example of how to add images to the document - You can use Buffers, UInt8Arrays or Base64 strings // Example of how to add images to the document - You can use Buffers, UInt8Arrays or Base64 strings
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
// import { Document, Packer, Paragraph } from "../build";
import { import {
Document, Document,
HorizontalPositionAlign, HorizontalPositionAlign,
HorizontalPositionRelativeFrom, HorizontalPositionRelativeFrom,
Media, ImageRun,
Packer, Packer,
Paragraph, Paragraph,
VerticalPositionAlign, VerticalPositionAlign,
VerticalPositionRelativeFrom, VerticalPositionRelativeFrom,
} from "../build"; } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
const image1 = Media.addImage(doc, fs.readFileSync("./demo/images/image1.jpeg")); {
const image2 = Media.addImage(doc, fs.readFileSync("./demo/images/dog.png").toString("base64")); children: [
const image3 = Media.addImage(doc, fs.readFileSync("./demo/images/cat.jpg")); new Paragraph("Hello World"),
const image4 = Media.addImage(doc, fs.readFileSync("./demo/images/parrots.bmp")); new Paragraph({
const image5 = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif")); children: [
const image6 = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"), 200, 200, { new ImageRun({
floating: { data: fs.readFileSync("./demo/images/image1.jpeg"),
horizontalPosition: { transformation: {
offset: 1014400, width: 100,
height: 100,
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/dog.png").toString("base64"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/cat.jpg"),
transformation: {
width: 100,
height: 100,
flip: {
vertical: true,
},
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/parrots.bmp"),
transformation: {
width: 150,
height: 150,
flip: {
horizontal: true,
},
rotation: 225,
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 200,
height: 200,
flip: {
horizontal: true,
vertical: true,
},
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 200,
height: 200,
rotation: 45,
},
floating: {
zIndex: 10,
horizontalPosition: {
offset: 1014400,
},
verticalPosition: {
offset: 1014400,
},
},
}),
],
}),
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/cat.jpg"),
transformation: {
width: 200,
height: 200,
},
floating: {
zIndex: 5,
horizontalPosition: {
relative: HorizontalPositionRelativeFrom.PAGE,
align: HorizontalPositionAlign.RIGHT,
},
verticalPosition: {
relative: VerticalPositionRelativeFrom.PAGE,
align: VerticalPositionAlign.BOTTOM,
},
},
}),
],
}),
],
}, },
verticalPosition: {
offset: 1014400,
},
},
});
const image7 = Media.addImage(doc, fs.readFileSync("./demo/images/cat.jpg"), 200, 200, {
floating: {
horizontalPosition: {
relative: HorizontalPositionRelativeFrom.PAGE,
align: HorizontalPositionAlign.RIGHT,
},
verticalPosition: {
relative: VerticalPositionRelativeFrom.PAGE,
align: VerticalPositionAlign.BOTTOM,
},
},
});
doc.addSection({
children: [
new Paragraph("Hello World"),
new Paragraph(image1),
new Paragraph(image2),
new Paragraph(image3),
new Paragraph(image4),
new Paragraph(image5),
new Paragraph(image6),
new Paragraph(image7),
], ],
}); });

View File

@ -1,19 +1,26 @@
// Simple example to add text to a document // The demo on the README.md
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, HeadingLevel, Media, Packer, Paragraph, Table, TableCell, TableRow, VerticalAlign } from "../build"; import { Document, HeadingLevel, ImageRun, Packer, Paragraph, Table, TableCell, TableRow, VerticalAlign } from "../build";
const doc = new Document();
const image1 = Media.addImage(doc, fs.readFileSync("./demo/images/image1.jpeg"));
const image2 = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"));
const table = new Table({ const table = new Table({
rows: [ rows: [
new TableRow({ new TableRow({
children: [ children: [
new TableCell({ new TableCell({
children: [new Paragraph(image1)], children: [
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/image1.jpeg"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
],
verticalAlign: VerticalAlign.CENTER, verticalAlign: VerticalAlign.CENTER,
}), }),
new TableCell({ new TableCell({
@ -38,21 +45,47 @@ const table = new Table({
], ],
}), }),
new TableCell({ new TableCell({
children: [new Paragraph(image1)], children: [
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/image1.jpeg"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
],
}), }),
], ],
}), }),
], ],
}); });
doc.addSection({ const doc = new Document({
children: [ sections: [
new Paragraph({ {
text: "Hello World", children: [
heading: HeadingLevel.HEADING_1, new Paragraph({
}), text: "Hello World",
table, heading: HeadingLevel.HEADING_1,
new Paragraph(image2), }),
table,
new Paragraph({
children: [
new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
],
},
], ],
}); });

View File

@ -15,20 +15,41 @@ const doc = new Document({
italics: true, italics: true,
}, },
}, },
{
id: "strong",
name: "Strong",
basedOn: "Normal",
run: {
bold: true,
},
},
], ],
}, },
}); sections: [
{
doc.addSection({
children: [
new Paragraph({
children: [ children: [
new TextRun({ new Paragraph({
text: "Foo bar", children: [
style: "myRedStyle", new TextRun({
text: "Foo bar",
style: "myRedStyle",
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: "First Word",
style: "strong",
}),
new TextRun({
text:
" - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
}),
],
}), }),
], ],
}), },
], ],
}); });

View File

@ -18,17 +18,18 @@ const doc = new Document({
}, },
], ],
}, },
}); sections: [
{
doc.addSection({ children: [
children: [ new Paragraph({
new Paragraph({ text: "KFCを食べるのが好き",
text: "KFCを食べるのが好き", heading: HeadingLevel.HEADING_1,
heading: HeadingLevel.HEADING_1, }),
}), new Paragraph({
new Paragraph({ text: "こんにちは",
text: "こんにちは", }),
}), ],
},
], ],
}); });

View File

@ -11,6 +11,18 @@ import { Document, HeadingLevel, Packer, Paragraph, TextRun } from "../build";
const doc = new Document({ const doc = new Document({
styles: { styles: {
default: {
document: {
run: {
font: {
ascii: "minorHAnsi",
eastAsia: "minorEastAsia",
cs: "minorBidi",
hAnsi: "minorHAnsi",
},
},
},
},
paragraphStyles: [ paragraphStyles: [
{ {
id: "Normal", id: "Normal",
@ -20,33 +32,57 @@ const doc = new Document({
quickFormat: true, quickFormat: true,
run: { run: {
font: { font: {
ascii: "Times", ascii: "minorHAnsi", // Can also use minorHAnsi
eastAsia: "KaiTi", eastAsia: "minorEastAsia", // Can also use minorEastAsia
cs: "minorBidi",
hAnsi: "minorHAnsi",
}, },
}, },
}, },
], ],
}, },
}); sections: [
{
doc.addSection({
children: [
new Paragraph({
text: "中文和英文 Chinese and English",
heading: HeadingLevel.HEADING_1,
}),
new Paragraph({
text: "中文和英文 Chinese and English",
}),
new Paragraph({
children: [ children: [
new TextRun({ new Paragraph({
text: "中文和英文 Chinese and English", text: "中文和英文 Chinese and English",
font: { eastAsia: "SimSun" }, // set eastAsia to "SimSun". heading: HeadingLevel.HEADING_1,
// The ascii characters will use the default font ("Times") specified in paragraphStyles }),
new Paragraph({
text: "中文和英文 Chinese and English",
}),
new Paragraph({
children: [
new TextRun({
text: "中文和英文 Chinese and English",
font: { eastAsia: "SimSun" }, // set eastAsia to "SimSun".
// The ascii characters will use the default font ("Times") specified in paragraphStyles
}),
],
}),
new Paragraph({
text: `店様付旅母正役基社発破班。発治治京岡局本因追意金紀統責郵滴尽。立功日庁重天富評界明済不着法返祉経正引行。載区列防新目治日群付無人道言越名。界安無死専体風木人教録覧訃。女問堂容県作先芸便効証帯債土全極的日。能山中岡仕関攻井季接店線幌温後率事阜止。成間路行究今式歌像祉帯式媛読徹。安行息古入出文侵監株登部席内文第珍鶴問用。
編竹入俳多応日氏陸福芸北供動。情績拠僧肺軍油能認郷翌南対韓短東食束兵晶。政予任習口佐所当止市告号。悩申無式立医毎部観潟訴菱権。発臼背郎上予配光記芸注然出。梨場株以政囲下球品材県動政押婚面見。米共試使落帳遅毅間三子開。問与大八地芸第線体架辺今死。押構草齢戦重最変社豪記目盗連報準周込。系貸劇様重鷲始能質村異社学動導勤。
残様的荻仲刺局標績供質球就雄。考和母問者役尊紙推新経革個事編安観。益学北日著楽車山勢流泉四犯投台戒設対臨百。危謄初治穴委済本索労刊回。月写政覧女事棋違年終索情響白子泉転企堀社。江遊著西高開面毎分芸責成創査全判調目止懇。原育会夏作売望人転乱融抜心。制川供健水示囲阜厚高右断季人役。持面必日暮気管像冬間影図健行格阪。
来入工速会健評下町慮大貸社一見園外申憶。服豊舞入面沢交使奥見記写意岩。北観提女刊液城共五擦相売田合是由読。回歳売苦定記点郎意増賛治北渡本応。受送文携村陸情静了申注際。順負子研済老上変女産第内無費携投展達。東初乗回動合語学待聴暮沢流全場導敷記賞次。更物中備著後渡売第部時禁新田木下昨。備護起織服久権意全海馬適応。
幸速団供地信討川安矛場消学年。去茂玉東今要出約元教負限載始今簡。編掲証的情仕渡室手映法部始。紙反語清阪曜税受知選謝個印観聞。教人超死準無者参生撤技真価椿景破市見国。左需臓道力趣暮際丁高会近部敗岡力当社。壊態毒期波超長写島断兆国世行共絞私報。反野番点図択女撃脱案情王援。減属考論月院催者門料約覧市戦。
山部午金査投立集争教殺巣作世動北部応。通負考隙問粛中帯閉要程規化小。橋棋互界時引就現省竹去子無系容米。竹転起日本新田強済購書区庁集作容同会窓教。文公神転待究挙登投川選囲針能楽路断出歌。祥新現寄公史真玉属元始員金抜関前百衝能。国眺暮囲世嘘面外営国内報夜九掲事春葉。来月刊台先良理著自供法投。通渡請当月学安首一押実展介況。
法優分独込右得里記域目順供進乗。憂婚転峰大写医投社曲題任能務熱県展覧港専。栄余歯真著改追事作果石芸。青感将南便再転領鈴投提鉄索競虎師体物想。牲打迎達携度開技書催掲安去変念座。革混疑生採就枢当住回県組北意寛。爆新和級掲交象温十賛展木開有結日。新海辺小除京物興量写界裁上。文師建関面取質也底沼画者図空医心無季。
高館湯転名気業以際置講詰方活礎組調軽際。発変東作訪乃小化理利提目気。極季本問号面帯勤戦行新禁情堀郎携。座所転再祥業必変昌今歩佐王立抗後養崩。支物猪躍芸整縦焦供防続相護治時語朝分刊定。綿田幸崎責本欲間載神調崎答志政報与速美載。飯治止稿原先明画森群進見情幕。女民館終調質並伝車慌供科。支田国傷自動献疑討医足公成公主断的望。
責開児食福実帰治師今策今。水重寺圧医観送連東者秒途。選央力律式開作掲写様階組戦写型紙。式国販時天遣国出難共前次領体康稲住転。査見保重議原速群者内月正連。爾天膨装芸別巨平運数準三浜念載創県奈飛提。素京発揮田談気党示見象定電類代級。善返跡国有話権入猛府週亡辞馬脳。関残主祐雪塚去集村完海関文受載表川護照立。
発闘美慎健育旅布容広互無秋認天歌媛芸。転器合読県増認会賞倒点系。食気母服絵知去祝芸車報熱勝。能貿月更障文的欠賞現覇声敏施会。懲病写昼法族業律記聡生開緊楽暮護。東地二員者説盟治害討面提。第北乗査庭年近的禁疑報方店記必迷都流通。聞有力前愛院梨野関業前訳本清滋補。蒲読火死勝広保会婚際気二由保国。用君込村需起相点選紙拡氏訃不。`,
}), }),
], ],
}), },
], ],
}); });

View File

@ -0,0 +1,27 @@
// Custom Properties
// Custom properties are incredibly useful if you want to be able to apply quick parts or custom cover pages
// to the document in Word after the document has been generated. Standard properties (such as creator, title
// and subject) cover typical use cases, but sometimes custom properties are required.
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Packer } from "../build";
const doc = new Document(
// Standard properties
{
creator: "Creator",
title: "Title",
subject: "Subject",
description: "Description",
customProperties: [
{ name: "Subtitle", value: "Subtitle" },
{ name: "Address", value: "Address" },
],
sections: [],
},
);
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

296
demo/55-math.ts Normal file
View File

@ -0,0 +1,296 @@
// Simple example to add text to a document
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import {
Document,
Math,
MathAngledBrackets,
MathCurlyBrackets,
MathFraction,
MathFunction,
MathPreSubSuperScript,
MathRadical,
MathRoundBrackets,
MathRun,
MathSquareBrackets,
MathSubScript,
MathSubSuperScript,
MathSum,
MathSuperScript,
Packer,
Paragraph,
TextRun,
} from "../build";
const doc = new Document({
sections: [
{
properties: {},
children: [
new Paragraph({
children: [
new Math({
children: [
new MathRun("2+2"),
new MathFraction({
numerator: [new MathRun("hi")],
denominator: [new MathRun("2")],
}),
],
}),
new TextRun({
text: "Foo Bar",
bold: true,
}),
],
}),
new Paragraph({
children: [
new Math({
children: [
new MathFraction({
numerator: [
new MathRun("1"),
new MathRadical({
children: [new MathRun("2")],
}),
],
denominator: [new MathRun("2")],
}),
],
}),
],
}),
new Paragraph({
children: [
new Math({
children: [
new MathSum({
children: [new MathRun("test")],
}),
new MathSum({
children: [
new MathSuperScript({
children: [new MathRun("e")],
superScript: [new MathRun("2")],
}),
],
subScript: [new MathRun("i")],
}),
new MathSum({
children: [
new MathRadical({
children: [new MathRun("i")],
}),
],
subScript: [new MathRun("i")],
superScript: [new MathRun("10")],
}),
],
}),
],
}),
new Paragraph({
children: [
new Math({
children: [
new MathSuperScript({
children: [new MathRun("test")],
superScript: [new MathRun("hello")],
}),
],
}),
],
}),
new Paragraph({
children: [
new Math({
children: [
new MathSubScript({
children: [new MathRun("test")],
subScript: [new MathRun("hello")],
}),
],
}),
],
}),
new Paragraph({
children: [
new Math({
children: [
new MathSubScript({
children: [new MathRun("x")],
subScript: [
new MathSuperScript({
children: [new MathRun("y")],
superScript: [new MathRun("2")],
}),
],
}),
],
}),
],
}),
new Paragraph({
children: [
new Math({
children: [
new MathSubSuperScript({
children: [new MathRun("test")],
superScript: [new MathRun("hello")],
subScript: [new MathRun("world")],
}),
],
}),
],
}),
new Paragraph({
children: [
new Math({
children: [
new MathPreSubSuperScript({
children: [new MathRun("test")],
superScript: [new MathRun("hello")],
subScript: [new MathRun("world")],
}),
],
}),
],
}),
new Paragraph({
children: [
new Math({
children: [
new MathSubScript({
children: [
new MathFraction({
numerator: [new MathRun("1")],
denominator: [new MathRun("2")],
}),
],
subScript: [new MathRun("4")],
}),
],
}),
],
}),
new Paragraph({
children: [
new Math({
children: [
new MathSubScript({
children: [
new MathRadical({
children: [
new MathFraction({
numerator: [new MathRun("1")],
denominator: [new MathRun("2")],
}),
],
degree: [new MathRun("4")],
}),
],
subScript: [new MathRun("x")],
}),
],
}),
],
}),
new Paragraph({
children: [
new Math({
children: [
new MathRadical({
children: [new MathRun("4")],
}),
],
}),
],
}),
new Paragraph({
children: [
new Math({
children: [
new MathFunction({
name: [
new MathSuperScript({
children: [new MathRun("cos")],
superScript: [new MathRun("-1")],
}),
],
children: [new MathRun("100")],
}),
new MathRun("×"),
new MathFunction({
name: [new MathRun("sin")],
children: [new MathRun("360")],
}),
new MathRun("= x"),
],
}),
],
}),
new Paragraph({
children: [
new Math({
children: [
new MathRoundBrackets({
children: [
new MathFraction({
numerator: [new MathRun("1")],
denominator: [new MathRun("2")],
}),
],
}),
new MathSquareBrackets({
children: [
new MathFraction({
numerator: [new MathRun("1")],
denominator: [new MathRun("2")],
}),
],
}),
new MathCurlyBrackets({
children: [
new MathFraction({
numerator: [new MathRun("1")],
denominator: [new MathRun("2")],
}),
],
}),
new MathAngledBrackets({
children: [
new MathFraction({
numerator: [new MathRun("1")],
denominator: [new MathRun("2")],
}),
],
}),
],
}),
],
}),
new Paragraph({
children: [
new Math({
children: [
new MathFraction({
numerator: [
new MathRadical({
children: [new MathRun("4")],
}),
],
denominator: [new MathRun("2a")],
}),
],
}),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,34 @@
// Change background colour of whole document
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun } from "../build";
const doc = new Document({
background: {
color: "C45911",
},
sections: [
{
properties: {},
children: [
new Paragraph({
children: [
new TextRun("Hello World"),
new TextRun({
text: "Foo Bar",
bold: true,
}),
new TextRun({
text: "\tGithub is the best",
bold: true,
}),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,89 @@
// Numbered lists - Add parent number in sub number
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, LevelFormat, Packer, Paragraph } from "../build";
const doc = new Document({
numbering: {
config: [
{
levels: [
{
level: 0,
format: LevelFormat.DECIMAL,
text: "%1",
alignment: AlignmentType.START,
style: {
paragraph: {
indent: { left: convertInchesToTwip(0.5), hanging: 260 },
},
},
},
{
level: 1,
format: LevelFormat.DECIMAL,
text: "%1.%2",
alignment: AlignmentType.START,
style: {
paragraph: {
indent: { left: 1.25 * convertInchesToTwip(0.5), hanging: 1.25 * 260 },
},
run: {
bold: true,
size: 18,
font: "Times New Roman",
},
},
},
],
reference: "my-number-numbering-reference",
},
],
},
sections: [
{
children: [
new Paragraph({
text: "How to make cake",
heading: HeadingLevel.HEADING_1,
}),
new Paragraph({
text: "Step 1 - Add sugar",
numbering: {
reference: "my-number-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "Step 2 - Add wheat",
numbering: {
reference: "my-number-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "Step 2a - Stir the wheat in a circle",
numbering: {
reference: "my-number-numbering-reference",
level: 1,
},
}),
new Paragraph({
text: "Step 3 - Put in oven",
numbering: {
reference: "my-number-numbering-reference",
level: 0,
},
}),
new Paragraph({
text: "How to make cake",
heading: HeadingLevel.HEADING_1,
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

91
demo/58-section-types.ts Normal file
View File

@ -0,0 +1,91 @@
// Usage of different Section Types
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun, SectionType } from "../build";
const doc = new Document({
sections: [
{
properties: {},
children: [
new Paragraph({
children: [
new TextRun("Hello World"),
new TextRun({
text: "Foo Bar",
bold: true,
}),
],
}),
],
},
{
properties: {
type: SectionType.CONTINUOUS,
},
children: [
new Paragraph({
children: [
new TextRun("Hello World"),
new TextRun({
text: "Foo Bar",
bold: true,
}),
],
}),
],
},
{
properties: {
type: SectionType.ODD_PAGE,
},
children: [
new Paragraph({
children: [
new TextRun("Hello World"),
new TextRun({
text: "Foo Bar",
bold: true,
}),
],
}),
],
},
{
properties: {
type: SectionType.EVEN_PAGE,
},
children: [
new Paragraph({
children: [
new TextRun("Hello World"),
new TextRun({
text: "Foo Bar",
bold: true,
}),
],
}),
],
},
{
properties: {
type: SectionType.NEXT_PAGE,
},
children: [
new Paragraph({
children: [
new TextRun("Hello World"),
new TextRun({
text: "Foo Bar",
bold: true,
}),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,54 @@
// Move + offset header and footer
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Footer, Header, Packer, Paragraph } from "../build";
const doc = new Document({
sections: [
{
properties: {
page: {
margin: {
header: 100,
footer: 50,
},
},
},
headers: {
default: new Header({
children: [
new Paragraph({
text: "Header text",
indent: {
left: -400,
},
}),
new Paragraph({
text: "Some more header text",
indent: {
left: -600,
},
}),
],
}),
},
footers: {
default: new Footer({
children: [
new Paragraph({
text: "Footer text",
indent: {
left: -400,
},
}),
],
}),
},
children: [new Paragraph("Hello World")],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -3,35 +3,41 @@
import * as fs from "fs"; import * as fs from "fs";
import { Document, HeadingLevel, Packer, Paragraph, TextRun } from "../build"; import { Document, HeadingLevel, Packer, Paragraph, TextRun } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
doc.addSection({ {
margins: { properties: {
top: 0, page: {
right: 0, margin: {
bottom: 0, top: 0,
left: 0, right: 0,
}, bottom: 0,
children: [ left: 0,
new Paragraph({ },
},
},
children: [ children: [
new TextRun("Hello World"), new Paragraph({
new TextRun({ children: [
text: "Foo bar", new TextRun("Hello World"),
bold: true, new TextRun({
text: "Foo bar",
bold: true,
}),
new TextRun({
text: "\tGithub is the best",
bold: true,
}),
],
}), }),
new TextRun({ new Paragraph({
text: "\tGithub is the best", text: "Hello World",
bold: true, heading: HeadingLevel.HEADING_1,
}), }),
new Paragraph("Foo bar"),
new Paragraph("Github is the best"),
], ],
}), },
new Paragraph({
text: "Hello World",
heading: HeadingLevel.HEADING_1,
}),
new Paragraph("Foo bar"),
new Paragraph("Github is the best"),
], ],
}); });

153
demo/60-track-revisions.ts Normal file
View File

@ -0,0 +1,153 @@
// Track Revisions aka. "Track Changes"
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import {
AlignmentType,
DeletedTextRun,
Document,
Footer,
FootnoteReferenceRun,
InsertedTextRun,
Packer,
PageNumber,
Paragraph,
ShadingType,
TextRun,
} from "../build";
/*
For reference, see
- https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.wordprocessing.insertedrun
- https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.wordprocessing.deletedrun
The setting `features: { trackRevisions: true }` adds an element `<w:trackRevisions />` to the `settings.xml` file.
This specifies that the application shall track *new* revisions made to the existing document.
See also https://docs.microsoft.com/en-us/dotnet/api/documentformat.openxml.wordprocessing.trackrevisions
Note that this setting enables to track *new changes* after teh file is generated, so this example will still
show inserted and deleted text runs when you remove it.
*/
const paragraph = new Paragraph({
children: [
new TextRun("This is a simple demo "),
new TextRun({
text: "on how to ",
}),
new InsertedTextRun({
text: "mark a text as an insertion ",
id: 0,
author: "Firstname Lastname",
date: "2020-10-06T09:00:00Z",
}),
new DeletedTextRun({
text: "or a deletion.",
id: 1,
author: "Firstname Lastname",
date: "2020-10-06T09:00:00Z",
}),
],
});
const doc = new Document({
footnotes: {
1: {
children: [
new Paragraph({
children: [
new TextRun("This is a footnote"),
new DeletedTextRun({
text: " with some extra text which was deleted",
id: 0,
author: "Firstname Lastname",
date: "2020-10-06T09:05:00Z",
}),
new InsertedTextRun({
text: " and new content",
id: 1,
author: "Firstname Lastname",
date: "2020-10-06T09:05:00Z",
}),
],
}),
],
},
},
features: {
trackRevisions: true,
},
sections: [
{
properties: {},
children: [
paragraph,
new Paragraph({
children: [
new TextRun("This is a demo "),
new DeletedTextRun({
break: 1,
text: "in order",
color: "ff0000",
bold: true,
size: 24,
font: {
name: "Garamond",
},
shading: {
type: ShadingType.REVERSE_DIAGONAL_STRIPE,
color: "00FFFF",
fill: "FF0000",
},
id: 2,
author: "Firstname Lastname",
date: "2020-10-06T09:00:00Z",
}),
new InsertedTextRun({
text: "to show how to ",
bold: false,
id: 3,
author: "Firstname Lastname",
date: "2020-10-06T09:05:00Z",
}),
new TextRun({
bold: true,
children: ["\tuse Inserted and Deleted TextRuns.", new FootnoteReferenceRun(1)],
}),
],
}),
],
footers: {
default: new Footer({
children: [
new Paragraph({
alignment: AlignmentType.CENTER,
children: [
new TextRun("Awesome LLC"),
new TextRun({
children: ["Page Number: ", PageNumber.CURRENT],
}),
new DeletedTextRun({
children: [" to ", PageNumber.TOTAL_PAGES],
id: 4,
author: "Firstname Lastname",
date: "2020-10-06T09:05:00Z",
}),
new InsertedTextRun({
children: [" from ", PageNumber.TOTAL_PAGES],
bold: true,
id: 5,
author: "Firstname Lastname",
date: "2020-10-06T09:05:00Z",
}),
],
}),
],
}),
},
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

82
demo/61-text-frame.ts Normal file
View File

@ -0,0 +1,82 @@
// Text Frame (Text Box) example
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import {
BorderStyle,
Document,
FrameAnchorType,
HorizontalPositionAlign,
Packer,
Paragraph,
TextRun,
VerticalPositionAlign,
} from "../build";
const doc = new Document({
sections: [
{
properties: {},
children: [
new Paragraph({
frame: {
position: {
x: 1000,
y: 3000,
},
width: 4000,
height: 1000,
anchor: {
horizontal: FrameAnchorType.MARGIN,
vertical: FrameAnchorType.MARGIN,
},
alignment: {
x: HorizontalPositionAlign.CENTER,
y: VerticalPositionAlign.TOP,
},
},
border: {
top: {
color: "auto",
space: 1,
style: BorderStyle.SINGLE,
size: 6,
},
bottom: {
color: "auto",
space: 1,
style: BorderStyle.SINGLE,
size: 6,
},
left: {
color: "auto",
space: 1,
style: BorderStyle.SINGLE,
size: 6,
},
right: {
color: "auto",
space: 1,
style: BorderStyle.SINGLE,
size: 6,
},
},
children: [
new TextRun("Hello World"),
new TextRun({
text: "Foo Bar",
bold: true,
}),
new TextRun({
text: "\tGithub is the best",
bold: true,
}),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,36 @@
// Simple example to add text to a document
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, LineRuleType, Packer, Paragraph, TextRun } from "../build";
const doc = new Document({
sections: [
{
properties: {},
children: [
new Paragraph({
spacing: {
after: 5000,
before: 5000,
},
children: [new TextRun("Hello World")],
}),
new Paragraph({
spacing: {
line: 2000,
lineRule: LineRuleType.AUTO,
},
children: [
new TextRun(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed turpis ex, aliquet et faucibus quis, euismod in odio. Fusce gravida tempor nunc sed lacinia. Nulla sed dolor fringilla, fermentum libero ut, egestas ex. Donec pellentesque metus non orci lacinia bibendum. Cras porta ex et mollis hendrerit. Suspendisse id lectus suscipit, elementum lacus eu, convallis felis. Fusce sed bibendum dolor, id posuere ligula. Aliquam eu elit ut urna eleifend vestibulum. Praesent condimentum at turpis sed scelerisque. Suspendisse porttitor metus nec vestibulum egestas. Sed in eros sapien. Morbi efficitur placerat est a consequat. Nunc bibendum porttitor mi nec tempus. Morbi dictum augue porttitor nisi sodales sodales.",
),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,71 @@
// Move + offset header and footer
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Footer, Header, Packer, PageBreak, Paragraph, TextRun } from "../build";
const doc = new Document({
evenAndOddHeaderAndFooters: true,
sections: [
{
headers: {
default: new Header({
children: [
new Paragraph({
text: "Odd Header text",
}),
new Paragraph({
text: "Odd - Some more header text",
}),
],
}),
even: new Header({
children: [
new Paragraph({
text: "Even header text",
}),
new Paragraph({
text: "Even - Some more header text",
}),
],
}),
},
footers: {
default: new Footer({
children: [
new Paragraph({
text: "Odd Footer text",
}),
],
}),
even: new Footer({
children: [
new Paragraph({
text: "Even Cool Footer text",
}),
],
}),
},
children: [
new Paragraph({
children: [new TextRun("Hello World 1"), new PageBreak()],
}),
new Paragraph({
children: [new TextRun("Hello World 2"), new PageBreak()],
}),
new Paragraph({
children: [new TextRun("Hello World 3"), new PageBreak()],
}),
new Paragraph({
children: [new TextRun("Hello World 4"), new PageBreak()],
}),
new Paragraph({
children: [new TextRun("Hello World 5"), new PageBreak()],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,111 @@
// Numbered lists - With complex number text
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Packer, Paragraph, LevelFormat } from "../build";
const doc = new Document({
numbering: {
config: [
{
reference: "ref1",
levels: [
{
level: 0,
format: LevelFormat.DECIMAL,
text: "%1",
},
{
level: 1,
format: LevelFormat.DECIMAL,
text: "%1.%2",
},
{
level: 2,
format: LevelFormat.DECIMAL,
text: "%1.%2.%3",
},
],
},
],
},
sections: [
{
children: [
new Paragraph({
text: "REF1 - lvl:0",
numbering: {
reference: "ref1",
level: 0,
},
}),
new Paragraph({
text: "REF1 - lvl:1",
numbering: {
reference: "ref1",
level: 1,
},
}),
new Paragraph({
text: "REF1 - lvl:2",
numbering: {
reference: "ref1",
level: 2,
},
}),
new Paragraph({
text: "REF1 - lvl:0",
numbering: {
reference: "ref1",
level: 0,
},
}),
new Paragraph({
text: "REF1 - lvl:0",
numbering: {
reference: "ref1",
level: 0,
},
}),
new Paragraph({
text: "REF1 - lvl:0",
numbering: {
reference: "ref1",
level: 0,
},
}),
new Paragraph({
text: "Random text",
}),
new Paragraph({
text: "REF1 - inst:1 - lvl:0",
numbering: {
reference: "ref1",
instance: 1,
level: 0,
},
}),
new Paragraph({
text: "REF1 - inst:0 - lvl:0",
numbering: {
reference: "ref1",
instance: 0,
level: 0,
},
}),
new Paragraph({
text: "REF1 - inst:0 - lvl:0",
numbering: {
reference: "ref1",
instance: 0,
level: 0,
},
}),
],
},
],
});
// Used to export the file into a .docx file
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("6-numbering.docx", buffer);
});

38
demo/65-page-sizes.ts Normal file
View File

@ -0,0 +1,38 @@
// Example of how to set the document page sizes
// Reference from https://papersizes.io/a/a3
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { convertMillimetersToTwip, Document, Packer, PageOrientation, Paragraph } from "../build";
const doc = new Document({
sections: [
{
properties: {
page: {
size: {
orientation: PageOrientation.LANDSCAPE,
height: convertMillimetersToTwip(210),
width: convertMillimetersToTwip(148),
},
},
},
children: [new Paragraph("Hello World")],
},
{
properties: {
page: {
size: {
orientation: PageOrientation.PORTRAIT,
height: convertMillimetersToTwip(420),
width: convertMillimetersToTwip(297),
},
},
},
children: [new Paragraph("Hello World")],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

43
demo/66-fields.ts Normal file
View File

@ -0,0 +1,43 @@
// Use fields to include dynamic text
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Bookmark, Document, Packer, Paragraph, SimpleField, TextRun } from "../build";
const doc = new Document({
creator: 'Me',
sections: [
{
properties: {},
children: [
new Paragraph({
children: [
new TextRun("This document is called "),
new SimpleField("FILENAME", "My Document.docx"),
new TextRun(", was created on "),
new SimpleField('CREATEDATE \\@ "d MMMM yyyy"'),
new TextRun(" by "),
new SimpleField("AUTHOR"),
],
}),
new Paragraph({
children: [
new TextRun("The document has "),
new SimpleField("NUMWORDS", "34"),
new TextRun(" words and if you'd print it "),
new Bookmark({
id: "TimesPrinted",
children: [new TextRun("42")],
}),
new TextRun(" times two-sided, you would need "),
new SimpleField("=INT((TimesPrinted+1)/2)"),
new TextRun(" sheets of paper."),
],
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

28
demo/67-column-break.ts Normal file
View File

@ -0,0 +1,28 @@
// Section with 2 columns including a column break
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Packer, Paragraph, ColumnBreak, TextRun } from "../build";
const doc = new Document({
sections: [
{
properties: {
column: {
space: 708,
count: 2,
},
},
children: [
new Paragraph({ children: [
new TextRun('This text will be in the first column.'),
new ColumnBreak(),
new TextRun('This text will be in the second column.'),
] }),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,88 @@
import * as fs from "fs";
import { Document, Packer, Paragraph, LevelFormat } from "../build";
const doc = new Document({
numbering: {
config: [
{
reference: "ref1",
levels: [
{
level: 0,
format: LevelFormat.DECIMAL,
text: "%1",
start: 10,
},
],
},
{
reference: "ref2",
levels: [
{
level: 0,
format: LevelFormat.DECIMAL,
text: "%1",
},
],
},
],
},
sections: [
{
children: [
new Paragraph({
text: "REF1 - inst:0 - lvl:0",
numbering: {
reference: "ref1",
instance: 0,
level: 0,
},
}),
new Paragraph({
text: "REF1 - inst:0 - lvl:0",
numbering: {
reference: "ref1",
instance: 0,
level: 0,
},
}),
new Paragraph({
text: "REF1 - inst:1 - lvl:0",
numbering: {
reference: "ref1",
instance: 1,
level: 0,
},
}),
new Paragraph({
text: "REF1 - inst:1 - lvl:0",
numbering: {
reference: "ref1",
instance: 1,
level: 0,
},
}),
new Paragraph({
text: "REF2 - inst:0 - lvl:0",
numbering: {
reference: "ref2",
instance: 1,
level: 0,
},
}),
new Paragraph({
text: "REF2 - inst:0 - lvl:0",
numbering: {
reference: "ref2",
instance: 1,
level: 0,
},
}),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -0,0 +1,31 @@
// Sections with multiple columns
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Column, Document, Packer, Paragraph } from "../build";
const doc = new Document({
sections: [
{
properties: {
column: {
count: 2,
space: 720,
equalWidth: false,
children: [new Column({ width: 2880, space: 720 }), new Column({ width: 5760 })],
},
},
children: [
new Paragraph(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
),
new Paragraph(
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -3,13 +3,19 @@
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, PageOrientation, Paragraph } from "../build"; import { Document, Packer, PageOrientation, Paragraph } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
doc.addSection({ {
size: { properties: {
orientation: PageOrientation.LANDSCAPE, page: {
}, size: {
children: [new Paragraph("Hello World")], orientation: PageOrientation.LANDSCAPE,
},
},
},
children: [new Paragraph("Hello World")],
},
],
}); });
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {

View File

@ -0,0 +1,37 @@
// Example demonstrating line numbers with suppression.
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, HeadingLevel, LineNumberRestartFormat, Packer, Paragraph } from "../build";
const doc = new Document({
sections: [
{
properties: {
lineNumbers: {
countBy: 1,
restart: LineNumberRestartFormat.CONTINUOUS,
},
},
children: [
new Paragraph({
text: "Hello",
heading: HeadingLevel.HEADING_1,
}),
new Paragraph(
"Himenaeos duis luctus nullam fermentum lobortis potenti vivamus non dis, sed facilisis ultricies scelerisque aenean risus hac senectus. Adipiscing id venenatis justo ante gravida placerat, ac curabitur dis pellentesque proin bibendum risus, aliquam porta taciti vulputate primis. Tortor ipsum fermentum quam vel convallis primis nisl praesent tincidunt, lobortis quisque felis vitae condimentum class ut sem nam, aenean potenti pretium ac amet lacinia himenaeos mi. Aliquam nisl turpis hendrerit est morbi malesuada, augue interdum mus inceptos curabitur tristique, parturient feugiat sodales nulla facilisi. Aliquam non pulvinar purus nulla ex integer, velit faucibus vitae at bibendum quam, risus elit aenean adipiscing posuere.",
),
new Paragraph({
text: "Enim mollit nostrud ut dolor eiusmod id sit occaecat dolore culpa amet. Veniam dolor consequat dolor labore ullamco laborum dolore eiusmod qui adipisicing. Elit nulla cupidatat et magna. Id eiusmod tempor non laborum ipsum. Veniam et aliqua excepteur duis officia enim elit excepteur fugiat duis. Sit sunt ullamco non dolor est qui deserunt consequat magna. Esse pariatur esse dolor ut excepteur dolor nisi nisi non est cupidatat mollit.",
suppressLineNumbers: true,
}),
new Paragraph(
"Sed laoreet id mattis egestas nam mollis elit lacinia convallis dui tincidunt ultricies habitant, pharetra per maximus interdum neque tempor risus efficitur morbi imperdiet senectus. Lectus laoreet senectus finibus inceptos donec potenti fermentum, ultrices eleifend odio suscipit magnis tellus maximus nibh, ac sit nullam eget felis himenaeos. Diam class sem magnis aenean commodo faucibus id proin mi, nullam sodales nec mus parturient ornare ad inceptos velit hendrerit, bibendum placerat eleifend integer facilisis urna dictumst suspendisse.",
),
],
},
],
});
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

63
demo/71-page-borders-2.ts Normal file
View File

@ -0,0 +1,63 @@
// Example demonstrating page borders with style, colors and size
// Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs";
import { Document, Packer, TextRun, Paragraph, BorderStyle, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder } from "../build";
const doc = new Document({
sections: [
{
properties: {
page: {
borders: {
pageBorderBottom: {
style: BorderStyle.SINGLE,
size: 2 * 8, //2pt;
color: "000000",
},
pageBorderLeft: {
style: BorderStyle.SINGLE,
size: 1 * 8, //1pt;
color: "000000",
},
pageBorderRight: {
style: BorderStyle.SINGLE,
size: 1 * 8, //1pt;
color: "FF00AA",
},
pageBorderTop: {
style: BorderStyle.SINGLE,
size: 1 * 8, //1pt;
color: "000000",
},
pageBorders: {
display: PageBorderDisplay.ALL_PAGES,
offsetFrom: PageBorderOffsetFrom.TEXT,
zOrder: PageBorderZOrder.FRONT,
},
},
},
},
children: [
new Paragraph({
children: [
new TextRun({
text: `Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.`,
}),
],
}),
new Paragraph({
children: [
new TextRun({
text: `Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.`,
}),
],
}),
],
},
],
});
// Used to export the file into a .docx file
Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer);
});

View File

@ -3,20 +3,22 @@
import * as fs from "fs"; import * as fs from "fs";
import { Document, Footer, Header, Packer, Paragraph } from "../build"; import { Document, Footer, Header, Packer, Paragraph } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
doc.addSection({ {
headers: { headers: {
default: new Header({ default: new Header({
children: [new Paragraph("Header text")], children: [new Paragraph("Header text")],
}), }),
}, },
footers: { footers: {
default: new Footer({ default: new Footer({
children: [new Paragraph("Footer text")], children: [new Paragraph("Footer text")],
}), }),
}, },
children: [new Paragraph("Hello World")], children: [new Paragraph("Hello World")],
},
],
}); });
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {

View File

@ -1,33 +1,48 @@
// Add images to header and footer // Add images to header and footer
// Import from 'docx' rather than '../build' if you install from npm // Import from 'docx' rather than '../build' if you install from npm
import * as fs from "fs"; import * as fs from "fs";
import { Document, Footer, Header, Media, Packer, Paragraph } from "../build"; import { Document, Footer, Header, ImageRun, Packer, Paragraph } from "../build";
const doc = new Document(); const doc = new Document({
sections: [
const image1 = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif")); {
const image2 = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif")); headers: {
default: new Header({
doc.addSection({ children: [
headers: { new Paragraph({
default: new Header({ children: [
children: [ new ImageRun({
new Paragraph({ data: fs.readFileSync("./demo/images/pizza.gif"),
children: [image1], transformation: {
width: 100,
height: 100,
},
}),
],
}),
],
}), }),
], },
}), footers: {
}, default: new Footer({
footers: { children: [
default: new Footer({ new Paragraph({
children: [ children: [
new Paragraph({ new ImageRun({
children: [image2], data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 100,
height: 100,
},
}),
],
}),
],
}), }),
], },
}), children: [new Paragraph("Hello World")],
}, },
children: [new Paragraph("Hello World")], ],
}); });
Packer.toBuffer(doc).then((buffer) => { Packer.toBuffer(doc).then((buffer) => {

File diff suppressed because one or more lines are too long

View File

@ -12,28 +12,28 @@
<script> <script>
function generate() { function generate() {
const doc = new docx.Document(); const doc = new docx.Document({
sections: [
doc.addSection({ {
children: [
new docx.Paragraph({
children: [ children: [
new docx.TextRun("Hello World"), new docx.Paragraph({
new docx.TextRun({ children: [
text: "Foo Bar", new docx.TextRun("Hello World"),
bold: true, new docx.TextRun({
}), text: "Foo Bar",
new docx.TextRun({ bold: true,
text: "\tGithub is the best", }),
bold: true, new docx.TextRun({
text: "\tGithub is the best",
bold: true,
}),
],
}), }),
], ],
}), },
], ],
}); });
docx.Packer.toBlob(doc).then((blob) => { docx.Packer.toBlob(doc).then((blob) => {
console.log(blob); console.log(blob);
saveAs(blob, "example.docx"); saveAs(blob, "example.docx");

View File

@ -1,7 +1,7 @@
// tslint:disable:no-console // tslint:disable:no-console
import * as fs from "fs"; import fs from "fs";
import * as prompt from "prompt"; import prompt from "prompt";
import * as shelljs from "shelljs"; import shelljs from "shelljs";
console.log("What demo do you wish to run? (Enter a number)"); console.log("What demo do you wish to run? (Enter a number)");
@ -17,8 +17,8 @@ const schema = {
prompt.start(); prompt.start();
prompt.get(schema, (_, result) => { prompt.get(schema as any, (_, result) => {
const demoNumber = result.number; const demoNumber = result.number as string;
const files = fs.readdirSync("./demo").filter((fn) => fn.startsWith(demoNumber)); const files = fs.readdirSync("./demo").filter((fn) => fn.startsWith(demoNumber));
if (files.length === 0) { if (files.length === 0) {

View File

@ -24,28 +24,27 @@ import { ... } from "docx";
import * as fs from "fs"; import * as fs from "fs";
import { Document, Packer, Paragraph, TextRun } from "docx"; import { Document, Packer, Paragraph, TextRun } from "docx";
// Create document
const doc = new Document();
// Documents contain sections, you can have multiple sections per document, go here to learn more about sections // Documents contain sections, you can have multiple sections per document, go here to learn more about sections
// This simple example will only contain one section // This simple example will only contain one section
doc.addSection({ const doc = new Document({
properties: {}, sections: [{
children: [ properties: {},
new Paragraph({ children: [
children: [ new Paragraph({
new TextRun("Hello World"), children: [
new TextRun({ new TextRun("Hello World"),
text: "Foo Bar", new TextRun({
bold: true, text: "Foo Bar",
}), bold: true,
new TextRun({ }),
text: "\tGithub is the best", new TextRun({
bold: true, text: "\tGithub is the best",
}), bold: true,
], }),
}), ],
], }),
],
}],
}); });
// Used to export the file into a .docx file // Used to export the file into a .docx file
@ -53,11 +52,11 @@ Packer.toBuffer(doc).then((buffer) => {
fs.writeFileSync("My Document.docx", buffer); fs.writeFileSync("My Document.docx", buffer);
}); });
// Done! A file called 'My First Document.docx' will be in your file system. // Done! A file called 'My Document.docx' will be in your file system.
``` ```
<p align="center"> <p align="center">
<img alt="clippy the assistant" src="http://i60.tinypic.com/339pvtt.png"> <img alt="clippy the assistant" src="./clippy.png">
</p> </p>
--- ---

View File

@ -3,8 +3,8 @@
> Easily generate .docx files with JS/TS. Works for Node and on the Browser. :100: > Easily generate .docx files with JS/TS. Works for Node and on the Browser. :100:
- Simple, declarative API - Simple, declarative API
- 50+ usage examples - 60+ usage examples
- Battle tested, mature, 95%+ coverage - Battle tested, mature, 99%+ coverage
[GitHub](https://github.com/dolanmiu/docx) [GitHub](https://github.com/dolanmiu/docx)
[Get Started](#Welcome) [Get Started](#Welcome)

View File

@ -15,17 +15,23 @@
* [Image](usage/images.md) * [Image](usage/images.md)
* [Headers & Footers](usage/headers-and-footers.md) * [Headers & Footers](usage/headers-and-footers.md)
* [Bullet Points](usage/bullet-points.md) * [Bullet Points](usage/bullet-points.md)
* [Hyperlinks](usage/hyperlinks.md)
* [Numbering](usage/numbering.md) * [Numbering](usage/numbering.md)
* [Tables](usage/tables.md) * [Tables](usage/tables.md)
* [Tab Stops](usage/tab-stops.md) * [Tab Stops](usage/tab-stops.md)
* [Table of Contents](usage/table-of-contents.md) * [Table of Contents](usage/table-of-contents.md)
* [Page Numbers](usage/page-numbers.md) * [Page Numbers](usage/page-numbers.md)
* [Change Tracking](usage/change-tracking.md)
* [Math](usage/math.md)
* [Text Frames](usage/text-frames.md)
* Styling * Styling
* [Styling with JS](usage/styling-with-js.md) * [Styling with JS](usage/styling-with-js.md)
* [Styling with XML](usage/styling-with-xml.md) * [Styling with XML](usage/styling-with-xml.md)
* Exporting * Exporting
* [Packers](usage/packers.md) * [Packers](usage/packers.md)
* Utility
* [Convenience functions](usage/convenience-functions.md)
* [Contribution Guidelines](contribution-guidelines.md) * [Contribution Guidelines](contribution-guidelines.md)

BIN
docs/clippy.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
docs/clippy.psd Normal file

Binary file not shown.

View File

@ -57,12 +57,14 @@ text.contents = "Hello World";
**Do** **Do**
```ts ```ts
doc.addSection({ const doc = new Document({
children: [ sections: [{
new Paragraph({ children: [
children: [new TextRun("Hello World")], new Paragraph({
}), children: [new TextRun("Hello World")],
], }),
],
}];
}); });
``` ```

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

@ -1,16 +1,28 @@
# Bullet Points # Bullet Points
!> Bullet Points requires an understanding of [Paragraphs](usage/paragraph.md).
## Example ## Example
To make a bullet point, simply make a paragraph into a bullet point: To make a bullet point, simply make a paragraph into a bullet point:
```ts ```ts
const text = new TextRun("Bullet points"); const doc = new Document({
const paragraph = new Paragraph({ sections: [{
text: "Bullet points", children: [
bullet: { new Paragraph({
level: 0, // How deep you want the bullet to me text: "Bullet points",
}, bullet: {
level: 0 //How deep you want the bullet to be
}
}),
new Paragraph({
text: "Are awesome",
bullet: {
level: 0
}
})
],
}];
}); });
``` ```

View File

@ -0,0 +1,61 @@
# Change Tracking
> Instead of adding a `TextRun` into a `Paragraph`, you can also add an `InsertedTextRun` or `DeletedTextRun` where you need to supply an `id`, `author` and `date` for the change.
```ts
import { Paragraph, TextRun, InsertedTextRun, DeletedTextRun } from "docx";
const paragraph = new Paragraph({
children: [
new TextRun("This is a simple demo "),
new TextRun({
text: "on how to "
}),
new InsertedTextRun({
text: "mark a text as an insertion ",
id: 0,
author: "Firstname Lastname",
date: "2020-10-06T09:00:00Z",
}),
new DeletedTextRun({
text: "or a deletion.",
id: 1,
author: "Firstname Lastname",
date: "2020-10-06T09:00:00Z",
})
],
});
```
Note that for a `InsertedTextRun` and `DeletedTextRun`, it is not possible to simply call it with only a text as in `new TextRun("some text")`, since the additional fields for change tracking need to be provided. Similar to a normal `TextRun` you can add additional text properties.
```ts
import { Paragraph, TextRun, InsertedTextRun, DeletedTextRun } from "docx";
const paragraph = new Paragraph({
children: [
new TextRun("This is a simple demo"),
new DeletedTextRun({
text: "with a deletion.",
color: "ff0000",
bold: true,
size: 24,
id: 0,
author: "Firstname Lastname",
date: "2020-10-06T09:00:00Z",
})
],
});
```
In addition to marking text as inserted or deleted, change tracking can also be added via the document settings. This will enable new changes to be tracked as well.
```ts
import { Document } from "docx";
const doc = new Document({
features: {
trackRevisions: true,
},
});
```

View File

@ -0,0 +1,22 @@
# Convenience functions
OOXML and this library mainly uses a unit called twentieths of a point or `twip` for short. a twip is a typographical measurement, defined as 1/20 of a typographical point. One twip is 1/1440 inch, or 17.64 μm. This unit is not intuitive for many users, so some functions were created to help
More info here: https://en.wikipedia.org/wiki/Twip
## Convert Inches to Twip
```ts
import { convertInchesToTwip } from "docx";
const twip = convertInchesToTwip(1); // returns 1440
const twip = convertInchesToTwip(0.5); // returns 720
```
## Convert Millimeters to Twip
```ts
import { convertMillimetersToTwip } from "docx";
const twip = convertMillimetersToTwip(50); // returns 2834
```

View File

@ -30,6 +30,24 @@ const doc = new docx.Document({
* keywords * keywords
* lastModifiedBy * lastModifiedBy
* revision * revision
* externalStyles
* styles
* numbering
* footnotes
* hyperlinks
* background
### Change background color of Document
Set the hex value in the document like so:
```ts
const doc = new docx.Document({
background: {
color: "C45911",
},
});
```
You can mix and match whatever properties you want, or provide no properties. You can mix and match whatever properties you want, or provide no properties.

73
docs/usage/fields.md Normal file
View File

@ -0,0 +1,73 @@
# Fields
Fields are pieces of dynamic text that you can include in your document. Often used fields are page numbers or references, but you can also include document properties like the author name or last saved date.
## Simple fields
There are very complicated fields like the table of contents, but in many cases the whole field just has the same properties (like formatting). In those cases, you can use simple fields.
Word uses field codes to identify what the result of the field should be. You can find these field codes by adding a field in a document (`Insert -> Quick Parts -> Field...`) and clicking the 'Field codes'-button. Some examples include:
Field type | Example | Description
----------- | --------------- | ---------------------------------------------------------
= (Formula) | `=2*21` | Calculates the result of a formula. You can also use bookmarks as variables, see below.
Author | `AUTHOR` | Includes the author mentioned in the document properties.
CreateDate | `CREATEDATE` | Date the document was created.
Date | `DATE` | Today's date.
FileName | `FILENAME \p` | The name of the document. Add `\p` for the complete path.
Info | `INFO NumWords` | Data from the document properties, e.g. the number of words in the document.
NumPages | `NUMPAGES` | Number of pages in the document.
UserName | `USERNAME` | Your user name from the Office personalization settings.
Fields can be added as a child of a paragraph:
```ts
const paragraph = new Paragraph({
children: [new TextRun("This document was created by: "), new SimpleField("AUTHOR")],
});
```
Fields can contain a cached value that gives the word processor a text to show without having to calculate all fields. The cached value can be updated by selecting the field and pressing F9. A cached value can be passed in as the second argument to the constructor.
```ts
const paragraph = new Paragraph({
children: [new TextRun("This document was created by: "), new SimpleField("AUTHOR", "Richard Brodie")],
});
```
### Formulas
One type of field is the formula that can be used to do some basic calculations. This can be done with static values, e.g. `12 + 34`, but a value from a bookmark can also be used in a calculation. This can be seen in the following example:
```ts
const paragraph = new Paragraph({
children: [
new TextRun("Value one is: "),
new Bookmark({ id: "One", children: [new TextRun("451")]}),
new TextRun(". The second value is: "),
new Bookmark({ id: "Two", children: [new TextRun("886")]}),
new TextRun(". The sum of these values is: "),
new SimpleField("=One+Two"),
],
});
```
### Mail merge fields
Fields are often used in a mail merge where a template document is created and data from another source (Excel or a database) is inserted in the document.
A convenience class was added to add these mail merge fields to the document easily. You can add these to a paragraph like any other field and only have to supply the name of the field in your data set:
```ts
const paragraph = new Paragraph({
children: [new TextRun("Your score was "), new SimpleMailMergeField("Score"), new TextRun(" of 100 points")],
});
```
This code is equivalent to:
```ts
const paragraph = new Paragraph({
children: [new TextRun("Your score was "), new SimpleField("MERGEFIELD Score", "«Score»"), new TextRun(" of 100 points")],
});
```

View File

@ -5,35 +5,35 @@
Every Section has a sections which you can define its Headers and Footers: Every Section has a sections which you can define its Headers and Footers:
```ts ```ts
doc.addSection({ const doc = new Document({
headers: { sections: [{
default: new Header({ // The standard default header headers: {
children: [], default: new Header({ // The standard default header on every page or header on odd pages when the 'Different Odd & Even Pages' option is activated
}), children: [],
first: new Header({ // The first header }),
children: [], first: new Header({ // The header on first page when the 'Different First Page' option is activated
}), children: [],
even: new Header({ // The header on every other page }),
children: [], even: new Header({ // The header on even pages when the 'Different Odd & Even Pages' option is activated
}), children: [],
}, }),
footers: { },
default: new Footer({ // The standard default footer footers: {
children: [], default: new Footer({ // The standard default footer on every page or footer on odd pages when the 'Different Odd & Even Pages' option is activated
}), children: [],
first: new Footer({ // The first footer }),
children: [], first: new Footer({ // The footer on first page when the 'Different First Page' option is activated
}), children: [],
even: new Footer({ // The footer on every other page }),
children: [], even: new Footer({ // The footer on even pages when the 'Different Odd & Even Pages' option is activated
}), children: [],
}, }),
children: [], },
children: [],
}];
}); });
``` ```
If you want more head
## Example ## Example
Example showing basic header and footer Example showing basic header and footer

View File

@ -1,47 +1,98 @@
# Hyperlinks # Hyperlinks
!> Hyperlinks require an understanding of [Paragraphs](usage/paragraph.md) and [Text](usage/text.md).
There are two types of hyperlinks: internal (pointing to a bookmark inside the document) and external (pointing to an external url). There are two types of hyperlinks: internal (pointing to a bookmark inside the document) and external (pointing to an external url).
## Internal ## Internal
To create an internal hyperlink you need first to create a bookmark (the paragraph that will be the destination of the hyperlink) with `doc.createBookmark(anchor, text)`. To create an internal hyperlink you need first to create a `Bookmark`, which contains the content that will be the destination of the hyperlink.
A bookmark is composed of an anchor (an identifier) and the text displayed. After creating a bookmark just add it to a paragraph with `paragraph.addBookmark(bookmark)` A bookmark is composed of an anchor (an identifier) and the text displayed. After creating a bookmark just add it to a paragraph. For example, creating a bookmarked heading:
For example:
```ts ```ts
const paragraph = this.doc.createParagraph(); const chapter1 = new Paragraph({
const bookmark = this.doc.createBookmark('anchorForChapter1', 'This is chapter1'); heading: HeadingLevel.HEADING_1,
paragraph.addBookmark(bookmark); children: [
new Bookmark({
id: "anchorForChapter1",
children: [
new TextRun("Chapter 1"),
],
}),
],
})
``` ```
Then you can create an hyperlink pointing to that bookmark with `doc.createInternalHyperLink(anchor,text)`: Then you can create an hyperlink pointing to that bookmark with an `InternalHyperLink`:
```ts ```ts
const paragraph = this.doc.createParagraph(); const link = new InternalHyperlink({
const link = this.doc.createInternalHyperLink('anchorForChapter1', 'This is a link to chapter1'); children: [
paragraph.addHyperLink(link); new TextRun({
text: "See Chapter 1",
style: "Hyperlink",
}),
],
anchor: "anchorForChapter1",
})
```
You can also get the page number of the bookmark by creating a page reference to it:
```ts
const paragraph = new Paragraph({
children: [
new TextRun("Chapter 1 can be seen on page "),
new PageReference("anchorForChapter1"),
],
});
``` ```
## External ## External
To create an external hyperlink you just need to specify the url and the text of the link, then add it to a paragraph with `doc.createHyperlink(url, text)`: To create an external hyperlink you just need to specify the url and the text of the link, then add it to a paragraph:
```ts ```ts
const paragraph = this.doc.createParagraph(); const paragraph = new Paragraph({
const link = this.doc.createHyperlink('https://docx.js.org', 'This is an external link'); children: [
paragraph.addHyperLink(link); new ExternalHyperlink({
children: [
new TextRun({
text: "This is an external link!",
style: "Hyperlink",
}),
],
link: "https://docx.js.org",
}),
],
});
``` ```
## Styling an hyperlink ## Styling hyperlinks
It is possible to set the style of the text of an hyperlink. This can be done applying run formatting on `TextRun` property of the hyperlink. It is possible to set the style of the text of both internal and external hyperlinks. This can be done applying run formatting on any of the `TextRun` children of the hyperlink. Use the `style: "Hyperlink"` property to show the default link styles, which can be combined with any other style.
Example: Example:
```ts ```ts
const link = this.doc.createHyperlink('https://docx.js.org', 'This is an external link'); const styledLink = new ExternalHyperlink({
link.TextRun.bold().italics() children: [
new TextRun({
text: "This is a ",
style: "Hyperlink",
}),
new TextRun({
text: "bold",
bold: true,
style: "Hyperlink",
}),
new TextRun({
text: " link!",
style: "Hyperlink",
}),
],
link: "https://docx.js.org",
});
``` ```

View File

@ -5,7 +5,12 @@
To create a `floating` image on top of text: To create a `floating` image on top of text:
```ts ```ts
Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"), 200, 200, { const image = new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 200,
height: 200,
}
floating: { floating: {
horizontalPosition: { horizontalPosition: {
offset: 1014400, offset: 1014400,
@ -20,47 +25,52 @@ Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"), 200, 200, {
By default with no arguments, its an `inline` image: By default with no arguments, its an `inline` image:
```ts ```ts
const image = Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif")); const image = new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 100,
height: 100,
},
});
``` ```
Add it into the document by adding the image into a paragraph: Add it into the document by adding the image into a paragraph:
```ts ```ts
doc.addSection({ const doc = new Document({
children: [new Paragraph(image)], sections: [{
}); children: [
``` new Paragraph({
children: [image],
Or: }),
],
```ts }];
doc.addSection({
children: [
new Paragraph({
children: [image],
}),
],
}); });
``` ```
## Intro ## Intro
Adding images can be done in two ways: Adding images can be easily done by creating an instance of `ImageRun`. This can be added in a `Paragraph` or `Hyperlink`:
1. Call the `createImage` method to add the image directly into the `document`: ```ts
const doc = new Document({
```ts sections: [{
Media.addImage(doc, [IMAGE_BUFFER], [WIDTH], [HEIGHT], [POSITION_OPTIONS]); children: [
``` new Paragraph({
children: [
2. Create an `image` first, then add it into the `document`: new ImageRun({
data: [IMAGE_BUFFER],
```ts transformation: {
const image = Media.addImage(doc, [IMAGE_BUFFER]); width: [IMAGE_SIZE],
doc.addSection({ height: [IMAGE_SIZE],
children: [new Paragraph(image)], },
}); }),
``` ],
}),
],
}];
});
```
`docx` supports `jpeg`, `jpg`, `bmp`, `gif` and `png` `docx` supports `jpeg`, `jpg`, `bmp`, `gif` and `png`
@ -68,25 +78,30 @@ Adding images can be done in two ways:
> Positioning is the method on how to place the image on the document > Positioning is the method on how to place the image on the document
![Word Image Positiong](https://user-images.githubusercontent.com/34742290/41765548-b0946302-7604-11e8-96f9-166a9f0b8f39.png) ![Word Image Positioning](https://user-images.githubusercontent.com/34742290/41765548-b0946302-7604-11e8-96f9-166a9f0b8f39.png)
Three types of image positioning is supported: Three types of image positioning is supported:
- Floating - Floating
- Inline - Inline
By default, picture are exported as `Inline` elements. By default, images are exported as `Inline` elements.
### Usage ### Usage
Pass `options` into the `[POSITION_OPTIONS]` metioned in the [Intro above](#Intro). Pass `options` into the `[POSITION_OPTIONS]` mentioned in the [Intro above](#Intro).
## Floating ## Floating
To change the position the image to be on top of the text, simply add the `floating` property to the last argument. By default, the offsets are relative to the top left corner of the `page`. Offset units are in [emus](https://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/): To change the position the image to be on top of the text, simply add the `floating` property to the last argument. By default, the offsets are relative to the top left corner of the `page`. Offset units are in [emus](https://startbigthinksmall.wordpress.com/2010/01/04/points-inches-and-emus-measuring-units-in-office-open-xml/):
```ts ```ts
const imageData = document.createImage(buffer, 903, 1149, { const image = new ImageRun({
data: buffer,
transformation: {
width: 903,
height: 1149,
},
floating: { floating: {
horizontalPosition: { horizontalPosition: {
offset: 1014400, // relative: HorizontalPositionRelativeFrom.PAGE by default offset: 1014400, // relative: HorizontalPositionRelativeFrom.PAGE by default
@ -99,7 +114,12 @@ const imageData = document.createImage(buffer, 903, 1149, {
``` ```
```ts ```ts
const imageData = document.createImage(buffer, 903, 1149, { const image = new ImageRun({
data: buffer,
transformation: {
width: 903,
height: 1149,
},
floating: { floating: {
horizontalPosition: { horizontalPosition: {
relative: HorizontalPositionRelativeFrom.RIGHT_MARGIN, relative: HorizontalPositionRelativeFrom.RIGHT_MARGIN,
@ -125,6 +145,7 @@ Full options you can pass into `floating` are:
| lockAnchor | `boolean` | Optional | | lockAnchor | `boolean` | Optional |
| behindDocument | `boolean` | Optional | | behindDocument | `boolean` | Optional |
| layoutInCell | `boolean` | Optional | | layoutInCell | `boolean` | Optional |
| zIndex | `number` | Optional |
`HorizontalPositionOptions` are: `HorizontalPositionOptions` are:
@ -158,7 +179,12 @@ wrap: {
For example: For example:
```ts ```ts
Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"), 200, 200, { const image = new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 200,
height: 200,
},
floating: { floating: {
horizontalPosition: { horizontalPosition: {
offset: 2014400, offset: 2014400,
@ -201,7 +227,12 @@ margins: {
For example: For example:
```ts ```ts
Media.addImage(doc, fs.readFileSync("./demo/images/pizza.gif"), 200, 200, { const image = new ImageRun({
data: fs.readFileSync("./demo/images/pizza.gif"),
transformation: {
width: 200,
height: 200,
},
floating: { floating: {
horizontalPosition: { horizontalPosition: {
offset: 2014400, offset: 2014400,

265
docs/usage/math.md Normal file
View File

@ -0,0 +1,265 @@
# Math
!> Math requires an understanding of [Sections](usage/sections.md) and [Paragraphs](usage/paragraph.md).
## Intro
1. To add math, create a `Math` object
2. Add `MathComponents` inside `Math`
3. `MathComponents` can have nested `MathComponents` inside. e.g. A fraction where the numerator is a square root, and the denominator as another fraction. More on `MathComponents` below
4. Make sure to add the `Math` object inside a `Paragraph`
## Example
```ts
new Math({
children: [
new MathRun("2+2"),
new MathFraction({
numerator: [new MathRun("hi")],
denominator: [new MathRun("2")],
}),
],
}),
```
This will produce:
<p align="center">
<img alt="clippy the assistant" src="images/math-example.png" width="200">
</p>
## Math Components
`MathComponents` are the unit sized building blocks of an equation in `docx`. A `MathComponent` takes in more nested `MathComponents` until you reach `MathRun`, which has no children. `MathRun` is similar to a [TextRun](usage/text.md).
### Math Run
`MathRun` is the most basic `MathComponent`.
#### Example
```ts
new MathRun("2+2");
```
```ts
new MathRun("hello");
```
An example of it being used inside `Math`:
```ts
new Math({
children: [
new MathRun("2"),
new MathRun("+"),
new MathRun("2"),
],
}),
```
### Math Fraction
`MathFractions` require a `numerator` and a `denominator`, which are both a list of `MathComponents`
#### Example
```ts
new MathFraction({
numerator: [new MathRun("1")],
denominator: [new MathRun("2")],
}),
```
```ts
new MathFraction({
numerator: [
new MathRun("1"),
new MathRadical({
children: [new MathRun("2")],
}),
],
denominator: [new MathRun("2")],
}),
```
An example of it being used inside `Math`:
```ts
new Math({
children: [
new MathFraction({
numerator: [new MathRun("1")],
denominator: [new MathRun("2")],
}),
new MathText("+"),
new MathFraction({
numerator: [new MathRun("1")],
denominator: [new MathRun("2")],
}),
new MathText("= 1"),
],
}),
```
### Sum
A `MathComponent` for `Σ`. It can take a `superScript` and/or `subScript` as arguments to add `MathComponents` (usually limits) on the top and bottom
```ts
new MathSum({
children: [new MathRun("i")],
}),
```
```ts
new MathSum({
children: [
new MathSuperScript({
children: [new MathRun("e")],
superScript: [new MathRun("2")],
})
],
subScript: [new MathRun("i")],
superScript: [new MathRun("10")],
}),
```
### Radicals
A `MathComponent` for the `√` symbol. Examples include, square root, cube root etc. There is an optional `degree` parameter to specify the number of times the radicand is multiplied by itself. For example, `3` for cube root.
```ts
new MathRadical({
children: [new MathRun("2")],
}),
```
Cube root example:
```ts
new MathRadical({
children: [
new MathFraction({
numerator: [new MathRun("1")],
denominator: [new MathRun("2")],
}),
new MathRun('+ 1'),
],
degree: [new MathRun("3")],
}),
```
### Super Script
`MathSuperScripts` are the little numbers written to the top right of numbers or variables. It means the exponent or power if written by itself with the number or variable.
```ts
new MathSuperScript({
children: [new MathRun("x")],
superScript: [new MathRun("2")],
}),
```
An example with cosine:
```ts
new MathSuperScript({
children: [new MathRun("cos")],
superScript: [new MathRun("-1")],
}),
```
### Sub Script
`MathSubScripts` are similar to `MathSuperScripts`, except the little number is written below.
```ts
new MathSubScript({
children: [new MathRun("F")],
subScript: [new MathRun("n-1")],
}),
```
### Sub-Super Script
`MathSubSuperScripts` are a combination of both `MathSuperScript` and `MathSubScript`.
```ts
new MathSubSuperScript({
children: [new MathRun("test")],
superScript: [new MathRun("hello")],
subScript: [new MathRun("world")],
}),
```
### Function
`MathFunctions` are a way of describing what happens to an input variable, in order to get the output result. It takes a `name` parameter to specify the name of the function.
```ts
new MathFunction({
name: [
new MathSuperScript({
children: [new MathRun("cos")],
superScript: [new MathRun("-1")],
}),
],
children: [new MathRun("100")],
}),
```
### Brackets
#### Square brackets
```ts
new MathSquareBrackets({
children: [
new MathFraction({
numerator: [new MathRun("1")],
denominator: [new MathRun("2")],
}),
],
}),
```
#### Round brackets
```ts
new MathRoundBrackets({
children: [
new MathFraction({
numerator: [new MathRun("1")],
denominator: [new MathRun("2")],
}),
],
}),
```
#### Curly brackets
```ts
new MathCurlyBrackets({
children: [
new MathFraction({
numerator: [new MathRun("1")],
denominator: [new MathRun("2")],
}),
],
}),
```
#### Angled brackets
```ts
new MathAngledBrackets({
children: [
new MathFraction({
numerator: [new MathRun("1")],
denominator: [new MathRun("2")],
}),
],
}),
```

Some files were not shown because too many files have changed in this diff Show More