Skip to content
This repository was archived by the owner on Sep 27, 2020. It is now read-only.

sheetbase/handlebars-server

Repository files navigation

⛔️ DEPRECATED

Since @sheetbase/app-scripts now uses Rollup for module bundling, it is recommended to use the official module.

Sheetbase Module: @sheetbase/handlebars-server

Handlebars for Google apps script.

License clasp Support me on Patreon PayPal Ask me anything

Install

  • Using npm: npm install --save @sheetbase/handlebars-server

  • As a library: 1onxq7LQFPM7BgErdOCogyc6_BIqCpnoINv6BqoYrYpNsj7U0ayRulVB2

    Set the Indentifier to Handlebars and select the lastest version, view code.

Examples

function example1(): void {
  const source: string =
    "<p>Hello, my name is {{name}}. " +
    "I am from {{hometown}}. I have {{kids.length}} kids:</p>" +
    "<ul>{{#kids}}<li>{{name}} is {{age}}</li>{{/kids}}</ul>";
  const template = Handlebars.compile(source);
  const data = {
    name: "Alan",
    hometown: "Somewhere, TX",
    kids: [{ name: "Jimmy", age: "12" }, { name: "Sally", age: "4" }]
  };
  let result = template(data);
  Logger.log(result);
}

Documentation

Homepage: http://www.handlebarsjs.com/

License

@sheetbase/handlebars-server is released under the MIT license.

About

⛔️ DEPRECATED, Using Handlebars.js in Google Apps Script.

Resources

License

Stars

Watchers

Forks

Packages

No packages published