diff --git a/.cspell.json b/.cspell.json index a6ca74d477..2395fa64d5 100644 --- a/.cspell.json +++ b/.cspell.json @@ -4,14 +4,13 @@ "version": "0.2", // language - current active spelling language "language": "en_US", - "dictionaries": ["en_US", "typescript", "softwareTerms", "fonts"], + "dictionaries": ["en_US", "typescript", "softwareTerms", "fonts", "npm"], // words - list of words to be always considered correct "words": [ "Xmlable", "twip", "twips", "jsonify", - "Media", "falsey", "aiueo", "iroha", @@ -31,7 +30,8 @@ "NUMPAGES", "ATLEAST", "ooxml", - "clippy" + "clippy", + "docsify" ], "ignoreRegExpList": [ "/\"w:.+\"/", @@ -49,7 +49,7 @@ "\\.to\\.include\\.members\\(\\[[^\\]]+]\\)", "/new [a-zA-Z]+\\({[^£]+}\\)/g" ], - "ignorePaths": ["package.json"], + "ignorePaths": ["package.json", "docs/api"], "allowCompoundWords": true, // flagWords - list of words to be always considered incorrect // This is useful for offensive words and common spelling errors. diff --git a/demo/11-declaritive-styles-2.ts b/demo/11-declaritive-styles-2.ts index 1035faab45..93b4557348 100644 --- a/demo/11-declaritive-styles-2.ts +++ b/demo/11-declaritive-styles-2.ts @@ -52,18 +52,20 @@ const table = new Table({ }); const doc = new Document({ - numbering:{ - config:[{ - reference: 'ref1', - levels: [ + numbering: { + config: [ { - level: 0, - format: LevelFormat.DECIMAL, - text: '%1)', - start: 50, - } - ], - }] + reference: "ref1", + levels: [ + { + level: 0, + format: LevelFormat.DECIMAL, + text: "%1)", + start: 50, + }, + ], + }, + ], }, styles: { default: { @@ -184,11 +186,11 @@ const doc = new Document({ spacing: { line: 276, before: 20 * 72 * 0.1, after: 20 * 72 * 0.05 }, rightTabStop: TabStopPosition.MAX, leftTabStop: 453.543307087, - numbering : { - reference: 'ref1', + numbering: { + reference: "ref1", instance: 0, level: 0, - } + }, }, }, ], diff --git a/demo/31-tables.ts b/demo/31-tables.ts index cf5361c7c2..c544e21651 100644 --- a/demo/31-tables.ts +++ b/demo/31-tables.ts @@ -34,8 +34,7 @@ const doc = new Document({ new TableCell({ children: [ new Paragraph({ - text: - "Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah", + text: "Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah", heading: HeadingLevel.HEADING_1, }), ], diff --git a/demo/49-table-borders.ts b/demo/49-table-borders.ts index 1a3943a947..cbb1dabe87 100644 --- a/demo/49-table-borders.ts +++ b/demo/49-table-borders.ts @@ -123,8 +123,7 @@ const noBorderTable = new Table({ new TableCell({ children: [ new Paragraph({ - text: - "Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah", + text: "Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah Blah", heading: HeadingLevel.HEADING_1, }), ], diff --git a/demo/51-character-styles.ts b/demo/51-character-styles.ts index 8209ef705f..6300920808 100644 --- a/demo/51-character-styles.ts +++ b/demo/51-character-styles.ts @@ -43,8 +43,7 @@ const doc = new Document({ style: "strong", }), new TextRun({ - text: - " - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", + text: " - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", }), ], }), diff --git a/demo/60-track-revisions.ts b/demo/60-track-revisions.ts index 232b74f691..e4cdd15575 100644 --- a/demo/60-track-revisions.ts +++ b/demo/60-track-revisions.ts @@ -121,7 +121,7 @@ const doc = new Document({ author: "Firstname Lastname", date: "2020-10-06T09:05:00Z", bold: false, - } + }, }), ], }), diff --git a/demo/66-fields.ts b/demo/66-fields.ts index ff1c3a88d5..64c1acf5e7 100644 --- a/demo/66-fields.ts +++ b/demo/66-fields.ts @@ -4,7 +4,7 @@ import * as fs from "fs"; import { Bookmark, Document, Packer, Paragraph, SimpleField, TextRun } from "../build"; const doc = new Document({ - creator: 'Me', + creator: "Me", sections: [ { properties: {}, diff --git a/demo/67-column-break.ts b/demo/67-column-break.ts index 42a1a32f1b..2746bffefd 100644 --- a/demo/67-column-break.ts +++ b/demo/67-column-break.ts @@ -13,11 +13,13 @@ const doc = new Document({ }, }, children: [ - new Paragraph({ children: [ - new TextRun('This text will be in the first column.'), - new ColumnBreak(), - new TextRun('This text will be in the second column.'), - ] }), + new Paragraph({ + children: [ + new TextRun("This text will be in the first column."), + new ColumnBreak(), + new TextRun("This text will be in the second column."), + ], + }), ], }, ], diff --git a/docs/_sidebar.md b/docs/_sidebar.md index 356f64239a..feb12f2452 100644 --- a/docs/_sidebar.md +++ b/docs/_sidebar.md @@ -1,37 +1,39 @@ -* [Getting Started](/) +- [Getting Started](/) -* [Examples](https://github.com/dolanmiu/docx/tree/master/demo) +- [Examples](https://github.com/dolanmiu/docx/tree/master/demo) -* API +- API - * [Documentation](https://docx.js.org/api/) + - [Documentation](https://docx.js.org/api/) -* Usage +- Usage - * [Document](usage/document.md) - * [Sections](usage/sections.md) - * [Paragraph](usage/paragraph.md) - * [Text](usage/text.md) - * [Image](usage/images.md) - * [Headers & Footers](usage/headers-and-footers.md) - * [Bullet Points](usage/bullet-points.md) - * [Hyperlinks](usage/hyperlinks.md) - * [Numbering](usage/numbering.md) - * [Tables](usage/tables.md) - * [Tab Stops](usage/tab-stops.md) - * [Table of Contents](usage/table-of-contents.md) - * [Page Numbers](usage/page-numbers.md) - * [Change Tracking](usage/change-tracking.md) - * [Math](usage/math.md) - * [Text Frames](usage/text-frames.md) - * Styling - * [Styling with JS](usage/styling-with-js.md) - * [Styling with XML](usage/styling-with-xml.md) -* Exporting + - [Document](usage/document.md) + - [Sections](usage/sections.md) + - [Paragraph](usage/paragraph.md) + - [Text](usage/text.md) + - [Image](usage/images.md) + - [Headers & Footers](usage/headers-and-footers.md) + - [Bullet Points](usage/bullet-points.md) + - [Hyperlinks](usage/hyperlinks.md) + - [Numbering](usage/numbering.md) + - [Tables](usage/tables.md) + - [Tab Stops](usage/tab-stops.md) + - [Table of Contents](usage/table-of-contents.md) + - [Page Numbers](usage/page-numbers.md) + - [Change Tracking](usage/change-tracking.md) + - [Math](usage/math.md) + - [Text Frames](usage/text-frames.md) + - Styling + _ [Styling with JS](usage/styling-with-js.md) + _ [Styling with XML](usage/styling-with-xml.md) - * [Packers](usage/packers.md) -* Utility +- Exporting - * [Convenience functions](usage/convenience-functions.md) + - [Packers](usage/packers.md) -* [Contribution Guidelines](contribution-guidelines.md) +- Utility + + - [Convenience functions](usage/convenience-functions.md) + +- [Contribution Guidelines](contribution-guidelines.md) diff --git a/package.json b/package.json index dff1fc375a..0ce1ee9602 100644 --- a/package.json +++ b/package.json @@ -14,9 +14,9 @@ "webpack": "rimraf ./build && webpack --config ./webpack.config.ts", "demo": "npm run build && npm run ts-node --skip-project ./demo", "typedoc": "rimraf ./build && typedoc src/index.ts --tsconfig tsconfig.typedoc.json", - "style": "prettier -l \"src/**/*.{ts,html,md}\"", + "style": "prettier -l \"{src,scripts,demo}/**/*.{ts,html}\"", "style.fix": "npm run style -- --write", - "cspell": "cspell \"src/**/*.ts\" && cspell \"demo/**/*.{ts,scss,html}\" && cspell \"docs/**/*.{ts,md}\" && cspell \"scripts/**/*.ts\" && cspell \"./*.*\"", + "cspell": "cspell \"{src,demo,docs,scripts}/**/*.{ts,scss,html,md}\" && cspell \"./*.*\"", "fix-types": "ts-node --skip-project scripts/types-absolute-fixer.ts", "e2e": "ts-node scripts/e2e.ts", "serve.docs": "cd docs && docsify serve",