Skip to main content

Modules Overview

np.Templating includes a suite of modules which are available for inclusion in any template. Each module has a specific category (aka "namespace") which is used within your templates.

Modules

The following modules are included in np.Templating

Date Module

The Date Module provides methods and variables which work with dates.

Time Module

The Time Module provides methods and variables which work with dates.

Note Module

The Note Module provides a suite of methods which provide access to current note attributes

System Module

The System Module provides a suite of methods which provide access to system level commands such as clipboard or current selection

Utility Module

The Utility Module provides a suite of utility methods which can be used in your templates

Web Module

The Web Module provides a suite of methods which provide access to web APIs such as advice, affirmation or weather.

Examples

The following are some examples of how you can use these modules within your templates.

// inserts current date
<%- date.now() %>
// inserts current time
<%- time.now() %>
// insert contents of clipboard
<%- system.clipboard() %>
// format string with titleCase
<%- utils.titleCase('mike') %>
// return random advice
<%- web.advice('mike') %>