@7stack.io/snippets-helpers 中文文档教程

发布于 6年前 浏览 24 项目主页 更新于 3年前

Helpers

这个 repo 包含可以在代码片段中使用的助手。 出色地 接受拉取请求以添加附加功能,只要它们经过测试并且 格式正确。

查看 https://handlebarsjs.com/block_helpers.html

Adding a Helper

请参阅 helpers/dummy 以获取示例助手

  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 必须遵循示例虚拟助手中的确切格式,因为它将用于生成文档网站。 只需复制自述文件并替换名称、描述和示例代码。 不要更改标头类型/等。

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.

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文