Skip to content

Commit

Permalink
style:
Browse files Browse the repository at this point in the history
  • Loading branch information
bitjerry committed Feb 2, 2024
1 parent 1041d1f commit fce13f2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
1 change: 1 addition & 0 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, 分享你的脚本.

<p align="center"><img src="https://cdn.jsdelivr.net/gh/bitjerry/Headers@main/images/custom_script.png" alt="screenshots"></p>

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/scripts/template.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit fce13f2

Please sign in to comment.