Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

easy-template-x

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easy-template-x - npm Package Compare versions

Comparing version 0.10.3 to 0.10.4

6

CHANGELOG.md
# Change Log
## [0.10.4 - 2020-03-02](https://github.com/alonrbar/easy-template-x/tree/v0.10.4)
### Added
- Expose "Community Extensions" on npm (readme changes).
## [0.10.3 - 2020-02-16](https://github.com/alonrbar/easy-template-x/tree/v0.10.3)

@@ -4,0 +10,0 @@

2

package.json
{
"name": "easy-template-x",
"version": "0.10.3",
"version": "0.10.4",
"description": "Generate docx documents from templates, in Node or in the browser.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -22,2 +22,4 @@ # easy-template-x

- [Extensions](#extensions)
- [Community Extensions](#community-extensions)
- [Data Binding Extension](#data-binding-extension)
- [Scope resolution](#scope-resolution)

@@ -314,29 +316,29 @@ - [Advanced API](#note---advanced-api)

Although most document manipulation can be achieved by using plugins, there are some cases where a more powerful tool is required. In order to extend the document manipulation process you can specify extensions that will be run before and/or after the standard template processing.
While most document manipulation can be achieved using plugins, there are some cases where a more powerful tool is required. In order to extend the document manipulation process you can specify extensions that will be run before and/or after the standard template processing.
Some cases where an extension may be a good fit:
- Manipulating the document metadata (author, keywords, description, etc.).
- Adding and manipulating [Content Controls](http://www.datypic.com/sc/ooxml/e-w_sdtContent-2.html).
- Leveraging [Data Binding](https://blogs.msdn.microsoft.com/modonovan/2006/05/22/word-2007-content-controls-and-xml-part-1-the-basics/) (where the data is stored in files other than the base Word files).
To write an extension inherit from the [TemplateExtension](./src/extensions/templateExtension.ts) class.
By default no extension is loaded.
By default no extension is loaded. Extensions and the order they run in are specified via the `TemplateHandlerOptions`.
Extensions and the order they run in are specified via the `TemplateHandlerOptions`.
```typescript
const handler = new TemplateHandler(
new TemplateHandlerOptions({
extensions: {
afterCompilation: [
new ContentControlExtension(),
new DataBindingExtension()
]
}
});
);
const handler = new TemplateHandler({
extensions: {
afterCompilation: [
new DataBindingExtension()
]
}
});
```
### Community Extensions
The following extensions were developed by the community.
Want to see your extension here? Submit a pull request or [open an issue](https://github.com/alonrbar/easy-template-x/issues).
#### Data Binding Extension
The [easy-template-x-data-binding](https://github.com/sebastianrogers/easy-template-x-data-binding) extension supports updating [custom XML files](https://docs.microsoft.com/en-gb/archive/blogs/modonovan/word-2007-content-controls-and-xml-part-1-the-basics) inside Word documents.
This allows using `easy-template-x` to automatically fill [Word forms](https://support.office.com/en-us/article/create-forms-that-users-complete-or-print-in-word-040c5cc1-e309-445b-94ac-542f732c8c8b) that uses content controls.
## Scope resolution

@@ -416,3 +418,3 @@

philosophy, offers some unique benefits including a most simple, non-programmer
oriented template syntax, an even neater API (IMHO 😄), a _free_ image insertion
oriented template syntax, an even neater API (IMHO), a _free_ image insertion
plugin and a TypeScript code base. Hopefully it will serve you well :)

@@ -419,0 +421,0 @@

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc