This repository hosts the HTML templating library for eXist, which was previously part of the shared-resources package. shared-resources is now deprecated and users should upgrade their code. The new package intends to be backwards compatible: the namespace URI of the module has changed to avoid conflicts, but existing template functions will continue to work.
A detailed documentation for this package can be found in the eXist-db documentation app.
-
change any dependency on
shared-resourcesin yourexpath-pkg.xmlto point to this package:<dependency package="http://exist-db.org/html-templating" semver-min="1.0.0"/>
-
update the module URI for any imports of the templating module. The new URI is:
import module namespace templates="http://exist-db.org/xquery/html-templating";
New standard templating functions will go into a separate module, so you may want to add the following import in addition to the one above, which will give you access to the
lib:parse-paramstemplate function (and others in the future):import module namespace lib="http://exist-db.org/xquery/html-templating/lib";
-
Install the eXist-db HTML Templating Library package from eXist's package repository via the dashboard, or download the
templating-1.0.0.xarfile from GitHub releases page. -
Open the dashboard of your eXist-db instance and click on
package manager.- Click on the
add packagesymbol in the upper left corner and select the.xarfile you just downloaded.
- Click on the
-
You have successfully installed templating into exist.
- Download, fork or clone this GitHub repository
- Calling
npm startin your CLI will install required dependencies from npm and create a.xar:
cd templating
npm startTo install it, follow the instructions above.
This app uses mochajs as a test-runner. To run the tests type:
npm testThis will automatically build and install the library plus a test application into your local eXist, assuming it can be reached on http://localhost:8080/exist. If this is not the case, edit .existdb.json and change the properties for the localhost server to match your setup.
You can take a look at the Contribution guidelines for this project
LGPL-2.1 Copyright (C) 2001 The eXist-db Authors