Coder Social home page Coder Social logo

gugu_typora_image_magic's Introduction

配合Typora以命令行方式上传图片的工具,能够根据配置自定义对接图床完成请求与解析返回的结果。

使用流程

确认对接的接口

先有一个可用的上传接口,然后根据它的文档,先用Postman等工具调通,然后再创建相应的配置。

创建配置

手动创建配置

以Windows系统为例,在%USERPROFILE%/GuGu_Typora_Image_Magic创建config.yml文件,示例内容如下

request:
# 超时时间 单位秒
  timeout: 10
# 代理配置
  proxy:
    open: false
    host:
    port:
  url: https://imgbed.link/imgbed/file/upload
  formData:
#   如果为false 那么数据将会存放在body中
    open: true
#   指定文件类型的key值
    fileName: file
#   添加其他需要的键值对
    keyValue:
      key: ab
# 添加请求头
  headers:
    Authorization: test
response:
#  超时时间 单位秒
  timeout: 10
#  json-path表达式取回需要的结果
  body: $.rows[0].url

自动创建配置

只需要手动执行一次程序,程序就会在当前系统用户下创建GuGu_Typora_Image_Magic/config.yml文件,内容如上。

配置Typora

配置Typora的上传服务设定(文件>偏好设置>图像>上传服务设定>上传服务),选择自定义命令。

在命令行中输入java -jar gugu_typora_image_magic-1.0.0-jar-with-dependencies.jar ,输入值请根据自身环境做调整。

配置完后点击验证图片上传选项,检查上传是否可用。

如果不可用

如果上传不可用且与Postman等工具对照没什么差异的话,需要下载源码手动进行Debug调式寻找问题,或者向我提issues。

gugu_typora_image_magic's People

Contributors

minmingugu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.