Documentation and demo for module error-location

Summary (version 3.0.0) Demo Readme Changelog

This module makes it possible to locate errors

This module is available as part of the docxtemplater pro plan.

Demo

Input Output
Data Code
{
    "users": []
}
const doc = new Docxtemplater();
const inputZip = new JSZip(docX);
doc.loadZip(inputZip)
	.setData(data);
const errorlocationModule = new ErrorLocationModule({});
doc.attachModule(errorlocationModule);
let output;
try {
	doc.render();
}
catch (e) {
	errorlocationModule.addComments();
	// This will happen if the docx contains errors.
	output = doc.render().getZip();
	return
}
doc.render.getZip();
// This will happen if the docx is valid.

README

Error location Module

This module makes it possible to locate errors in a word/document.

Installation:

You will need docxtemplater v3: npm install docxtemplater

Install this module with npm install --save "$url"

Usage

const ErrorLocationModule = require("docxtemplater-error-location-module");
const errorModule = new ErrorLocationModule();
doc.attachModule(errorModule);
// Now all your errors will be enhanced with locationWord

Building

You can build the es6 into js by running npm run compile

Testing

You can test the module with npm test

CHANGELOG

3.0.0

Initial release

Have any questions ? Contact us at contact@javascript-ninja.fr


Subscribe to our newsletter and keep up to date on the changes done in docxtemplater.

Edgar Hipp

I'm the creator of docxtemplater. I work on making docxtemplater great since 2013.