@7stack.io/snippets-helpers 中文文档教程
Helpers
这个 repo 包含可以在代码片段中使用的助手。 出色地 接受拉取请求以添加附加功能,只要它们经过测试并且 格式正确。
查看 https://handlebarsjs.com/block_helpers.html
Adding a Helper
请参阅 helpers/dummy 以获取示例助手
- 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. - Create
helper.js
,helper.test.js
, andREADME.md
in your helper directory - Export a function that has the same signature as a handlebars helper in
helper.js
- Write at least one
jest
test inhelper.test.js
to test your helper - Add required title, description, and example code in your
README.md
file
README.md
README.md
必须遵循示例虚拟助手中的确切格式,因为它将用于生成文档网站。 只需复制自述文件并替换名称、描述和示例代码。 不要更改标头类型/等。
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
- 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. - Create
helper.js
,helper.test.js
, andREADME.md
in your helper directory - Export a function that has the same signature as a handlebars helper in
helper.js
- Write at least one
jest
test inhelper.test.js
to test your helper - 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.