Bruce Duncan 816cb54b14 Optimize XML output by properly constructing objects to send to the xml library so that it can produce proper empty elements.
Rework the way attributes are stored in ImportedXmlComponent to match elsewhere (required allowing for a null xmlKeys in the XmlAttributeComponent interface).
Rework the way paragraphs get added to the end of table cells if needed.
The goal in both reworks is to not mess around with the objects output from `prepForXml` if we can avoid it.
Made the output of RunProperties, ParagraphProperties, TableCellProperties, TableRowProperties, and TableProperties all optional based on whether they contain any attributes or children.  Changed code in PageBorders, TableCellMargin, and TableCellBorders that implemented this same thing by overriding `prepForXml` so that it uses the new XmlComponent subclass instead.
Removed commented out code that attempted to fix-up XML output and make proper empty elements.
Fixed all affected tests.
Turn off `no-null-keyword` in the linter as we need to use null to signal to the `xml` library to create an empty element with no attributes (`undefined` will not work in its place).

Fixes #306
2019-04-09 05:27:18 -04:00
2018-09-14 02:44:47 +01:00
2019-03-21 01:06:07 +00:00
2019-04-04 15:35:41 -04:00
2018-09-12 21:19:33 +01:00
2019-01-15 00:34:40 +00:00
2017-12-20 01:40:52 +00:00
2018-10-26 20:11:40 +01:00
2017-04-16 00:04:29 +01:00
2018-08-31 11:25:05 -04:00
2018-11-02 03:00:07 +00:00
2018-02-10 17:56:52 +00:00
2016-03-26 23:43:57 +00:00
2019-03-30 15:45:12 +00:00
2019-03-12 20:26:39 +00:00
2019-01-16 13:34:32 +00:00

clippy the assistant

Easily generate .docx files with JS/TS. Works for Node and on the Browser.


NPM version Downloads per month Build Status Dependency Status Known Vulnerabilities Chat on Gitter PRs Welcome codecov

drawing

Demo

Browser

Here are examples of docx being used with basic HTML/JS in a browser environment:

Here is an example of docx working in Angular:

Node

Press endpoint on the RunKit website:

RunKit Instructions

More here and here

How to use & Documentation

Please refer to the documentation at https://docx.js.org/ for details on how to use this library, examples and much more!

Examples

Check the examples section in the documentation and the demo folder for examples.

Contributing

Read the contribution guidelines here.

Used by

drawing drawing drawing


patreon browserstack

Made with 💖

Description
Languages
TypeScript 100%