Type: Function

How to get createDocumentFromLocalTemplate?


import createDocumentFromLocalTemplate from 'fontoxml-document-from-template/src/createDocumentFromLocalTemplate.js'

Creates a new document from a given template file and loads it.

The templates are required to be in 'assets/templates' and should be packaged in an appropriate feature package.

Note that Ids contained in the template will be regenerated, to ensure they are unique. This means it is impossible to use these ids in, for instance, crossreferences

Usage example:


createDocumentFromLocalTemplate('my-template.xml', {
    modifyTemplateCallback: function modifyTemplate (documentNode, blueprint, format) {
  	   // Modify the document before it is sent to the CMS
  	   // The blueprint will be validated for you
    .then(function (documentId) {
        // Do something useful with the documentId, which by now is loaded in the documentsManager
        // For example: add a reference to the DITA map or redirect to the editor route


  1. templateFilename


    Type: String

    The name of the template file from which to create the document. Must be in /assets/templates/.

  2. options


    Type: Object



Type: Promise<String>

Returns a promise which resolved to the documentId of the created document.