@7stack.io/snippets-helpers

Helpers for the 7stack snippets template engine

Usage no npm install needed!

<script type="module">
  import 7stackIoSnippetsHelpers from 'https://cdn.skypack.dev/@7stack.io/snippets-helpers';
</script>

README

Helpers

This repo contains the helpers that will be available to use in snippets. We'll take pull requests to add additional functionality as long as they're tested and formatted correctly.

Check out https://handlebarsjs.com/block_helpers.html

Adding a Helper

See helpers/dummy for an example helper

  1. Create a new directory under ./helpers with the name of your helper. When your helper is loaded it will have the name of the directory.
  2. Create helper.js, helper.test.js, and README.md in your helper directory
  3. Export a function that has the same signature as a handlebars helper in helper.js
  4. Write at least one jest test in helper.test.js to test your helper
  5. Add required title, description, and example code in your README.md file

README.md

README.md MUST follow the exact format in the example dummy helper since it will be used to generate docs on the site. Just copy the README and substitute the name, description, and example code. Don't change the header types/etc.