diff --git a/README.md b/README.md index 4d0ce1e..99f9804 100644 --- a/README.md +++ b/README.md @@ -58,6 +58,7 @@ Read in other languages: English | [简体中文](./README.zh-CN.md) 1. Use any editor to write a JavaScript script that must include a globally scoped `transform` function, taking a [curl object](https://cdn.jsdelivr.net/gh/bitjerry/Headers@main/src/main/resources/scripts/test.js) as the only parameter and returning the generated code string. 2. Open Settings -> Tools -> Headers, add a script to the left script list, and paste the script created earlier into the right editor. 3. You can now right-click on "headers" in IDEA to see the corresponding code generation script for curl command transformation. +4. All scripts will be continuously updated in this repository, and you can [click here](https://github.com/bitjerry/Headers/tree/main/src/main/resources/scripts/example) to get more scripts. If you have better suggestions, please submit an issue, and share your script. ![Custom Script](https://cdn.jsdelivr.net/gh/bitjerry/Headers@main/images/custom_script.png) diff --git a/README.zh-CN.md b/README.zh-CN.md index 8f3c929..d4c79d0 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -55,6 +55,7 @@ 1. 使用任意编辑器编写一个 JavaScript 脚本, 必须包括一个全局作用域的 `transform` 函数, 接受一个 [curl 对象](https://cdn.jsdelivr.net/gh/bitjerry/Headers@main/src/main/resources/scripts/test.js) 作为唯一参数, 返回生成的代码字符串 2. 打开设置 -> 工具 -> headers, 左侧脚本列表添加一个脚本, 在右侧编辑器中粘贴前方写好的脚本 3. 即可在 IDEA 中右键 headers -> curl 看到对应的代码生成脚本, 转换 curl 命令 +4. 所有脚本将持续在本仓库中更新, 可以 [点击](https://github.com/bitjerry/Headers/tree/main/src/main/resources/scripts/example) 获取更多脚本. 如果你有更好的建议欢迎提 issue, 分享你的脚本.
diff --git a/src/main/resources/scripts/template.js b/src/main/resources/scripts/template.js index 52a1c30..d51774e 100644 --- a/src/main/resources/scripts/template.js +++ b/src/main/resources/scripts/template.js @@ -2,6 +2,7 @@ * Convert curl request object to code * * More details see https://github.com/bitjerry/Headers + * More script see https://github.com/bitjerry/Headers/tree/main/src/main/resources/scripts/example * * @param {Object} curl * @return {String} The generated code will be embedded in the editor from the mouse position