Compare commits
257 Commits
Author | SHA1 | Date | |
---|---|---|---|
444e7771b4 | |||
962795743c | |||
f98f852a55 | |||
e379a7fe04 | |||
022b25cfcd | |||
e20bd66663 | |||
6b8e22368b | |||
4304e82751 | |||
75715fde37 | |||
e779f6ea62 | |||
9280cdba50 | |||
8410d0c06d | |||
d47d85bdcf | |||
6ae45327fe | |||
464cd946dc | |||
cbff540b6e | |||
a8e6ba4c49 | |||
efc1ceaf1a | |||
c4ed19e589 | |||
13cf3eee5a | |||
24c159de37 | |||
7570fc2bf5 | |||
6929dee846 | |||
d4ac2a08ee | |||
010ef05ce3 | |||
fa401297da | |||
ce0e9936c3 | |||
c13e9938cf | |||
b8f97553b3 | |||
2550da199d | |||
682b679bdb | |||
e0fd7e751c | |||
9b57db4716 | |||
d23f453d28 | |||
6c28f8bab0 | |||
10b87b5a70 | |||
6b6f9d7ed4 | |||
0434d00ff7 | |||
7e3acc25b9 | |||
62ad8f12b7 | |||
a6a656f1a0 | |||
1bf36009e8 | |||
86bdf3e199 | |||
a3c796aae3 | |||
dbe0586f70 | |||
7e2538dffc | |||
c3080ff9d9 | |||
772fc8462a | |||
e194780cd1 | |||
5b80ea32d7 | |||
31b7e07ab3 | |||
939d418af1 | |||
4258dd2a2e | |||
b7334a1ab5 | |||
9229f45d59 | |||
2bd4aacdd5 | |||
abbd695a8f | |||
f7b98bcde8 | |||
a756a7697c | |||
fd1ea5b4dc | |||
d83e089cd3 | |||
33715cc50c | |||
f3f1f2d0b1 | |||
c35e706fa8 | |||
35cebfe1a2 | |||
d04c42cbe8 | |||
8744e613ac | |||
cbeecbf3e1 | |||
f8ab2d1701 | |||
adc5c6f594 | |||
c9524cc497 | |||
90de6ba7e1 | |||
78d74ae60b | |||
579593a467 | |||
b5393dadae | |||
528ab1933e | |||
36181f8c91 | |||
45af681db1 | |||
ad6b482136 | |||
a6e1c2b019 | |||
3eb98533ae | |||
f5f021834e | |||
35702c3f77 | |||
8fbbd571ad | |||
2dd228be69 | |||
562835cfe7 | |||
6bac06e84d | |||
88436168ee | |||
0c3206d2e2 | |||
033debd339 | |||
d4f160732a | |||
4238fc9ab4 | |||
0d042b8dd1 | |||
afdd5f2d8f | |||
70c7b3d1b3 | |||
7b1cd5fe86 | |||
09ab169ffd | |||
35a82cf12e | |||
8d33cb01dd | |||
438d11dd86 | |||
d23b0d0789 | |||
1fa8c7ac82 | |||
3d6ead0359 | |||
379050dccd | |||
f9d1c197cf | |||
a89ee463e6 | |||
036caaacc8 | |||
80c37afe2b | |||
3a36d912fe | |||
c741d5d8ac | |||
0fa7dd13ad | |||
d5d80550e7 | |||
23a0a59454 | |||
066aa56f6a | |||
3997b7a5d6 | |||
ccc391607a | |||
9577192d41 | |||
968c3aed0f | |||
9c7a80729b | |||
5f26ca1c94 | |||
f2b1587bff | |||
3b9f80fb1a | |||
8da57bec51 | |||
63db9f290c | |||
e8bd4bd6c6 | |||
28d93b0c42 | |||
95f8e37006 | |||
87083cb264 | |||
1e8dc95c9c | |||
abfa242c28 | |||
56b5414152 | |||
8f46060be2 | |||
93b17ca2af | |||
66008115b8 | |||
55697a7c32 | |||
e9b259db6b | |||
55c51f7af1 | |||
4e7fd6a6dc | |||
6294ec448f | |||
668198b5d1 | |||
56b2ffe706 | |||
2ab06ffe36 | |||
0c51082bb9 | |||
9a9a2019f6 | |||
d94348f5ca | |||
4c10741862 | |||
222a25e4e2 | |||
5fd4490c4f | |||
e1cc65cb97 | |||
991f837bc1 | |||
87b3035465 | |||
4498305a6c | |||
cac7abba91 | |||
b9b55b2829 | |||
11365d5be5 | |||
47a5aff40c | |||
721fbbac67 | |||
bcca50fb40 | |||
229d2eb689 | |||
3ef80cc7b3 | |||
f1f11f36e4 | |||
28f187064e | |||
c391ca533a | |||
0ca92b80f9 | |||
84501b6038 | |||
dcd3e90b19 | |||
be7d84dfa0 | |||
b0d60109c9 | |||
b4659f9901 | |||
25f657b842 | |||
dfffb066f3 | |||
4f06d760a3 | |||
aea2531111 | |||
16707201b4 | |||
c7c9652095 | |||
05378f58ae | |||
d7549a1140 | |||
e3ee455186 | |||
210d9c58f2 | |||
db85c3dd2f | |||
4976a75ab3 | |||
414d0248f5 | |||
fa400bcf39 | |||
9e9ca526fe | |||
41c0fb5fc0 | |||
58e7dbf445 | |||
20e0213c7d | |||
b8f83fd6ad | |||
d1f75e3a42 | |||
337ff464cf | |||
cad4a5510b | |||
aa8438d8bd | |||
79363c2c2c | |||
f706d8e62d | |||
e7ee2a0fdf | |||
bd17df8e98 | |||
e237326319 | |||
a368ed7fd3 | |||
a9fa31ebac | |||
6b4a78ed41 | |||
9b93a15323 | |||
17774c50be | |||
a63095a7b4 | |||
9aba21e64c | |||
6288bb0701 | |||
2061854778 | |||
e4eeb3f87f | |||
a168dc1c15 | |||
99dee460ae | |||
36e9ac1179 | |||
df619ffe49 | |||
b1513d4ce9 | |||
7d0a71acef | |||
307a651e6d | |||
b7f6a7da6b | |||
1d9ff920e8 | |||
810846c49a | |||
cb66d68980 | |||
1badd6a53f | |||
7e37d8d27a | |||
5c950e1a07 | |||
adbb16f7eb | |||
dd088bf584 | |||
a27cb7db47 | |||
2e41387a50 | |||
9bb4803ac5 | |||
8bf2b6c9ce | |||
37f60c1766 | |||
7bce84eba0 | |||
46bedaa241 | |||
9a6d8c0e8b | |||
1571b7a1a7 | |||
16f5e5bbbc | |||
e3a8def43e | |||
40c11bae22 | |||
3a3415a3da | |||
222024fdde | |||
c5511bb3d9 | |||
5c4696a660 | |||
2812bef532 | |||
91379070d3 | |||
668f4f4e78 | |||
28ad740473 | |||
d08349f8eb | |||
b6e5b23f89 | |||
8dd8c079e7 | |||
eeee01a0e0 | |||
09ab91eeef | |||
a0a88412ff | |||
972fa77265 | |||
e69b063687 | |||
a89919397d | |||
0cbb5fb0a3 | |||
352cde743f | |||
a26292a0fd | |||
18b2e91da2 | |||
5e14bc6c2a |
26
.cspell.json
26
.cspell.json
@ -4,13 +4,7 @@
|
|||||||
"version": "0.2",
|
"version": "0.2",
|
||||||
// language - current active spelling language
|
// language - current active spelling language
|
||||||
"language": "en_US",
|
"language": "en_US",
|
||||||
"dictionaries": [
|
"dictionaries": ["en_US", "typescript", "softwareTerms", "fonts", "npm"],
|
||||||
"en_US",
|
|
||||||
"typescript",
|
|
||||||
"softwareTerms",
|
|
||||||
"fonts",
|
|
||||||
"npm"
|
|
||||||
],
|
|
||||||
// words - list of words to be always considered correct
|
// words - list of words to be always considered correct
|
||||||
"words": [
|
"words": [
|
||||||
"Abjad",
|
"Abjad",
|
||||||
@ -21,13 +15,19 @@
|
|||||||
"datas",
|
"datas",
|
||||||
"docsify",
|
"docsify",
|
||||||
"dolan",
|
"dolan",
|
||||||
|
"execa",
|
||||||
"falsey",
|
"falsey",
|
||||||
|
"horz",
|
||||||
|
"iife",
|
||||||
"Initializable",
|
"Initializable",
|
||||||
"iroha",
|
"iroha",
|
||||||
|
"JOHAB",
|
||||||
"jsonify",
|
"jsonify",
|
||||||
"jszip",
|
"jszip",
|
||||||
"NUMPAGES",
|
"NUMPAGES",
|
||||||
"odttf",
|
"odttf",
|
||||||
|
"ondata",
|
||||||
|
"onfile",
|
||||||
"ooxml",
|
"ooxml",
|
||||||
"panose",
|
"panose",
|
||||||
"rels",
|
"rels",
|
||||||
@ -55,17 +55,13 @@
|
|||||||
"\\.to\\.include\\.members\\(\\[[^\\]]+]\\)",
|
"\\.to\\.include\\.members\\(\\[[^\\]]+]\\)",
|
||||||
"/new [a-zA-Z]+\\({[^£]+}\\)/g",
|
"/new [a-zA-Z]+\\({[^£]+}\\)/g",
|
||||||
"/<element name=\"[a-z]+\"/gi",
|
"/<element name=\"[a-z]+\"/gi",
|
||||||
"/<attribute name=\"[a-z]+\"/gi"
|
"/<attribute name=\"[a-z]+\"/gi",
|
||||||
],
|
"/key: \".+\"/"
|
||||||
"ignorePaths": [
|
|
||||||
"package.json",
|
|
||||||
"docs/api"
|
|
||||||
],
|
],
|
||||||
|
"ignorePaths": ["package.json", "docs/api", "*.docx", "build"],
|
||||||
"allowCompoundWords": true,
|
"allowCompoundWords": true,
|
||||||
// flagWords - list of words to be always considered incorrect
|
// flagWords - list of words to be always considered incorrect
|
||||||
// This is useful for offensive words and common spelling errors.
|
// This is useful for offensive words and common spelling errors.
|
||||||
// For example "hte" should be "the"
|
// For example "hte" should be "the"
|
||||||
"flagWords": [
|
"flagWords": ["hte"]
|
||||||
"hte"
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
272
.eslintrc.js
272
.eslintrc.js
@ -1,272 +0,0 @@
|
|||||||
/*
|
|
||||||
👋 Hi! This file was autogenerated by tslint-to-eslint-config.
|
|
||||||
https://github.com/typescript-eslint/tslint-to-eslint-config
|
|
||||||
|
|
||||||
It represents the closest reasonable ESLint configuration to this
|
|
||||||
project's original TSLint configuration.
|
|
||||||
|
|
||||||
We recommend eventually switching this configuration to extend from
|
|
||||||
the recommended rulesets in typescript-eslint.
|
|
||||||
https://github.com/typescript-eslint/tslint-to-eslint-config/blob/master/docs/FAQs.md
|
|
||||||
|
|
||||||
Happy linting! 💖
|
|
||||||
*/
|
|
||||||
module.exports = {
|
|
||||||
extends: "eslint:recommended",
|
|
||||||
env: {
|
|
||||||
browser: true,
|
|
||||||
es6: true,
|
|
||||||
node: true,
|
|
||||||
},
|
|
||||||
parser: "@typescript-eslint/parser",
|
|
||||||
parserOptions: {
|
|
||||||
project: "tsconfig.json",
|
|
||||||
sourceType: "module",
|
|
||||||
},
|
|
||||||
plugins: [
|
|
||||||
"eslint-plugin-import",
|
|
||||||
"eslint-plugin-no-null",
|
|
||||||
"eslint-plugin-unicorn",
|
|
||||||
"eslint-plugin-jsdoc",
|
|
||||||
"eslint-plugin-prefer-arrow",
|
|
||||||
"@typescript-eslint",
|
|
||||||
"functional",
|
|
||||||
],
|
|
||||||
root: true,
|
|
||||||
rules: {
|
|
||||||
"no-undef": "off",
|
|
||||||
"no-extra-boolean-cast": "off",
|
|
||||||
"no-alert": "error",
|
|
||||||
"no-self-compare": "error",
|
|
||||||
"no-unreachable-loop": "error",
|
|
||||||
"no-template-curly-in-string": "error",
|
|
||||||
"no-unused-private-class-members": "error",
|
|
||||||
"no-extend-native": "error",
|
|
||||||
"no-floating-decimal": "error",
|
|
||||||
"no-implied-eval": "error",
|
|
||||||
"no-iterator": "error",
|
|
||||||
"no-lone-blocks": "error",
|
|
||||||
"no-loop-func": "error",
|
|
||||||
"no-new-object": "error",
|
|
||||||
"no-proto": "error",
|
|
||||||
"no-useless-catch": "error",
|
|
||||||
"one-var-declaration-per-line": "error",
|
|
||||||
"prefer-arrow-callback": "error",
|
|
||||||
"prefer-destructuring": "error",
|
|
||||||
"prefer-exponentiation-operator": "error",
|
|
||||||
"prefer-promise-reject-errors": "error",
|
|
||||||
"prefer-regex-literals": "error",
|
|
||||||
"prefer-spread": "error",
|
|
||||||
"prefer-template": "error",
|
|
||||||
"require-await": "error",
|
|
||||||
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
||||||
"@typescript-eslint/array-type": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
default: "array",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"@typescript-eslint/ban-types": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
types: {
|
|
||||||
Object: {
|
|
||||||
message: "Avoid using the `Object` type. Did you mean `object`?",
|
|
||||||
},
|
|
||||||
Function: {
|
|
||||||
message: "Avoid using the `Function` type. Prefer a specific function type, like `() => void`.",
|
|
||||||
},
|
|
||||||
Boolean: {
|
|
||||||
message: "Avoid using the `Boolean` type. Did you mean `boolean`?",
|
|
||||||
},
|
|
||||||
Number: {
|
|
||||||
message: "Avoid using the `Number` type. Did you mean `number`?",
|
|
||||||
},
|
|
||||||
String: {
|
|
||||||
message: "Avoid using the `String` type. Did you mean `string`?",
|
|
||||||
},
|
|
||||||
Symbol: {
|
|
||||||
message: "Avoid using the `Symbol` type. Did you mean `symbol`?",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"@typescript-eslint/consistent-type-assertions": "error",
|
|
||||||
"@typescript-eslint/dot-notation": "error",
|
|
||||||
"@typescript-eslint/explicit-function-return-type": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
allowExpressions: true,
|
|
||||||
allowTypedFunctionExpressions: true,
|
|
||||||
allowHigherOrderFunctions: false,
|
|
||||||
allowDirectConstAssertionInArrowFunctions: true,
|
|
||||||
allowConciseArrowFunctionExpressionsStartingWithVoid: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"@typescript-eslint/explicit-member-accessibility": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
accessibility: "explicit",
|
|
||||||
overrides: {
|
|
||||||
accessors: "explicit",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"@typescript-eslint/explicit-module-boundary-types": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
allowArgumentsExplicitlyTypedAsAny: true,
|
|
||||||
allowDirectConstAssertionInArrowFunctions: true,
|
|
||||||
allowHigherOrderFunctions: false,
|
|
||||||
allowTypedFunctionExpressions: false,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"@typescript-eslint/naming-convention": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
selector: ["objectLiteralProperty"],
|
|
||||||
leadingUnderscore: "allow",
|
|
||||||
format: ["camelCase", "PascalCase"],
|
|
||||||
filter: {
|
|
||||||
regex: "(^[a-z]+:.+)|_attr|[0-9]",
|
|
||||||
match: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"@typescript-eslint/no-empty-function": "error",
|
|
||||||
"@typescript-eslint/no-empty-interface": "error",
|
|
||||||
"@typescript-eslint/no-explicit-any": "error",
|
|
||||||
"@typescript-eslint/no-misused-new": "error",
|
|
||||||
"@typescript-eslint/no-namespace": "error",
|
|
||||||
"@typescript-eslint/no-parameter-properties": "off",
|
|
||||||
"@typescript-eslint/no-require-imports": "error",
|
|
||||||
"@typescript-eslint/no-shadow": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
hoist: "all",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"@typescript-eslint/no-this-alias": "error",
|
|
||||||
"@typescript-eslint/no-unused-expressions": "error",
|
|
||||||
"@typescript-eslint/no-use-before-define": "off",
|
|
||||||
"@typescript-eslint/no-var-requires": "error",
|
|
||||||
"@typescript-eslint/prefer-for-of": "error",
|
|
||||||
"@typescript-eslint/prefer-function-type": "error",
|
|
||||||
"@typescript-eslint/prefer-namespace-keyword": "error",
|
|
||||||
"@typescript-eslint/prefer-readonly": "error",
|
|
||||||
"@typescript-eslint/triple-slash-reference": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
path: "always",
|
|
||||||
types: "prefer-import",
|
|
||||||
lib: "always",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"@typescript-eslint/typedef": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
parameter: true,
|
|
||||||
propertyDeclaration: true,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"@typescript-eslint/unified-signatures": "error",
|
|
||||||
"arrow-body-style": "error",
|
|
||||||
complexity: "off",
|
|
||||||
"consistent-return": "error",
|
|
||||||
"constructor-super": "error",
|
|
||||||
curly: "error",
|
|
||||||
"dot-notation": "off",
|
|
||||||
eqeqeq: ["error", "smart"],
|
|
||||||
"guard-for-in": "error",
|
|
||||||
"id-denylist": ["error", "any", "Number", "number", "String", "string", "Boolean", "boolean", "Undefined", "undefined"],
|
|
||||||
"id-match": "error",
|
|
||||||
"import/no-default-export": "error",
|
|
||||||
"import/no-extraneous-dependencies": "off",
|
|
||||||
"import/no-internal-modules": "off",
|
|
||||||
"import/order": "error",
|
|
||||||
indent: "off",
|
|
||||||
"jsdoc/check-alignment": "error",
|
|
||||||
"jsdoc/check-indentation": "off",
|
|
||||||
"jsdoc/newline-after-description": "error",
|
|
||||||
"max-classes-per-file": "off",
|
|
||||||
"max-len": "off",
|
|
||||||
"new-parens": "error",
|
|
||||||
"no-bitwise": "error",
|
|
||||||
"no-caller": "error",
|
|
||||||
"no-cond-assign": "error",
|
|
||||||
"no-console": "error",
|
|
||||||
"no-debugger": "error",
|
|
||||||
"no-duplicate-case": "error",
|
|
||||||
"no-duplicate-imports": "error",
|
|
||||||
"no-empty": "error",
|
|
||||||
"no-empty-function": "off",
|
|
||||||
"no-eval": "error",
|
|
||||||
"no-extra-bind": "error",
|
|
||||||
"no-fallthrough": "off",
|
|
||||||
"no-invalid-this": "off",
|
|
||||||
"no-multiple-empty-lines": "error",
|
|
||||||
"no-new-func": "error",
|
|
||||||
"no-new-wrappers": "error",
|
|
||||||
"no-null/no-null": "error",
|
|
||||||
"no-param-reassign": "error",
|
|
||||||
"no-redeclare": "error",
|
|
||||||
"no-return-await": "error",
|
|
||||||
"no-sequences": "error",
|
|
||||||
"no-shadow": "off",
|
|
||||||
"no-sparse-arrays": "error",
|
|
||||||
"no-throw-literal": "error",
|
|
||||||
"no-trailing-spaces": "error",
|
|
||||||
"no-undef-init": "error",
|
|
||||||
"no-underscore-dangle": ["error", { allow: ["_attr"] }],
|
|
||||||
"no-unsafe-finally": "error",
|
|
||||||
"no-unused-expressions": "off",
|
|
||||||
"no-unused-labels": "error",
|
|
||||||
"no-use-before-define": "off",
|
|
||||||
"no-useless-constructor": "error",
|
|
||||||
"no-var": "error",
|
|
||||||
"object-shorthand": "off",
|
|
||||||
"one-var": ["error", "never"],
|
|
||||||
"prefer-arrow/prefer-arrow-functions": "error",
|
|
||||||
"prefer-const": "error",
|
|
||||||
"prefer-object-spread": "error",
|
|
||||||
radix: "error",
|
|
||||||
"space-in-parens": ["error", "never"],
|
|
||||||
"spaced-comment": [
|
|
||||||
"error",
|
|
||||||
"always",
|
|
||||||
{
|
|
||||||
markers: ["/"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"unicorn/filename-case": "error",
|
|
||||||
"unicorn/prefer-ternary": "error",
|
|
||||||
"use-isnan": "error",
|
|
||||||
"valid-typeof": "off",
|
|
||||||
"functional/immutable-data": [
|
|
||||||
"error",
|
|
||||||
{
|
|
||||||
assumeTypes: true,
|
|
||||||
ignoreImmediateMutation: true,
|
|
||||||
ignoreAccessorPattern: ["**.root*", "**.numberingReferences*", "**.sections*", "**.properties*"],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
"functional/prefer-property-signatures": "error",
|
|
||||||
"functional/no-mixed-types": "error",
|
|
||||||
// TODO: Deprecated. Use prefer-immutable-types and type-declaration-immutability instead
|
|
||||||
"functional/prefer-readonly-type": "error",
|
|
||||||
// "functional/prefer-immutable-types": "error",
|
|
||||||
// "functional/type-declaration-immutability": "error",
|
|
||||||
"no-unused-vars": ["error", { argsIgnorePattern: "^[_]+$" }],
|
|
||||||
},
|
|
||||||
overrides: [
|
|
||||||
{
|
|
||||||
files: ["*.spec.ts"],
|
|
||||||
rules: {
|
|
||||||
"@typescript-eslint/no-unused-expressions": "off",
|
|
||||||
"@typescript-eslint/dot-notation": "off",
|
|
||||||
"prefer-destructuring": "off",
|
|
||||||
"@typescript-eslint/explicit-function-return-type": "off",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
};
|
|
238
.eslintrc.yml
Normal file
238
.eslintrc.yml
Normal file
@ -0,0 +1,238 @@
|
|||||||
|
extends: eslint:recommended
|
||||||
|
env:
|
||||||
|
browser: true
|
||||||
|
es6: true
|
||||||
|
node: true
|
||||||
|
parser: "@typescript-eslint/parser"
|
||||||
|
parserOptions:
|
||||||
|
project:
|
||||||
|
- tsconfig.json
|
||||||
|
sourceType: module
|
||||||
|
plugins:
|
||||||
|
- eslint-plugin-import
|
||||||
|
- eslint-plugin-no-null
|
||||||
|
- eslint-plugin-unicorn
|
||||||
|
- eslint-plugin-jsdoc
|
||||||
|
- eslint-plugin-prefer-arrow
|
||||||
|
- "@typescript-eslint"
|
||||||
|
- eslint-plugin-functional
|
||||||
|
root: true
|
||||||
|
rules:
|
||||||
|
no-undef: "off"
|
||||||
|
no-extra-boolean-cast: "off"
|
||||||
|
no-alert: error
|
||||||
|
no-self-compare: error
|
||||||
|
no-unreachable-loop: error
|
||||||
|
no-template-curly-in-string: error
|
||||||
|
no-unused-private-class-members: error
|
||||||
|
no-extend-native: error
|
||||||
|
no-floating-decimal: error
|
||||||
|
no-implied-eval: error
|
||||||
|
no-iterator: error
|
||||||
|
no-lone-blocks: error
|
||||||
|
no-loop-func: error
|
||||||
|
no-new-object: error
|
||||||
|
no-proto: error
|
||||||
|
no-useless-catch: error
|
||||||
|
one-var-declaration-per-line: error
|
||||||
|
prefer-arrow-callback: error
|
||||||
|
prefer-destructuring: error
|
||||||
|
prefer-exponentiation-operator: error
|
||||||
|
prefer-promise-reject-errors: error
|
||||||
|
prefer-regex-literals: error
|
||||||
|
prefer-spread: error
|
||||||
|
prefer-template: error
|
||||||
|
require-await: error
|
||||||
|
"@typescript-eslint/adjacent-overload-signatures": error
|
||||||
|
"@typescript-eslint/array-type":
|
||||||
|
- error
|
||||||
|
- default: array
|
||||||
|
"@typescript-eslint/ban-types":
|
||||||
|
- error
|
||||||
|
- types:
|
||||||
|
Object:
|
||||||
|
message: Avoid using the `Object` type. Did you mean `object`?
|
||||||
|
Function:
|
||||||
|
message: >-
|
||||||
|
Avoid using the `Function` type. Prefer a specific function type,
|
||||||
|
like `() => void`.
|
||||||
|
Boolean:
|
||||||
|
message: Avoid using the `Boolean` type. Did you mean `boolean`?
|
||||||
|
Number:
|
||||||
|
message: Avoid using the `Number` type. Did you mean `number`?
|
||||||
|
String:
|
||||||
|
message: Avoid using the `String` type. Did you mean `string`?
|
||||||
|
Symbol:
|
||||||
|
message: Avoid using the `Symbol` type. Did you mean `symbol`?
|
||||||
|
"@typescript-eslint/consistent-type-assertions": error
|
||||||
|
"@typescript-eslint/dot-notation": error
|
||||||
|
"@typescript-eslint/explicit-function-return-type":
|
||||||
|
- error
|
||||||
|
- allowExpressions: true
|
||||||
|
allowTypedFunctionExpressions: true
|
||||||
|
allowHigherOrderFunctions: false
|
||||||
|
allowDirectConstAssertionInArrowFunctions: true
|
||||||
|
allowConciseArrowFunctionExpressionsStartingWithVoid: true
|
||||||
|
"@typescript-eslint/explicit-member-accessibility":
|
||||||
|
- error
|
||||||
|
- accessibility: explicit
|
||||||
|
overrides:
|
||||||
|
accessors: explicit
|
||||||
|
"@typescript-eslint/explicit-module-boundary-types":
|
||||||
|
- error
|
||||||
|
- allowArgumentsExplicitlyTypedAsAny: true
|
||||||
|
allowDirectConstAssertionInArrowFunctions: true
|
||||||
|
allowHigherOrderFunctions: false
|
||||||
|
allowTypedFunctionExpressions: false
|
||||||
|
"@typescript-eslint/naming-convention":
|
||||||
|
- error
|
||||||
|
- selector:
|
||||||
|
- objectLiteralProperty
|
||||||
|
leadingUnderscore: allow
|
||||||
|
format:
|
||||||
|
- camelCase
|
||||||
|
- PascalCase
|
||||||
|
- UPPER_CASE # for constants
|
||||||
|
filter:
|
||||||
|
regex: (^[a-z]+:.+)|_attr|[0-9]
|
||||||
|
match: false
|
||||||
|
"@typescript-eslint/no-empty-function": error
|
||||||
|
"@typescript-eslint/no-empty-interface": error
|
||||||
|
"@typescript-eslint/no-explicit-any": error
|
||||||
|
"@typescript-eslint/no-misused-new": error
|
||||||
|
"@typescript-eslint/no-namespace": error
|
||||||
|
"@typescript-eslint/no-parameter-properties": "off"
|
||||||
|
"@typescript-eslint/no-require-imports": error
|
||||||
|
"@typescript-eslint/no-shadow":
|
||||||
|
- error
|
||||||
|
- hoist: all
|
||||||
|
"@typescript-eslint/no-this-alias": error
|
||||||
|
"@typescript-eslint/no-unused-expressions": error
|
||||||
|
"@typescript-eslint/no-use-before-define": "off"
|
||||||
|
"@typescript-eslint/no-var-requires": error
|
||||||
|
"@typescript-eslint/prefer-for-of": error
|
||||||
|
"@typescript-eslint/prefer-function-type": error
|
||||||
|
"@typescript-eslint/prefer-namespace-keyword": error
|
||||||
|
"@typescript-eslint/prefer-readonly": error
|
||||||
|
"@typescript-eslint/triple-slash-reference":
|
||||||
|
- error
|
||||||
|
- path: always
|
||||||
|
types: prefer-import
|
||||||
|
lib: always
|
||||||
|
"@typescript-eslint/typedef":
|
||||||
|
- error
|
||||||
|
- parameter: true
|
||||||
|
propertyDeclaration: true
|
||||||
|
"@typescript-eslint/unified-signatures": error
|
||||||
|
arrow-body-style: error
|
||||||
|
complexity: "off"
|
||||||
|
consistent-return: error
|
||||||
|
constructor-super: error
|
||||||
|
curly: error
|
||||||
|
dot-notation: "off"
|
||||||
|
eqeqeq:
|
||||||
|
- error
|
||||||
|
- smart
|
||||||
|
guard-for-in: error
|
||||||
|
id-denylist:
|
||||||
|
- error
|
||||||
|
- any
|
||||||
|
- Number
|
||||||
|
- number
|
||||||
|
- String
|
||||||
|
- string
|
||||||
|
- Boolean
|
||||||
|
- boolean
|
||||||
|
- Undefined
|
||||||
|
- undefined
|
||||||
|
id-match: error
|
||||||
|
import/no-default-export: error
|
||||||
|
import/no-extraneous-dependencies: "off"
|
||||||
|
import/no-internal-modules: "off"
|
||||||
|
import/order: error
|
||||||
|
indent: "off"
|
||||||
|
jsdoc/check-alignment: error
|
||||||
|
jsdoc/check-indentation: "off"
|
||||||
|
max-classes-per-file: "off"
|
||||||
|
max-len: "off"
|
||||||
|
new-parens: error
|
||||||
|
no-bitwise: error
|
||||||
|
no-caller: error
|
||||||
|
no-cond-assign: error
|
||||||
|
no-console: error
|
||||||
|
no-debugger: error
|
||||||
|
no-duplicate-case: error
|
||||||
|
no-duplicate-imports: error
|
||||||
|
no-empty: error
|
||||||
|
no-empty-function: "off"
|
||||||
|
no-eval: error
|
||||||
|
no-extra-bind: error
|
||||||
|
no-fallthrough: "off"
|
||||||
|
no-invalid-this: "off"
|
||||||
|
no-multiple-empty-lines: error
|
||||||
|
no-new-func: error
|
||||||
|
no-new-wrappers: error
|
||||||
|
no-null/no-null: error
|
||||||
|
no-param-reassign: error
|
||||||
|
no-redeclare: error
|
||||||
|
no-return-await: error
|
||||||
|
no-sequences: error
|
||||||
|
no-shadow: "off"
|
||||||
|
no-sparse-arrays: error
|
||||||
|
no-throw-literal: error
|
||||||
|
no-trailing-spaces: error
|
||||||
|
no-undef-init: error
|
||||||
|
no-underscore-dangle:
|
||||||
|
- error
|
||||||
|
- allow:
|
||||||
|
- _attr
|
||||||
|
no-unsafe-finally: error
|
||||||
|
no-unused-expressions: "off"
|
||||||
|
no-unused-labels: error
|
||||||
|
no-use-before-define: "off"
|
||||||
|
no-useless-constructor: error
|
||||||
|
no-var: error
|
||||||
|
object-shorthand: "off"
|
||||||
|
one-var:
|
||||||
|
- error
|
||||||
|
- never
|
||||||
|
prefer-arrow/prefer-arrow-functions: error
|
||||||
|
prefer-const: error
|
||||||
|
prefer-object-spread: error
|
||||||
|
radix: error
|
||||||
|
space-in-parens:
|
||||||
|
- error
|
||||||
|
- never
|
||||||
|
spaced-comment:
|
||||||
|
- error
|
||||||
|
- always
|
||||||
|
- markers:
|
||||||
|
- /
|
||||||
|
unicorn/filename-case: error
|
||||||
|
unicorn/prefer-ternary: error
|
||||||
|
use-isnan: error
|
||||||
|
valid-typeof: "off"
|
||||||
|
functional/immutable-data:
|
||||||
|
- error
|
||||||
|
- ignoreImmediateMutation: true
|
||||||
|
ignoreAccessorPattern:
|
||||||
|
- "**.root*"
|
||||||
|
- "**.numberingReferences*"
|
||||||
|
- "**.sections*"
|
||||||
|
- "**.properties*"
|
||||||
|
functional/prefer-property-signatures: error
|
||||||
|
functional/no-mixed-types: error
|
||||||
|
functional/prefer-readonly-type: error
|
||||||
|
no-unused-vars:
|
||||||
|
- error
|
||||||
|
- argsIgnorePattern: ^[_]+$
|
||||||
|
ignorePatterns:
|
||||||
|
- vite.config.ts
|
||||||
|
overrides:
|
||||||
|
- files:
|
||||||
|
- "*.spec.ts"
|
||||||
|
rules:
|
||||||
|
"@typescript-eslint/no-unused-expressions": "off"
|
||||||
|
"@typescript-eslint/dot-notation": "off"
|
||||||
|
prefer-destructuring: "off"
|
||||||
|
"@typescript-eslint/explicit-function-return-type": "off"
|
12
.github/actions/install-and-build/action.yml
vendored
Normal file
12
.github/actions/install-and-build/action.yml
vendored
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
name: Install dependencies and build ⚙️
|
||||||
|
description: Install dependencies and build
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Install Dependencies
|
||||||
|
shell: bash
|
||||||
|
run: npm ci --force
|
||||||
|
- name: Build
|
||||||
|
shell: bash
|
||||||
|
run: npm run build
|
14
.github/actions/validate-docx/action.yml
vendored
Normal file
14
.github/actions/validate-docx/action.yml
vendored
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
name: Extract and Validate Document ⚙️
|
||||||
|
description: Extract the document and validate the XML against the schema.
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: composite
|
||||||
|
steps:
|
||||||
|
- name: Extract Word Document
|
||||||
|
shell: bash
|
||||||
|
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
|
33
.github/dependabot.yml
vendored
33
.github/dependabot.yml
vendored
@ -5,36 +5,3 @@ updates:
|
|||||||
schedule:
|
schedule:
|
||||||
interval: daily
|
interval: daily
|
||||||
open-pull-requests-limit: 10
|
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
|
|
||||||
|
9
.github/workflows/default.yml
vendored
9
.github/workflows/default.yml
vendored
@ -14,10 +14,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- name: Checkout Repo
|
||||||
uses: actions/checkout@master
|
uses: actions/checkout@master
|
||||||
- name: Install Dependencies
|
- uses: "./.github/actions/install-and-build"
|
||||||
run: npm ci --force
|
|
||||||
- name: Build
|
|
||||||
run: npm run build
|
|
||||||
- name: Archive Production Artifact
|
- name: Archive Production Artifact
|
||||||
uses: actions/upload-artifact@master
|
uses: actions/upload-artifact@master
|
||||||
with:
|
with:
|
||||||
@ -32,7 +29,7 @@ jobs:
|
|||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm ci --force
|
run: npm ci --force
|
||||||
- name: Test
|
- name: Test
|
||||||
run: npm run test.coverage
|
run: npm run test:ci
|
||||||
- name: Codecov
|
- name: Codecov
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v3
|
||||||
with:
|
with:
|
||||||
@ -57,7 +54,7 @@ jobs:
|
|||||||
- name: Install Dependencies
|
- name: Install Dependencies
|
||||||
run: npm ci --force
|
run: npm ci --force
|
||||||
- name: Prettier
|
- name: Prettier
|
||||||
run: npm run style
|
run: npm run prettier
|
||||||
cspell:
|
cspell:
|
||||||
name: CSpell
|
name: CSpell
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
943
.github/workflows/demos.yml
vendored
943
.github/workflows/demos.yml
vendored
@ -8,792 +8,189 @@ on:
|
|||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
|
||||||
name: Build
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout Repo
|
|
||||||
uses: actions/checkout@master
|
|
||||||
- name: Install Dependencies
|
|
||||||
run: npm ci --force
|
|
||||||
- name: Build
|
|
||||||
run: npm run build
|
|
||||||
- name: Archive Production Artifact
|
|
||||||
uses: actions/upload-artifact@master
|
|
||||||
with:
|
|
||||||
name: build
|
|
||||||
path: build
|
|
||||||
demos:
|
demos:
|
||||||
name: Run Demos and Validate
|
name: Demos
|
||||||
needs: [build]
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repo
|
- uses: actions/checkout@master
|
||||||
uses: actions/checkout@master
|
- uses: "./.github/actions/install-and-build"
|
||||||
- name: Install Dependencies
|
- name: Run Demos
|
||||||
run: npm ci --force
|
run: npm run run-ts -- ./demo/1-basic.ts
|
||||||
- name: Download Artifact
|
- uses: "./.github/actions/validate-docx"
|
||||||
uses: actions/download-artifact@master
|
- run: npm run run-ts -- ./demo/2-declaritive-styles.ts
|
||||||
with:
|
- uses: "./.github/actions/validate-docx"
|
||||||
name: build
|
- run: npm run run-ts -- ./demo/3-numbering-and-bullet-points.ts
|
||||||
path: build
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Run Demo
|
- run: npm run run-ts -- ./demo/4-basic-table.ts
|
||||||
run: npm run ts-node -- ./demo/1-basic.ts
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Extract Word Document
|
- run: npm run run-ts -- ./demo/5-images.ts
|
||||||
run: npm run extract
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Validate XML
|
- run: npm run run-ts -- ./demo/6-page-borders.ts
|
||||||
uses: ChristophWurst/xmllint-action@v1
|
- uses: "./.github/actions/validate-docx"
|
||||||
with:
|
- run: npm run run-ts -- ./demo/7-landscape.ts
|
||||||
xml-file: build/extracted-doc/word/document.xml
|
- uses: "./.github/actions/validate-docx"
|
||||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- run: npm run run-ts -- ./demo/8-header-footer.ts
|
||||||
- name: Run Demo
|
- uses: "./.github/actions/validate-docx"
|
||||||
run: npm run ts-node -- ./demo/2-declaritive-styles.ts
|
- run: npm run run-ts -- ./demo/9-images-in-header-and-footer.ts
|
||||||
- name: Extract Word Document
|
- uses: "./.github/actions/validate-docx"
|
||||||
run: npm run extract
|
- run: npm run run-ts -- ./demo/10-my-cv.ts
|
||||||
- name: Validate XML
|
- uses: "./.github/actions/validate-docx"
|
||||||
uses: ChristophWurst/xmllint-action@v1
|
- run: npm run run-ts -- ./demo/11-declaritive-styles-2.ts
|
||||||
with:
|
- uses: "./.github/actions/validate-docx"
|
||||||
xml-file: build/extracted-doc/word/document.xml
|
- run: npm run run-ts -- ./demo/12-scaling-images.ts
|
||||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Run Demo
|
- run: npm run run-ts -- ./demo/13-xml-styles.ts
|
||||||
run: npm run ts-node -- ./demo/3-numbering-and-bullet-points.ts
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Extract Word Document
|
- run: npm run run-ts -- ./demo/14-page-numbers.ts
|
||||||
run: npm run extract
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Validate XML
|
- run: npm run run-ts -- ./demo/15-page-break-before.ts
|
||||||
uses: ChristophWurst/xmllint-action@v1
|
- uses: "./.github/actions/validate-docx"
|
||||||
with:
|
- run: npm run run-ts -- ./demo/16-multiple-sections.ts
|
||||||
xml-file: build/extracted-doc/word/document.xml
|
- uses: "./.github/actions/validate-docx"
|
||||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- run: npm run run-ts -- ./demo/17-footnotes.ts
|
||||||
- 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.
|
# element r: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}r': This element is not expected.
|
||||||
# - name: Validate XML
|
# - uses: "./.github/actions/validate-docx"
|
||||||
# uses: ChristophWurst/xmllint-action@v1
|
- run: npm run run-ts -- ./demo/18-image-from-buffer.ts
|
||||||
# with:
|
- uses: "./.github/actions/validate-docx"
|
||||||
# xml-file: build/extracted-doc/word/document.xml
|
- run: npm run run-ts -- ./demo/19-export-to-base64.ts
|
||||||
# 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
|
|
||||||
# Base 64 No longer works, abruptly. Node issue?
|
# Base 64 No longer works, abruptly. Node issue?
|
||||||
# - name: Extract Word Document
|
# - uses: "./.github/actions/validate-docx"
|
||||||
# run: npm run extract
|
- run: npm run run-ts -- ./demo/20-table-cell-borders.ts
|
||||||
# - name: Validate XML
|
- uses: "./.github/actions/validate-docx"
|
||||||
# uses: ChristophWurst/xmllint-action@v1
|
- run: npm run run-ts -- ./demo/21-bookmarks.ts
|
||||||
# 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
|
# Bad ID - need numeric ID
|
||||||
# - name: Validate XML
|
# - uses: "./.github/actions/validate-docx"
|
||||||
# uses: ChristophWurst/xmllint-action@v1
|
- run: npm run run-ts -- ./demo/22-right-to-left-text.ts
|
||||||
# with:
|
- uses: "./.github/actions/validate-docx"
|
||||||
# xml-file: build/extracted-doc/word/document.xml
|
- run: npm run run-ts -- ./demo/23-base64-images.ts
|
||||||
# xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Run Demo
|
- run: npm run run-ts -- ./demo/24-images-to-table-cell.ts
|
||||||
run: npm run ts-node -- ./demo/22-right-to-left-text.ts
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Extract Word Document
|
- run: npm run run-ts -- ./demo/25-table-xml-styles.ts
|
||||||
run: npm run extract
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Validate XML
|
- run: npm run run-ts -- ./demo/26-paragraph-borders.ts
|
||||||
uses: ChristophWurst/xmllint-action@v1
|
- uses: "./.github/actions/validate-docx"
|
||||||
with:
|
- run: npm run run-ts -- ./demo/27-declaritive-styles-3.ts
|
||||||
xml-file: build/extracted-doc/word/document.xml
|
- uses: "./.github/actions/validate-docx"
|
||||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- run: npm run run-ts -- ./demo/28-table-of-contents.ts
|
||||||
- name: Run Demo
|
- uses: "./.github/actions/validate-docx"
|
||||||
run: npm run ts-node -- ./demo/23-base64-images.ts
|
- run: npm run run-ts -- ./demo/29-numbered-lists.ts
|
||||||
- name: Extract Word Document
|
- uses: "./.github/actions/validate-docx"
|
||||||
run: npm run extract
|
- run: npm run run-ts -- ./demo/31-tables.ts
|
||||||
- name: Validate XML
|
- uses: "./.github/actions/validate-docx"
|
||||||
uses: ChristophWurst/xmllint-action@v1
|
- run: npm run run-ts -- ./demo/32-merge-and-shade-table-cells.ts
|
||||||
with:
|
- uses: "./.github/actions/validate-docx"
|
||||||
xml-file: build/extracted-doc/word/document.xml
|
- run: npm run run-ts -- ./demo/33-sequential-captions.ts
|
||||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Run Demo
|
- run: npm run run-ts -- ./demo/34-floating-tables.ts
|
||||||
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/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', 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.
|
# 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: "./.github/actions/validate-docx"
|
||||||
# uses: ChristophWurst/xmllint-action@v1
|
- run: npm run run-ts -- ./demo/35-hyperlinks.ts
|
||||||
# with:
|
- uses: "./.github/actions/validate-docx"
|
||||||
# xml-file: build/extracted-doc/word/document.xml
|
- run: npm run run-ts -- ./demo/36-image-to-table-cell.ts
|
||||||
# xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Run Demo
|
- run: npm run run-ts -- ./demo/37-images-to-header-and-footer.ts
|
||||||
run: npm run ts-node -- ./demo/35-hyperlinks.ts
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Extract Word Document
|
- run: npm run run-ts -- ./demo/38-text-wrapping.ts
|
||||||
run: npm run extract
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Validate XML
|
- run: npm run run-ts -- ./demo/39-page-numbers.ts
|
||||||
uses: ChristophWurst/xmllint-action@v1
|
- uses: "./.github/actions/validate-docx"
|
||||||
with:
|
- run: npm run run-ts -- ./demo/40-line-numbers.ts
|
||||||
xml-file: build/extracted-doc/word/document.xml
|
- uses: "./.github/actions/validate-docx"
|
||||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- run: npm run run-ts -- ./demo/41-merge-table-cells-2.ts
|
||||||
- name: Run Demo
|
- uses: "./.github/actions/validate-docx"
|
||||||
run: npm run ts-node -- ./demo/36-image-to-table-cell.ts
|
- run: npm run run-ts -- ./demo/42-restart-page-numbers.ts
|
||||||
- name: Extract Word Document
|
- uses: "./.github/actions/validate-docx"
|
||||||
run: npm run extract
|
- run: npm run run-ts -- ./demo/43-images-to-table-cell-2.ts
|
||||||
- name: Validate XML
|
- uses: "./.github/actions/validate-docx"
|
||||||
uses: ChristophWurst/xmllint-action@v1
|
- run: npm run run-ts -- ./demo/44-multiple-columns.ts
|
||||||
with:
|
- uses: "./.github/actions/validate-docx"
|
||||||
xml-file: build/extracted-doc/word/document.xml
|
- run: npm run run-ts -- ./demo/45-highlighting-text.ts
|
||||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Run Demo
|
- run: npm run run-ts -- ./demo/46-shading-text.ts
|
||||||
run: npm run ts-node -- ./demo/37-images-to-header-and-footer.ts
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Extract Word Document
|
- run: npm run run-ts -- ./demo/47-number-of-total-pages-section.ts
|
||||||
run: npm run extract
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Validate XML
|
- run: npm run run-ts -- ./demo/48-vertical-align.ts
|
||||||
uses: ChristophWurst/xmllint-action@v1
|
- uses: "./.github/actions/validate-docx"
|
||||||
with:
|
- run: npm run run-ts -- ./demo/49-table-borders.ts
|
||||||
xml-file: build/extracted-doc/word/document.xml
|
- uses: "./.github/actions/validate-docx"
|
||||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- run: npm run run-ts -- ./demo/50-readme-demo.ts
|
||||||
- name: Run Demo
|
- uses: "./.github/actions/validate-docx"
|
||||||
run: npm run ts-node -- ./demo/38-text-wrapping.ts
|
- run: npm run run-ts -- ./demo/51-character-styles.ts
|
||||||
- name: Extract Word Document
|
- uses: "./.github/actions/validate-docx"
|
||||||
run: npm run extract
|
- run: npm run run-ts -- ./demo/52-japanese.ts
|
||||||
- name: Validate XML
|
- uses: "./.github/actions/validate-docx"
|
||||||
uses: ChristophWurst/xmllint-action@v1
|
- run: npm run run-ts -- ./demo/53-chinese.ts
|
||||||
with:
|
- uses: "./.github/actions/validate-docx"
|
||||||
xml-file: build/extracted-doc/word/document.xml
|
- run: npm run run-ts -- ./demo/54-custom-properties.ts
|
||||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Run Demo
|
- run: npm run run-ts -- ./demo/55-math.ts
|
||||||
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 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}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}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 ).
|
#: 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: "./.github/actions/validate-docx"
|
||||||
# uses: ChristophWurst/xmllint-action@v1
|
- run: npm run run-ts -- ./demo/56-background-color.ts
|
||||||
# with:
|
- uses: "./.github/actions/validate-docx"
|
||||||
# xml-file: build/extracted-doc/word/document.xml
|
- run: npm run run-ts -- ./demo/57-add-parent-numbered-lists.ts
|
||||||
# xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Run Demo
|
- run: npm run run-ts -- ./demo/58-section-types.ts
|
||||||
run: npm run ts-node -- ./demo/56-background-color.ts
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Extract Word Document
|
- run: npm run run-ts -- ./demo/59-header-footer-margins.ts
|
||||||
run: npm run extract
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Validate XML
|
- run: npm run run-ts -- ./demo/60-track-revisions.ts
|
||||||
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.
|
# element r: Schemas validity error : Element '{http://schemas.openxmlformats.org/wordprocessingml/2006/main}r': This element is not expected.
|
||||||
# - name: Validate XML
|
# - uses: "./.github/actions/validate-docx"
|
||||||
# uses: ChristophWurst/xmllint-action@v1
|
- run: npm run run-ts -- ./demo/61-text-frame.ts
|
||||||
# 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 ).
|
# 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: "./.github/actions/validate-docx"
|
||||||
# uses: ChristophWurst/xmllint-action@v1
|
- run: npm run run-ts -- ./demo/62-paragraph-spacing.ts
|
||||||
# with:
|
- uses: "./.github/actions/validate-docx"
|
||||||
# xml-file: build/extracted-doc/word/document.xml
|
- run: npm run run-ts -- ./demo/63-odd-even-header-footer.ts
|
||||||
# xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Run Demo
|
- run: npm run run-ts -- ./demo/64-complex-numbering-text.ts
|
||||||
run: npm run ts-node -- ./demo/62-paragraph-spacing.ts
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Extract Word Document
|
- run: npm run run-ts -- ./demo/65-page-sizes.ts
|
||||||
run: npm run extract
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Validate XML
|
- run: npm run run-ts -- ./demo/66-fields.ts
|
||||||
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 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'.
|
# 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: "./.github/actions/validate-docx"
|
||||||
# uses: ChristophWurst/xmllint-action@v1
|
- run: npm run run-ts -- ./demo/67-column-break.ts
|
||||||
# with:
|
- uses: "./.github/actions/validate-docx"
|
||||||
# xml-file: build/extracted-doc/word/document.xml
|
- run: npm run run-ts -- ./demo/68-numbering-instances-and-starting-number.ts
|
||||||
# xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Run Demo
|
- run: npm run run-ts -- ./demo/69-different-width-columns.ts
|
||||||
run: npm run ts-node -- ./demo/67-column-break.ts
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Extract Word Document
|
- run: npm run run-ts -- ./demo/70-line-numbers-suppression.ts
|
||||||
run: npm run extract
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Validate XML
|
- run: npm run run-ts -- ./demo/71-page-borders-2.ts
|
||||||
uses: ChristophWurst/xmllint-action@v1
|
- uses: "./.github/actions/validate-docx"
|
||||||
with:
|
- run: npm run run-ts -- ./demo/72-word-wrap.ts
|
||||||
xml-file: build/extracted-doc/word/document.xml
|
- uses: "./.github/actions/validate-docx"
|
||||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- run: npm run run-ts -- ./demo/73-comments.ts
|
||||||
- name: Run Demo
|
- uses: "./.github/actions/validate-docx"
|
||||||
run: npm run ts-node -- ./demo/68-numbering-instances-and-starting-number.ts
|
- run: npm run run-ts -- ./demo/74-nodejs-stream.ts
|
||||||
- name: Extract Word Document
|
# - uses: "./.github/actions/validate-docx"
|
||||||
run: npm run extract
|
# run: npm run run-ts -- ./demo/75-tab-stops.ts
|
||||||
- name: Validate XML
|
# - uses: "./.github/actions/validate-docx"
|
||||||
uses: ChristophWurst/xmllint-action@v1
|
- run: npm run run-ts -- ./demo/76-compatibility.ts
|
||||||
with:
|
- uses: "./.github/actions/validate-docx"
|
||||||
xml-file: build/extracted-doc/word/document.xml
|
- run: npm run run-ts -- ./demo/77-side-by-side-tables.ts
|
||||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Run Demo
|
- run: npm run run-ts -- ./demo/78-thai-distributed.ts
|
||||||
run: npm run ts-node -- ./demo/69-different-width-columns.ts
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Extract Word Document
|
- run: npm run run-ts -- ./demo/79-table-from-data-source.ts
|
||||||
run: npm run extract
|
- uses: "./.github/actions/validate-docx"
|
||||||
- name: Validate XML
|
- run: npm run run-ts -- ./demo/80-thai-distributed.ts
|
||||||
uses: ChristophWurst/xmllint-action@v1
|
- uses: "./.github/actions/validate-docx"
|
||||||
with:
|
- run: npm run run-ts -- ./demo/81-continuous-header.ts
|
||||||
xml-file: build/extracted-doc/word/document.xml
|
- uses: "./.github/actions/validate-docx"
|
||||||
xml-schema-file: ooxml-schemas/microsoft/wml-2010.xsd
|
- run: npm run run-ts -- ./demo/82-new-headers-new-section.ts
|
||||||
- name: Run Demo
|
- uses: "./.github/actions/validate-docx"
|
||||||
run: npm run ts-node -- ./demo/70-line-numbers-suppression.ts
|
- run: npm run run-ts -- ./demo/83-setting-languages.ts
|
||||||
- name: Extract Word Document
|
- uses: "./.github/actions/validate-docx"
|
||||||
run: npm run extract
|
- run: npm run run-ts -- ./demo/84-positional-tabs.ts
|
||||||
- name: Validate XML
|
- uses: "./.github/actions/validate-docx"
|
||||||
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
|
|
||||||
- name: Run Demo
|
|
||||||
run: npm run ts-node -- ./demo/72-word-wrap.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/73-comments.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/73-comments.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/75-tab-stops.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/76-compatibility.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/77-side-by-side-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/78-thai-distributed.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/79-table-from-data-source.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/80-thai-distributed.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/81-continuous-header.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/82-new-headers-new-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/83-setting-languages.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/84-positional-tabs.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
|
|
||||||
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -60,5 +60,5 @@ My Document.docx
|
|||||||
# Temporary folder
|
# Temporary folder
|
||||||
tmp
|
tmp
|
||||||
|
|
||||||
# nyc
|
# Exclude Mac .DS_Store files
|
||||||
.nyc_output
|
.DS_Store
|
||||||
|
@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"diff": true,
|
|
||||||
"spec": "src/**/*.ts",
|
|
||||||
"extension": ["ts"],
|
|
||||||
"package": "./package.json",
|
|
||||||
"reporter": "spec",
|
|
||||||
"slow": "75",
|
|
||||||
"timeout": "2000",
|
|
||||||
"ui": "bdd",
|
|
||||||
"watch-files": ["src/**/*.ts"],
|
|
||||||
"watch-ignore": ["build", "demo"],
|
|
||||||
"require": ["mocha.env", "ts-node/register", "tsconfig-paths/register"]
|
|
||||||
}
|
|
25
.nycrc
25
.nycrc
@ -1,25 +0,0 @@
|
|||||||
{
|
|
||||||
"check-coverage": true,
|
|
||||||
"statements": 99.87,
|
|
||||||
"branches": 98.21,
|
|
||||||
"functions": 100,
|
|
||||||
"lines": 99.86,
|
|
||||||
"include": [
|
|
||||||
"src/**/*.ts"
|
|
||||||
],
|
|
||||||
"exclude": [
|
|
||||||
"src/**/*.spec.ts",
|
|
||||||
"src/import-dotx/import-dotx.ts"
|
|
||||||
],
|
|
||||||
"reporter": [
|
|
||||||
"lcov",
|
|
||||||
"text",
|
|
||||||
"json"
|
|
||||||
],
|
|
||||||
"extension": [
|
|
||||||
".ts"
|
|
||||||
],
|
|
||||||
"cache": true,
|
|
||||||
"all": true,
|
|
||||||
"sourceMap": true
|
|
||||||
}
|
|
16
.vscode/launch.json
vendored
16
.vscode/launch.json
vendored
@ -1,18 +1,4 @@
|
|||||||
{
|
{
|
||||||
"version": "0.2.0",
|
"version": "0.2.0",
|
||||||
"configurations": [
|
"configurations": []
|
||||||
{
|
|
||||||
"name": "Run Demo",
|
|
||||||
"type": "node",
|
|
||||||
"request": "launch",
|
|
||||||
"runtimeArgs": [
|
|
||||||
"-r",
|
|
||||||
"${workspaceFolder}/node_modules/ts-node/register",
|
|
||||||
"-r",
|
|
||||||
"${workspaceFolder}/node_modules/tsconfig-paths/register"
|
|
||||||
],
|
|
||||||
"cwd": "${workspaceRoot}",
|
|
||||||
"program": "${workspaceFolder}/demo/85-template-document.ts"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
20
.vscode/tasks.json
vendored
20
.vscode/tasks.json
vendored
@ -2,23 +2,5 @@
|
|||||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
// for the documentation about the tasks.json format
|
// for the documentation about the tasks.json format
|
||||||
"version": "2.0.0",
|
"version": "2.0.0",
|
||||||
"tasks": [
|
"tasks": []
|
||||||
{
|
|
||||||
"type": "typescript",
|
|
||||||
"tsconfig": "tsconfig.json",
|
|
||||||
"option": "watch",
|
|
||||||
"problemMatcher": [
|
|
||||||
"$tsc-watch"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "npm",
|
|
||||||
"script": "ts-node",
|
|
||||||
"problemMatcher": [],
|
|
||||||
"group": {
|
|
||||||
"kind": "build",
|
|
||||||
"isDefault": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
}
|
@ -12,7 +12,6 @@
|
|||||||
[![Downloads per month][downloads-image]][downloads-url]
|
[![Downloads per month][downloads-image]][downloads-url]
|
||||||
[![GitHub Action Workflow Status][github-actions-workflow-image]][github-actions-workflow-url]
|
[![GitHub Action Workflow Status][github-actions-workflow-image]][github-actions-workflow-url]
|
||||||
[![Known Vulnerabilities][snky-image]][snky-url]
|
[![Known Vulnerabilities][snky-image]][snky-url]
|
||||||
[![Chat on Gitter][gitter-image]][gitter-url]
|
|
||||||
[![PRs Welcome][pr-image]][pr-url]
|
[![PRs Welcome][pr-image]][pr-url]
|
||||||
[![codecov][codecov-image]][codecov-url]
|
[![codecov][codecov-image]][codecov-url]
|
||||||
|
|
||||||
@ -107,8 +106,6 @@ Made with 💖
|
|||||||
[github-actions-workflow-url]: https://github.com/dolanmiu/docx/actions
|
[github-actions-workflow-url]: https://github.com/dolanmiu/docx/actions
|
||||||
[snky-image]: https://snyk.io/test/github/dolanmiu/docx/badge.svg
|
[snky-image]: https://snyk.io/test/github/dolanmiu/docx/badge.svg
|
||||||
[snky-url]: https://snyk.io/test/github/dolanmiu/docx
|
[snky-url]: https://snyk.io/test/github/dolanmiu/docx
|
||||||
[gitter-image]: https://badges.gitter.im/dolanmiu/docx.svg
|
|
||||||
[gitter-url]: https://gitter.im/docx-lib/Lobby
|
|
||||||
[pr-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
|
[pr-image]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
|
||||||
[pr-url]: http://makeapullrequest.com
|
[pr-url]: http://makeapullrequest.com
|
||||||
[codecov-image]: https://codecov.io/gh/dolanmiu/docx/branch/master/graph/badge.svg
|
[codecov-image]: https://codecov.io/gh/dolanmiu/docx/branch/master/graph/badge.svg
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Simple example to add text to a document
|
// 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 * as fs from "fs";
|
||||||
import { Document, Packer, Paragraph, Tab, TextRun } from "../build";
|
import { Document, Packer, Paragraph, Tab, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Generate a CV
|
// Generate a CV
|
||||||
// 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, Tab, TabStopPosition, TabStopType, TextRun } from "../build";
|
import { AlignmentType, Document, HeadingLevel, Packer, Paragraph, Tab, TabStopPosition, TabStopType, TextRun } from "docx";
|
||||||
|
|
||||||
// tslint:disable:no-shadowed-variable
|
// tslint:disable:no-shadowed-variable
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Setting styles with JavaScript configuration
|
// Setting styles with JavaScript configuration
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import {
|
import {
|
||||||
AlignmentType,
|
AlignmentType,
|
||||||
@ -16,7 +16,7 @@ import {
|
|||||||
TabStopPosition,
|
TabStopPosition,
|
||||||
UnderlineType,
|
UnderlineType,
|
||||||
LevelFormat,
|
LevelFormat,
|
||||||
} from "../build";
|
} from "docx";
|
||||||
|
|
||||||
const table = new Table({
|
const table = new Table({
|
||||||
rows: [
|
rows: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Scaling images
|
// Scaling images
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, ImageRun, Packer, Paragraph } from "../build";
|
import { Document, ImageRun, Packer, Paragraph } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// This example shows 3 styles using XML styles
|
// This example shows 3 styles using XML styles
|
||||||
// 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 } from "../build";
|
import { Document, HeadingLevel, Packer, Paragraph } from "docx";
|
||||||
|
|
||||||
const styles = fs.readFileSync("./demo/assets/custom-styles.xml", "utf-8");
|
const styles = fs.readFileSync("./demo/assets/custom-styles.xml", "utf-8");
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Page numbers
|
// Page numbers
|
||||||
// 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, Paragraph, TextRun } from "../build";
|
import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
@ -45,7 +45,7 @@ const doc = new Document({
|
|||||||
children: [
|
children: [
|
||||||
new TextRun("My Title "),
|
new TextRun("My Title "),
|
||||||
new TextRun({
|
new TextRun({
|
||||||
children: ["Footer - Page ", PageNumber.CURRENT],
|
children: ["Footer - Page ", PageNumber.CURRENT, " of ", PageNumber.TOTAL_PAGES],
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Page break before example
|
// Page break before example
|
||||||
// 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 "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Multiple sections and headers
|
// Multiple sections and headers
|
||||||
// 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, NumberFormat, PageOrientation, Paragraph, TextRun } from "../build";
|
import { Document, Footer, Header, Packer, PageNumber, NumberFormat, PageOrientation, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Footnotes
|
// Footnotes
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, FootnoteReferenceRun, Packer, Paragraph, TextRun } from "../build";
|
import { Document, FootnoteReferenceRun, Packer, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
footnotes: {
|
footnotes: {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Insert image from a buffer
|
// Insert image from a buffer
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, ImageRun, Packer, Paragraph } from "../build";
|
import { Document, ImageRun, Packer, Paragraph } from "docx";
|
||||||
|
|
||||||
const imageBase64Data = `iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAACzVBMVEUAAAAAAAAAAAAAAAA/AD8zMzMqKiokJCQfHx8cHBwZGRkuFxcqFSonJyckJCQiIiIfHx8eHh4cHBwoGhomGSYkJCQhISEfHx8eHh4nHR0lHBwkGyQjIyMiIiIgICAfHx8mHh4lHh4kHR0jHCMiGyIhISEgICAfHx8lHx8kHh4jHR0hHCEhISEgICAlHx8kHx8jHh4jHh4iHSIhHCEhISElICAkHx8jHx8jHh4iHh4iHSIhHSElICAkICAjHx8jHx8iHh4iHh4hHiEhHSEkICAjHx8iHx8iHx8hHh4hHiEkHSEjHSAjHx8iHx8iHx8hHh4kHiEkHiEjHSAiHx8hHx8hHh4kHiEjHiAjHSAiHx8iHx8hHx8kHh4jHiEjHiAjHiAiICAiHx8kHx8jHh4jHiEjHiAiHiAiHSAiHx8jHx8jHx8jHiAiHiAiHiAiHSAiHx8jHx8jHx8iHiAiHiAiHiAjHx8jHx8jHx8jHx8iHiAiH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Fk9DcStXxpdfCD2MoXodu4RUU9ptxxmXssOfxnvDVcxRTod9FxyhqLoAqis5aPhwTDp9spRgEH2Q6KLbYoKqlaKTm6Isp0C/sJMnjFvhiERXPQvUNRe9p29lhR04CdBpC8Sl8YiuncIxEuzUUg4Dkgj+paVozygY9plPMh28SaymO9kabAopREGF3vt9MzeFFl8G7lRSZ8FFGK8XX4VA8QjEd7XrM3M0OXz8YCy+qKBLgq3wqnofiTorF0Ax56Rg1J1elW+BBAsVe+My6iYq7IK6keBdOIseV2qn5Pb8f3MqkWAXf9ThM8c8lAOIotuFsF875lRrH5klRcG0+xcPwQ1oLxfeRAP4heQTnGL78X2rqlw2DK59SXAV/zKaiGMAuko5InCt68mcOan5+ohf+z1pP8lQY/GHZQMV4YD3FpXDp4qerqbF/lBWBswyi+AL+ia+maLgcRRQj4IYlY/UpauqKBsPJAxQF8NM1TRQ/RudSPAD34rK3scOuR8/HGcspxsJfOVS8NZbiGXiUtPgINU3v3WFDmx8pEuG3EiqKKVbCC1vm2iZqap5LAtCtleQf8F9sFYWDohzeJczYyQ4V2bEZFGsQgJRGqqqhS2phHTWn9lDkIhBTqWqxQZ+IsRvtdHY9AvI2VX2hW68nfqGmuQsCEl3JdjfCF8OW1bPdtwhQ0gm2mQzfRE3a7KCYj0BNZJs8+Kxf/r6WtTEI2FIqlsMfFgRB5A6KUnSe/vUkX0AnuvUIt8SjM1m6wWQymUwmk8lkMgXRf5vi8rLQxtUhAAAAAElFTkSuQmCC`;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Export to base64 string - Useful in a browser environment.
|
// Export to base64 string - Useful in a browser environment.
|
||||||
// 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, Tab, TextRun } from "../build";
|
import { Document, Packer, Paragraph, Tab, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,17 +1,7 @@
|
|||||||
// Example on how to customize the look at feel using Styles
|
// Example on how to customize the look at feel using Styles
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import {
|
import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, LevelFormat, Packer, Paragraph, TextRun, UnderlineType } from "docx";
|
||||||
AlignmentType,
|
|
||||||
convertInchesToTwip,
|
|
||||||
Document,
|
|
||||||
HeadingLevel,
|
|
||||||
LevelFormat,
|
|
||||||
Packer,
|
|
||||||
Paragraph,
|
|
||||||
TextRun,
|
|
||||||
UnderlineType,
|
|
||||||
} from "../build";
|
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
creator: "Clippy",
|
creator: "Clippy",
|
||||||
@ -53,6 +43,15 @@ const doc = new Document({
|
|||||||
color: "#FF0000",
|
color: "#FF0000",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
document: {
|
||||||
|
run: {
|
||||||
|
size: "11pt",
|
||||||
|
font: "Calibri",
|
||||||
|
},
|
||||||
|
paragraph: {
|
||||||
|
alignment: AlignmentType.RIGHT,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
paragraphStyles: [
|
paragraphStyles: [
|
||||||
{
|
{
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Add custom borders to table cell
|
// Add custom borders to table cell
|
||||||
// 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, Document, Packer, Paragraph, Table, TableCell, TableRow } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,18 +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 * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import {
|
import { Bookmark, Document, Footer, HeadingLevel, InternalHyperlink, Packer, PageBreak, Paragraph, TextRun, PageReference } from "docx";
|
||||||
Bookmark,
|
|
||||||
Document,
|
|
||||||
Footer,
|
|
||||||
HeadingLevel,
|
|
||||||
InternalHyperlink,
|
|
||||||
Packer,
|
|
||||||
PageBreak,
|
|
||||||
Paragraph,
|
|
||||||
TextRun,
|
|
||||||
PageReference,
|
|
||||||
} from "../build";
|
|
||||||
|
|
||||||
const LOREM_IPSUM =
|
const LOREM_IPSUM =
|
||||||
/* cspell:disable-next-line */
|
/* cspell:disable-next-line */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// 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 * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, Packer, Paragraph, Table, TableCell, TableRow, TextRun } from "../build";
|
import { Document, Packer, Paragraph, Table, TableCell, TableRow, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// 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 * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, ImageRun, Packer, Paragraph, TextRun } from "../build";
|
import { Document, ImageRun, Packer, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const imageBase64Data = `iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAACzVBMVEUAAAAAAAAAAAAAAAA/AD8zMzMqKiokJCQfHx8cHBwZGRkuFxcqFSonJyckJCQiIiIfHx8eHh4cHBwoGhomGSYkJCQhISEf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twhQ0gm2mQzfRE3a7KCYj0BNZJs8+Kxf/r6WtTEI2FIqlsMfFgRB5A6KUnSe/vUkX0AnuvUIt8SjM1m6wWQymUwmk8lkMgXRf5vi8rLQxtUhAAAAAElFTkSuQmCC`;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Add image to table cell
|
// Add image to table cell
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, ImageRun, Packer, Paragraph, Table, TableCell, TableRow } from "../build";
|
import { Document, ImageRun, Packer, Paragraph, Table, TableCell, TableRow } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// 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 * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, Packer, Paragraph, Table, TableCell, TableRow, WidthType } from "../build";
|
import { Document, Packer, Paragraph, Table, TableCell, TableRow, WidthType } from "docx";
|
||||||
|
|
||||||
const styles = fs.readFileSync("./demo/assets/custom-styles.xml", "utf-8");
|
const styles = fs.readFileSync("./demo/assets/custom-styles.xml", "utf-8");
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// 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 * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { BorderStyle, Document, Packer, Paragraph, TextRun } from "../build";
|
import { BorderStyle, Document, Packer, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -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 * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, convertInchesToTwip, HeadingLevel, Packer, Paragraph, UnderlineType } from "../build";
|
import { Document, convertInchesToTwip, HeadingLevel, Packer, Paragraph, UnderlineType } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
styles: {
|
styles: {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Table of contents
|
// Table of contents
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
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 "docx";
|
||||||
|
|
||||||
// WordprocessingML docs for TableOfContents can be found here:
|
// WordprocessingML docs for TableOfContents can be found here:
|
||||||
// http://officeopenxml.com/WPtableOfContents.php
|
// http://officeopenxml.com/WPtableOfContents.php
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// Numbered lists
|
// Numbered lists
|
||||||
// The lists can also be restarted by specifying the instance number
|
// The lists can also be restarted by specifying the instance number
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, LevelFormat, Packer, Paragraph } from "../build";
|
import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, LevelFormat, Packer, Paragraph } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
numbering: {
|
numbering: {
|
||||||
|
@ -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 * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { AlignmentType, convertInchesToTwip, Document, Footer, Header, HeadingLevel, LevelFormat, Packer, Paragraph } from "../build";
|
import { AlignmentType, convertInchesToTwip, Document, Footer, Header, HeadingLevel, LevelFormat, Packer, Paragraph } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
numbering: {
|
numbering: {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// 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 * 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 "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
// Example of how you would merge cells together (Rows and Columns) and apply shading
|
// Example of how you would merge cells together (Rows and Columns) and apply shading
|
||||||
// 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 * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import {
|
import {
|
||||||
AlignmentType,
|
AlignmentType,
|
||||||
@ -15,7 +15,7 @@ import {
|
|||||||
TableCell,
|
TableCell,
|
||||||
TableRow,
|
TableRow,
|
||||||
WidthType,
|
WidthType,
|
||||||
} from "../build";
|
} from "docx";
|
||||||
|
|
||||||
const table = new Table({
|
const table = new Table({
|
||||||
rows: [
|
rows: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Sequential Captions
|
// Sequential Captions
|
||||||
// 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, SequentialIdentifier, TextRun } from "../build";
|
import { Document, Packer, Paragraph, SequentialIdentifier, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Example of how you would create a table with float positions
|
// Example of how you would create a table with float positions
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import {
|
import {
|
||||||
Document,
|
Document,
|
||||||
@ -14,7 +14,7 @@ import {
|
|||||||
TableLayoutType,
|
TableLayoutType,
|
||||||
TableRow,
|
TableRow,
|
||||||
WidthType,
|
WidthType,
|
||||||
} from "../build";
|
} from "docx";
|
||||||
|
|
||||||
const table = new Table({
|
const table = new Table({
|
||||||
rows: [
|
rows: [
|
||||||
|
@ -1,9 +1,21 @@
|
|||||||
// 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 * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, ExternalHyperlink, Footer, FootnoteReferenceRun, ImageRun, Packer, Paragraph, TextRun } from "../build";
|
import { Document, ExternalHyperlink, Footer, FootnoteReferenceRun, ImageRun, Packer, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
|
styles: {
|
||||||
|
default: {
|
||||||
|
hyperlink: {
|
||||||
|
run: {
|
||||||
|
color: "FF0000",
|
||||||
|
underline: {
|
||||||
|
color: "0000FF",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
footnotes: {
|
footnotes: {
|
||||||
1: {
|
1: {
|
||||||
children: [
|
children: [
|
||||||
|
@ -1,7 +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 * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, Header, ImageRun, Packer, Paragraph, Table, TableCell, TableRow } from "../build";
|
import { Document, Header, ImageRun, Packer, Paragraph, Table, TableCell, TableRow } from "docx";
|
||||||
|
|
||||||
const table = new Table({
|
const table = new Table({
|
||||||
rows: [
|
rows: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Add images to header and footer
|
// Add images to header and footer
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, Header, ImageRun, Packer, Paragraph } from "../build";
|
import { Document, Header, ImageRun, Packer, Paragraph } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// Example of how to "wrap" text around an image
|
// Example of how to "wrap" text around an image
|
||||||
// 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 "docx";
|
||||||
import { Document, ImageRun, Packer, Paragraph, TextWrappingSide, TextWrappingType } from "../build";
|
import { Document, ImageRun, Packer, Paragraph, TextWrappingSide, TextWrappingType } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Example how to display page numbers
|
// Example how to display page numbers
|
||||||
// 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, NumberFormat, Paragraph, TextRun } from "../build";
|
import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, NumberFormat, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// 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 * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, Packer, Paragraph, Table, TableCell, TableRow, WidthType } from "../build";
|
import { Document, Packer, Paragraph, Table, TableCell, TableRow, WidthType } from "docx";
|
||||||
|
|
||||||
const table = new Table({
|
const table = new Table({
|
||||||
columnWidths: [3505, 5505],
|
columnWidths: [3505, 5505],
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Example demonstrating line numbers.
|
// Example demonstrating line numbers.
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
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 "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Multiple cells merging in the same table - Rows and Columns
|
// Multiple cells merging in the same table - Rows and Columns
|
||||||
// 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 } from "docx";
|
||||||
|
|
||||||
const table = new Table({
|
const table = new Table({
|
||||||
rows: [
|
rows: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Page numbers - Start from 0 on a new section
|
// 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 * as fs from "fs";
|
||||||
import { AlignmentType, Document, Header, Packer, PageBreak, PageNumber, PageNumberSeparator, Paragraph, TextRun } from "../build";
|
import { AlignmentType, Document, Header, Packer, PageBreak, PageNumber, PageNumberSeparator, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Add image to table cell
|
// Add image to table cell
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, ImageRun, Packer, Paragraph, Table, TableCell, TableRow, WidthType } from "../build";
|
import { Document, ImageRun, Packer, Paragraph, Table, TableCell, TableRow, WidthType } from "docx";
|
||||||
|
|
||||||
const imageBase64Data = `iVBORw0KGgoAAAANSUhEUgAAAIAAAACACAMAAAD04JH5AAACzVBMVEUAAAAAAAAAAAAAAAA/AD8zMzMqKiokJCQfHx8cHBwZGRkuFxcqFSonJyckJCQiIiIfHx8eHh4cHBwoGhomGSYkJCQhISEfHx8eHh4nHR0lHBwkGyQjIyMiIiIgICAfHx8mHh4lHh4kHR0jHCMiGyIhISEgICAfHx8lHx8kHh4jHR0hHCEhISEgICAlHx8kHx8jHh4jHh4iHSIhHCEhISElICAkHx8jHx8jHh4iHh4iHSIhHSElICAkICAjHx8jHx8iHh4iHh4hHiEhHSEkICAjHx8iHx8iHx8hHh4hHiEkHSEjHSAjHx8iHx8iHx8hHh4kHiEkHiEjHSAiHx8hHx8hHh4kHiEjHiAjHSAiHx8iHx8hHx8kHh4jHiEjHiAjHiAiICAiHx8kHx8jHh4jHiEjHiAiHiAiHSAiHx8jHx8jHx8jHiAiHiAiHiAiHSAiHx8jHx8jHx8iHiAiHiAiHiAjHx8jHx8jHx8jHx8iHiAiHiAiHiAjHx8jHx8jHx8iHx8iHSAiHiAjHiAjHx8jHx8hHx8iHx8iHyAiHiAjHiAjHiAjHh4hHx8iHx8iHx8iHyAjHSAjHiAjHiAjHh4hHx8iHx8iHx8jHyAjHiAhHh4iHx8iHx8jHyAjHSAjHSAhHiAhHh4iHx8iHx8jHx8jHyAjHSAjHSAiHh4iHh4jHx8jHx8jHyAjHyAhHSAhHSAiHh4iHh4jHx8jHx8jHyAhHyAhHSAiHSAiHh4jHh4jHx8jHx8jHyAhHyAhHSAiHSAjHR4jHh4jHx8jHx8hHyAhHyAi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FsF875lRrH5klRcG0+xcPwQ1oLxfeRAP4heQTnGL78X2rqlw2DK59SXAV/zKaiGMAuko5InCt68mcOan5+ohf+z1pP8lQY/GHZQMV4YD3FpXDp4qerqbF/lBWBswyi+AL+ia+maLgcRRQj4IYlY/UpauqKBsPJAxQF8NM1TRQ/RudSPAD34rK3scOuR8/HGcspxsJfOVS8NZbiGXiUtPgINU3v3WFDmx8pEuG3EiqKKVbCC1vm2iZqap5LAtCtleQf8F9sFYWDohzeJczYyQ4V2bEZFGsQgJRGqqqhS2phHTWn9lDkIhBTqWqxQZ+IsRvtdHY9AvI2VX2hW68nfqGmuQsCEl3JdjfCF8OW1bPdtwhQ0gm2mQzfRE3a7KCYj0BNZJs8+Kxf/r6WtTEI2FIqlsMfFgRB5A6KUnSe/vUkX0AnuvUIt8SjM1m6wWQymUwmk8lkMgXRf5vi8rLQxtUhAAAAAElFTkSuQmCC`;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Sections with multiple columns
|
// Sections with multiple columns
|
||||||
// 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 "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Highlighting text
|
// Highlighting text
|
||||||
// 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, Paragraph, TextRun } from "../build";
|
import { AlignmentType, Document, Header, Packer, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Shading text
|
// Shading text
|
||||||
// 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, Paragraph, ShadingType, TextRun } from "../build";
|
import { AlignmentType, Document, Header, Packer, Paragraph, ShadingType, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +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 * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, NumberFormat, Paragraph, TextRun } from "../build";
|
import { AlignmentType, Document, Footer, Header, Packer, PageBreak, PageNumber, NumberFormat, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const header = new Header({
|
const header = new Header({
|
||||||
children: [
|
children: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// 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 * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, Packer, Paragraph, VerticalAlign, TextRun, Tab } from "../build";
|
import { Document, Packer, Paragraph, VerticalAlign, TextRun, Tab } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Add custom borders and no-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 * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import {
|
import {
|
||||||
BorderStyle,
|
BorderStyle,
|
||||||
@ -13,7 +13,7 @@ import {
|
|||||||
TableRow,
|
TableRow,
|
||||||
TextDirection,
|
TextDirection,
|
||||||
VerticalAlign,
|
VerticalAlign,
|
||||||
} from "../build";
|
} from "docx";
|
||||||
|
|
||||||
const table = new Table({
|
const table = new Table({
|
||||||
rows: [
|
rows: [
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
// 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 * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import {
|
import {
|
||||||
|
convertMillimetersToTwip,
|
||||||
Document,
|
Document,
|
||||||
HorizontalPositionAlign,
|
HorizontalPositionAlign,
|
||||||
HorizontalPositionRelativeFrom,
|
HorizontalPositionRelativeFrom,
|
||||||
@ -10,7 +11,7 @@ import {
|
|||||||
Paragraph,
|
Paragraph,
|
||||||
VerticalPositionAlign,
|
VerticalPositionAlign,
|
||||||
VerticalPositionRelativeFrom,
|
VerticalPositionRelativeFrom,
|
||||||
} from "../build";
|
} from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
@ -20,6 +21,7 @@ const doc = new Document({
|
|||||||
new Paragraph({
|
new Paragraph({
|
||||||
children: [
|
children: [
|
||||||
new ImageRun({
|
new ImageRun({
|
||||||
|
type: "jpg",
|
||||||
data: fs.readFileSync("./demo/images/image1.jpeg"),
|
data: fs.readFileSync("./demo/images/image1.jpeg"),
|
||||||
transformation: {
|
transformation: {
|
||||||
width: 100,
|
width: 100,
|
||||||
@ -36,17 +38,24 @@ const doc = new Document({
|
|||||||
new Paragraph({
|
new Paragraph({
|
||||||
children: [
|
children: [
|
||||||
new ImageRun({
|
new ImageRun({
|
||||||
|
type: "png",
|
||||||
data: fs.readFileSync("./demo/images/dog.png").toString("base64"),
|
data: fs.readFileSync("./demo/images/dog.png").toString("base64"),
|
||||||
transformation: {
|
transformation: {
|
||||||
width: 100,
|
width: 100,
|
||||||
height: 100,
|
height: 100,
|
||||||
},
|
},
|
||||||
|
outline: {
|
||||||
|
type: "solidFill",
|
||||||
|
solidFillType: "rgb",
|
||||||
|
value: "FF0000",
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
new Paragraph({
|
new Paragraph({
|
||||||
children: [
|
children: [
|
||||||
new ImageRun({
|
new ImageRun({
|
||||||
|
type: "jpg",
|
||||||
data: fs.readFileSync("./demo/images/cat.jpg"),
|
data: fs.readFileSync("./demo/images/cat.jpg"),
|
||||||
transformation: {
|
transformation: {
|
||||||
width: 100,
|
width: 100,
|
||||||
@ -55,12 +64,19 @@ const doc = new Document({
|
|||||||
vertical: true,
|
vertical: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
outline: {
|
||||||
|
type: "solidFill",
|
||||||
|
solidFillType: "rgb",
|
||||||
|
value: "0000FF",
|
||||||
|
width: convertMillimetersToTwip(600),
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
new Paragraph({
|
new Paragraph({
|
||||||
children: [
|
children: [
|
||||||
new ImageRun({
|
new ImageRun({
|
||||||
|
type: "bmp",
|
||||||
data: fs.readFileSync("./demo/images/parrots.bmp"),
|
data: fs.readFileSync("./demo/images/parrots.bmp"),
|
||||||
transformation: {
|
transformation: {
|
||||||
width: 150,
|
width: 150,
|
||||||
@ -76,6 +92,7 @@ const doc = new Document({
|
|||||||
new Paragraph({
|
new Paragraph({
|
||||||
children: [
|
children: [
|
||||||
new ImageRun({
|
new ImageRun({
|
||||||
|
type: "gif",
|
||||||
data: fs.readFileSync("./demo/images/pizza.gif"),
|
data: fs.readFileSync("./demo/images/pizza.gif"),
|
||||||
transformation: {
|
transformation: {
|
||||||
width: 200,
|
width: 200,
|
||||||
@ -91,6 +108,7 @@ const doc = new Document({
|
|||||||
new Paragraph({
|
new Paragraph({
|
||||||
children: [
|
children: [
|
||||||
new ImageRun({
|
new ImageRun({
|
||||||
|
type: "gif",
|
||||||
data: fs.readFileSync("./demo/images/pizza.gif"),
|
data: fs.readFileSync("./demo/images/pizza.gif"),
|
||||||
transformation: {
|
transformation: {
|
||||||
width: 200,
|
width: 200,
|
||||||
@ -112,6 +130,7 @@ const doc = new Document({
|
|||||||
new Paragraph({
|
new Paragraph({
|
||||||
children: [
|
children: [
|
||||||
new ImageRun({
|
new ImageRun({
|
||||||
|
type: "jpg",
|
||||||
data: fs.readFileSync("./demo/images/cat.jpg"),
|
data: fs.readFileSync("./demo/images/cat.jpg"),
|
||||||
transformation: {
|
transformation: {
|
||||||
width: 200,
|
width: 200,
|
||||||
@ -131,6 +150,22 @@ const doc = new Document({
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
|
new Paragraph({
|
||||||
|
children: [
|
||||||
|
new ImageRun({
|
||||||
|
type: "svg",
|
||||||
|
data: fs.readFileSync("./demo/images/linux-svg.svg"),
|
||||||
|
transformation: {
|
||||||
|
width: 200,
|
||||||
|
height: 200,
|
||||||
|
},
|
||||||
|
fallback: {
|
||||||
|
type: "png",
|
||||||
|
data: fs.readFileSync("./demo/images/linux-png.png"),
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// The demo on the README.md
|
// The demo on the README.md
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, HeadingLevel, ImageRun, Packer, Paragraph, Table, TableCell, TableRow, VerticalAlign } from "../build";
|
import { Document, HeadingLevel, ImageRun, Packer, Paragraph, Table, TableCell, TableRow, VerticalAlign } from "docx";
|
||||||
|
|
||||||
const table = new Table({
|
const table = new Table({
|
||||||
rows: [
|
rows: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Custom character styles using JavaScript configuration
|
// Custom character styles using JavaScript configuration
|
||||||
// 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, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
styles: {
|
styles: {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Japanese text - Need to use a Japanese font
|
// Japanese text - Need to use a Japanese font
|
||||||
// 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 } from "../build";
|
import { Document, HeadingLevel, Packer, Paragraph } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
styles: {
|
styles: {
|
||||||
|
@ -5,9 +5,8 @@
|
|||||||
|
|
||||||
// Note that if the OS have not install `KaiTi` font, this demo doesn't work.
|
// Note that if the OS have not install `KaiTi` font, this demo doesn't work.
|
||||||
|
|
||||||
// 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, TextRun } from "../build";
|
import { Document, HeadingLevel, Packer, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
styles: {
|
styles: {
|
||||||
|
@ -3,9 +3,8 @@
|
|||||||
// to the document in Word after the document has been generated. Standard properties (such as creator, title
|
// 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.
|
// 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 * as fs from "fs";
|
||||||
import { Document, Packer } from "../build";
|
import { Document, Packer } from "docx";
|
||||||
|
|
||||||
const doc = new Document(
|
const doc = new Document(
|
||||||
// Standard properties
|
// Standard properties
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Simple example to add text to a document
|
// 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 * as fs from "fs";
|
||||||
import {
|
import {
|
||||||
Document,
|
Document,
|
||||||
@ -21,7 +21,9 @@ import {
|
|||||||
Packer,
|
Packer,
|
||||||
Paragraph,
|
Paragraph,
|
||||||
TextRun,
|
TextRun,
|
||||||
} from "../build";
|
MathLimitLower,
|
||||||
|
MathLimitUpper,
|
||||||
|
} from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
@ -316,6 +318,23 @@ const doc = new Document({
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
|
new Paragraph({
|
||||||
|
children: [
|
||||||
|
new Math({
|
||||||
|
children: [
|
||||||
|
new MathLimitUpper({
|
||||||
|
children: [new MathRun("x")],
|
||||||
|
limit: [new MathRun("-")],
|
||||||
|
}),
|
||||||
|
new MathRun("="),
|
||||||
|
new MathLimitLower({
|
||||||
|
children: [new MathRun("lim")],
|
||||||
|
limit: [new MathRun("x→0")],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Change background colour of whole document
|
// Change background colour of whole document
|
||||||
// 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, Tab, TextRun } from "../build";
|
import { Document, Packer, Paragraph, Tab, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
background: {
|
background: {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Numbered lists - Add parent number in sub number
|
// 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 * as fs from "fs";
|
||||||
import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, LevelFormat, Packer, Paragraph } from "../build";
|
import { AlignmentType, convertInchesToTwip, Document, HeadingLevel, LevelFormat, Packer, Paragraph } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
numbering: {
|
numbering: {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Usage of different Section Types
|
// Usage of different Section Types
|
||||||
// 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, SectionType } from "../build";
|
import { Document, Packer, Paragraph, TextRun, SectionType } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Move + offset header and footer
|
// Move + offset header and footer
|
||||||
// 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, Paragraph } from "../build";
|
import { Document, Footer, Header, Packer, Paragraph } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Example of how to change page borders
|
// Example of how to change page borders
|
||||||
// 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, Tab, TextRun } from "../build";
|
import { Document, HeadingLevel, Packer, Paragraph, Tab, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Track Revisions aka. "Track Changes"
|
// Track Revisions aka. "Track Changes"
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import {
|
import {
|
||||||
AlignmentType,
|
AlignmentType,
|
||||||
@ -14,7 +14,7 @@ import {
|
|||||||
ShadingType,
|
ShadingType,
|
||||||
Tab,
|
Tab,
|
||||||
TextRun,
|
TextRun,
|
||||||
} from "../build";
|
} from "docx";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
For reference, see
|
For reference, see
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
// Text Frame (Text Box) example
|
// Text Frame (Text Box) example
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import {
|
import {
|
||||||
|
AlignmentType,
|
||||||
BorderStyle,
|
BorderStyle,
|
||||||
Document,
|
Document,
|
||||||
FrameAnchorType,
|
FrameAnchorType,
|
||||||
@ -11,7 +12,7 @@ import {
|
|||||||
Tab,
|
Tab,
|
||||||
TextRun,
|
TextRun,
|
||||||
VerticalPositionAlign,
|
VerticalPositionAlign,
|
||||||
} from "../build";
|
} from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
@ -20,6 +21,7 @@ const doc = new Document({
|
|||||||
children: [
|
children: [
|
||||||
new Paragraph({
|
new Paragraph({
|
||||||
frame: {
|
frame: {
|
||||||
|
type: "absolute",
|
||||||
position: {
|
position: {
|
||||||
x: 1000,
|
x: 1000,
|
||||||
y: 3000,
|
y: 3000,
|
||||||
@ -30,6 +32,54 @@ const doc = new Document({
|
|||||||
horizontal: FrameAnchorType.MARGIN,
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
vertical: FrameAnchorType.MARGIN,
|
vertical: FrameAnchorType.MARGIN,
|
||||||
},
|
},
|
||||||
|
},
|
||||||
|
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({
|
||||||
|
children: [new Tab(), "Github is the best"],
|
||||||
|
bold: true,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
}),
|
||||||
|
new Paragraph({
|
||||||
|
frame: {
|
||||||
|
type: "alignment",
|
||||||
|
width: 4000,
|
||||||
|
height: 1000,
|
||||||
|
anchor: {
|
||||||
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
|
vertical: FrameAnchorType.MARGIN,
|
||||||
|
},
|
||||||
alignment: {
|
alignment: {
|
||||||
x: HorizontalPositionAlign.CENTER,
|
x: HorizontalPositionAlign.CENTER,
|
||||||
y: VerticalPositionAlign.TOP,
|
y: VerticalPositionAlign.TOP,
|
||||||
@ -73,6 +123,59 @@ const doc = new Document({
|
|||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
|
new Paragraph({
|
||||||
|
frame: {
|
||||||
|
type: "alignment",
|
||||||
|
width: 4000,
|
||||||
|
height: 1000,
|
||||||
|
anchor: {
|
||||||
|
horizontal: FrameAnchorType.MARGIN,
|
||||||
|
vertical: FrameAnchorType.MARGIN,
|
||||||
|
},
|
||||||
|
alignment: {
|
||||||
|
x: HorizontalPositionAlign.CENTER,
|
||||||
|
y: VerticalPositionAlign.BOTTOM,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
alignment: AlignmentType.RIGHT,
|
||||||
|
children: [
|
||||||
|
new TextRun("Hello World"),
|
||||||
|
new TextRun({
|
||||||
|
text: "Foo Bar",
|
||||||
|
bold: true,
|
||||||
|
}),
|
||||||
|
new TextRun({
|
||||||
|
children: [new Tab(), "Github is the best"],
|
||||||
|
bold: true,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Simple example to add text to a document
|
// 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 * as fs from "fs";
|
||||||
import { Document, LineRuleType, Packer, Paragraph, TextRun } from "../build";
|
import { Document, LineRuleType, Packer, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Move + offset header and footer
|
// Move + offset header and footer
|
||||||
// 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, PageBreak, Paragraph, TextRun } from "../build";
|
import { Document, Footer, Header, Packer, PageBreak, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
evenAndOddHeaderAndFooters: true,
|
evenAndOddHeaderAndFooters: true,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Numbered lists - With complex number text
|
// Numbered lists - With complex number text
|
||||||
// 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, LevelFormat } from "../build";
|
import { Document, Packer, Paragraph, LevelFormat } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
numbering: {
|
numbering: {
|
||||||
@ -107,5 +107,5 @@ const doc = new Document({
|
|||||||
|
|
||||||
// Used to export the file into a .docx file
|
// Used to export the file into a .docx file
|
||||||
Packer.toBuffer(doc).then((buffer) => {
|
Packer.toBuffer(doc).then((buffer) => {
|
||||||
fs.writeFileSync("6-numbering.docx", buffer);
|
fs.writeFileSync("My Document.docx", buffer);
|
||||||
});
|
});
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
// Example of how to set the document page sizes
|
// Example of how to set the document page sizes
|
||||||
// Reference from https://papersizes.io/a/a3
|
// Reference from https://papersizes.io/a/a3
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { convertMillimetersToTwip, Document, Packer, PageOrientation, Paragraph } from "../build";
|
import { convertMillimetersToTwip, Document, Packer, PageOrientation, Paragraph } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Use fields to include dynamic text
|
// Use fields to include dynamic text
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Bookmark, Document, Packer, Paragraph, SimpleField, TextRun } from "../build";
|
import { Bookmark, Document, Packer, Paragraph, SimpleField, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
creator: "Me",
|
creator: "Me",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Section with 2 columns including a column break
|
// 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 * as fs from "fs";
|
||||||
import { Document, Packer, Paragraph, ColumnBreak, TextRun } from "../build";
|
import { Document, Packer, Paragraph, ColumnBreak, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, Packer, Paragraph, LevelFormat } from "../build";
|
import { Document, Packer, Paragraph, LevelFormat } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
numbering: {
|
numbering: {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Sections with multiple columns
|
// Sections with multiple columns
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Column, Document, Packer, Paragraph } from "../build";
|
import { Column, Document, Packer, Paragraph } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Example of how to set the document to landscape
|
// Example of how to set the document to landscape
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { Document, Packer, PageOrientation, Paragraph } from "../build";
|
import { Document, Packer, PageOrientation, Paragraph } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Example demonstrating line numbers with suppression.
|
// Example demonstrating line numbers with suppression.
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
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 "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Example demonstrating page borders with style, colors and size
|
// 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 * as fs from "fs";
|
||||||
import { Document, Packer, TextRun, Paragraph, BorderStyle, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder } from "../build";
|
import { Document, Packer, TextRun, Paragraph, BorderStyle, PageBorderDisplay, PageBorderOffsetFrom, PageBorderZOrder } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Example on how to preserve word wrap text. Works with all languages.
|
// Example on how to preserve word wrap text. Works with all languages.
|
||||||
// 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, SpaceType } from "../build";
|
import { Document, Packer, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Simple example to add comments to a document
|
// Simple example to add comments to a document
|
||||||
// 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, CommentRangeStart, CommentRangeEnd, CommentReference } from "../build";
|
import { Document, Packer, Paragraph, TextRun, CommentRangeStart, CommentRangeEnd, CommentReference } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
comments: {
|
comments: {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Exporting the document as a stream
|
// Exporting the document as a stream
|
||||||
// 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, Tab, TextRun } from "../build";
|
import { Document, Packer, Paragraph, Tab, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Example of using tab stops
|
// Example of using tab stops
|
||||||
// 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, TabStopPosition, TabStopType, TextRun } from "../build";
|
import { Document, HeadingLevel, Packer, Paragraph, TabStopPosition, TabStopType, TextRun } from "docx";
|
||||||
|
|
||||||
const columnWidth = TabStopPosition.MAX / 4;
|
const columnWidth = TabStopPosition.MAX / 4;
|
||||||
const receiptTabStops = [
|
const receiptTabStops = [
|
||||||
@ -14,10 +14,11 @@ const receiptTabStops = [
|
|||||||
{ type: TabStopType.RIGHT, position: columnWidth * 2 },
|
{ type: TabStopType.RIGHT, position: columnWidth * 2 },
|
||||||
{ type: TabStopType.RIGHT, position: columnWidth * 3 },
|
{ type: TabStopType.RIGHT, position: columnWidth * 3 },
|
||||||
{ type: TabStopType.RIGHT, position: TabStopPosition.MAX },
|
{ type: TabStopType.RIGHT, position: TabStopPosition.MAX },
|
||||||
],
|
];
|
||||||
twoTabStops = [{ type: TabStopType.RIGHT, position: TabStopPosition.MAX }];
|
const twoTabStops = [{ type: TabStopType.RIGHT, position: TabStopPosition.MAX }];
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
|
defaultTabStop: 0,
|
||||||
sections: [
|
sections: [
|
||||||
{
|
{
|
||||||
properties: {},
|
properties: {},
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Add compatibility options
|
// Add compatibility options
|
||||||
// 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, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
compatibility: {
|
compatibility: {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Exporting the document as a stream
|
// Exporting the document as a stream
|
||||||
// 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, TableBorders, TableCell, TableRow, WidthType } from "../build";
|
import { Document, Packer, Paragraph, Table, TableBorders, TableCell, TableRow, WidthType } from "docx";
|
||||||
|
|
||||||
const table1 = new Table({
|
const table1 = new Table({
|
||||||
columnWidths: [3505, 5505],
|
columnWidths: [3505, 5505],
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Simple example to add text to a document
|
// 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 * as fs from "fs";
|
||||||
import { AlignmentType, Document, Packer, Paragraph, TextRun } from "../build";
|
import { AlignmentType, Document, Packer, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Example of how you would create a table and add data to it from a data source
|
// Example of how you would create a table and add data to it from a data source
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import {
|
import {
|
||||||
Document,
|
Document,
|
||||||
@ -13,7 +13,7 @@ import {
|
|||||||
TextDirection,
|
TextDirection,
|
||||||
TextRun,
|
TextRun,
|
||||||
WidthType,
|
WidthType,
|
||||||
} from "../build";
|
} from "docx";
|
||||||
|
|
||||||
interface StockPrice {
|
interface StockPrice {
|
||||||
readonly date: Date;
|
readonly date: Date;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Add text to header and footer
|
// Add text to header and footer
|
||||||
// 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, Paragraph } from "../build";
|
import { Document, Footer, Header, Packer, Paragraph } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Simple example to add text to a document
|
// 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 * as fs from "fs";
|
||||||
import { AlignmentType, convertMillimetersToTwip, Document, Packer, Paragraph, TextRun } from "../build";
|
import { AlignmentType, convertMillimetersToTwip, Document, Packer, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
styles: {
|
styles: {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Example of a continuous header
|
// Example of a continuous header
|
||||||
// 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, Paragraph, SectionType, Tab, TextRun } from "../build";
|
import { Document, Footer, Header, Packer, Paragraph, SectionType, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
creator: "Creator",
|
creator: "Creator",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Example of using headers and footers in a new section
|
// Example of using headers and footers in a new section
|
||||||
// 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, Paragraph, SectionType, Tab, TextRun } from "../build";
|
import { Document, Footer, Header, Packer, Paragraph, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
creator: "Creator",
|
creator: "Creator",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Simple example to add text to a document
|
// 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 * as fs from "fs";
|
||||||
import { Document, Packer, Paragraph } from "../build";
|
import { Document, Packer, Paragraph } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
styles: {
|
styles: {
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
// Simple example apply positional tabs to a document
|
// Simple example apply positional tabs to a document
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import {
|
import {
|
||||||
Document,
|
Document,
|
||||||
Packer,
|
Packer,
|
||||||
Paragraph,
|
Paragraph,
|
||||||
PositionalTab,
|
PositionalTab,
|
||||||
Tab,
|
|
||||||
TextRun,
|
TextRun,
|
||||||
PositionalTabAlignment,
|
PositionalTabAlignment,
|
||||||
PositionalTabRelativeTo,
|
PositionalTabRelativeTo,
|
||||||
PositionalTabLeader,
|
PositionalTabLeader,
|
||||||
} from "../build";
|
} from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Patch a document with patches
|
// Patch a document with patches
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import {
|
import {
|
||||||
ExternalHyperlink,
|
ExternalHyperlink,
|
||||||
@ -14,9 +14,11 @@ import {
|
|||||||
TextDirection,
|
TextDirection,
|
||||||
TextRun,
|
TextRun,
|
||||||
VerticalAlign,
|
VerticalAlign,
|
||||||
} from "../build";
|
} from "docx";
|
||||||
|
|
||||||
patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
|
patchDocument({
|
||||||
|
outputType: "nodebuffer",
|
||||||
|
data: fs.readFileSync("demo/assets/simple-template.docx"),
|
||||||
patches: {
|
patches: {
|
||||||
name: {
|
name: {
|
||||||
type: PatchType.PARAGRAPH,
|
type: PatchType.PARAGRAPH,
|
||||||
@ -56,7 +58,11 @@ patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
|
|||||||
],
|
],
|
||||||
link: "https://www.google.co.uk",
|
link: "https://www.google.co.uk",
|
||||||
}),
|
}),
|
||||||
new ImageRun({ data: fs.readFileSync("./demo/images/dog.png"), transformation: { width: 100, height: 100 } }),
|
new ImageRun({
|
||||||
|
type: "png",
|
||||||
|
data: fs.readFileSync("./demo/images/dog.png"),
|
||||||
|
transformation: { width: 100, height: 100 },
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
@ -82,7 +88,13 @@ patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
|
|||||||
},
|
},
|
||||||
image_test: {
|
image_test: {
|
||||||
type: PatchType.PARAGRAPH,
|
type: PatchType.PARAGRAPH,
|
||||||
children: [new ImageRun({ data: fs.readFileSync("./demo/images/image1.jpeg"), transformation: { width: 100, height: 100 } })],
|
children: [
|
||||||
|
new ImageRun({
|
||||||
|
type: "jpg",
|
||||||
|
data: fs.readFileSync("./demo/images/image1.jpeg"),
|
||||||
|
transformation: { width: 100, height: 100 },
|
||||||
|
}),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
table: {
|
table: {
|
||||||
type: PatchType.DOCUMENT,
|
type: PatchType.DOCUMENT,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Generate a template document
|
// Generate a template document
|
||||||
// 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, TextRun } from "docx";
|
||||||
|
|
||||||
const doc = new Document({
|
const doc = new Document({
|
||||||
sections: [
|
sections: [
|
||||||
|
@ -1,9 +1,11 @@
|
|||||||
// Patch a document with patches
|
// Patch a document with patches
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
|
||||||
import { patchDocument, PatchType, TextRun } from "../build";
|
|
||||||
|
|
||||||
patchDocument(fs.readFileSync("demo/assets/simple-template-2.docx"), {
|
import * as fs from "fs";
|
||||||
|
import { patchDocument, PatchType, TextRun } from "docx";
|
||||||
|
|
||||||
|
patchDocument({
|
||||||
|
outputType: "nodebuffer",
|
||||||
|
data: fs.readFileSync("demo/assets/simple-template-2.docx"),
|
||||||
patches: {
|
patches: {
|
||||||
name: {
|
name: {
|
||||||
type: PatchType.PARAGRAPH,
|
type: PatchType.PARAGRAPH,
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
// Patch a document with patches
|
// Patch a document with patches
|
||||||
// Import from 'docx' rather than '../build' if you install from npm
|
|
||||||
import * as fs from "fs";
|
import * as fs from "fs";
|
||||||
import { IPatch, patchDocument, PatchType, TextRun } from "../build";
|
import { IPatch, patchDocument, PatchType, TextRun } from "docx";
|
||||||
|
|
||||||
export const font = "Trebuchet MS";
|
export const font = "Trebuchet MS";
|
||||||
export const getPatches = (fields: { [key: string]: string }) => {
|
export const getPatches = (fields: { [key: string]: string }) => {
|
||||||
@ -24,7 +24,9 @@ const patches = getPatches({
|
|||||||
paragraph_replace: "Lorem ipsum paragraph",
|
paragraph_replace: "Lorem ipsum paragraph",
|
||||||
});
|
});
|
||||||
|
|
||||||
patchDocument(fs.readFileSync("demo/assets/simple-template.docx"), {
|
patchDocument({
|
||||||
|
outputType: "nodebuffer",
|
||||||
|
data: fs.readFileSync("demo/assets/simple-template.docx"),
|
||||||
patches,
|
patches,
|
||||||
}).then((doc) => {
|
}).then((doc) => {
|
||||||
fs.writeFileSync("My Document.docx", doc);
|
fs.writeFileSync("My Document.docx", doc);
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user