@informatiqal/publiqate-html
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Publiqate HTML

Generate HTML file plugin for Publiqate

Build and Installation

Clone this repository. Navigate to the plugins -> html folder and run:

npm run build

Once the build process is complete the compiled code will be available in plugins -> html -> dist folder.

Copy the content of the dist folder somewhere on the server, where Publiqate is running and specify the location from where Publiqate will load the plugin.

Once the config is set either restart the Publiqate service or visit the admin UI and press "Refresh config".

Example config:

...
plugins:
  - c:\path\to\html\plugin\dist\index.js
...
notifications:
  - type: Stream
    ...
    callbacks:
      - type: html
        details:
          template: c:\path\to\template.handlebars # see Templates section for details
          path: c:\path\to\where\to\store\index.html
          type: handlebars # or ejs, pug, mustache
...

Options

  • template - full path to the template to use (see Templates section for details)
  • path- full path to where to store the compiled plugin. The path must include the file name as well
  • type - optional. defaults to handlebars. Which template engine to use to render the template (see the section below)

Templates

The plugin support 4 template engines:

For each template engine error log entry will be generated if the template fails to compile/render.

Examples how to render list of names for all entities in the notification for each template engine:

<ul><% entities.forEach((entity,index) => {%>
  <li><%= entity.details.name %></li><% }) %>
</ul>
<ul>
  {{#each entities}}
    <li>{{this.details.name}}</li>
  {{/each}}
</ul>
ul
  each n in entities
    li= n.details.name
<ul>
  {{#entities}}
    <li>{{details.name}}</li>
  {{/entities}}
</ul>

Package Sidebar

Install

npm i @informatiqal/publiqate-html

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

5.99 MB

Total Files

6

Last publish

Collaborators

  • informatiqal-dev
  • stefan.stoichev