Coder Social home page Coder Social logo

moriarty1024 / img_upload_for_markdown Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lixint/img_upload_for_markdown

0.0 0.0 0.0 24 KB

自动上传Markdown中图片到图床并替换链接;Auto upload image in Markdown file to smms or tencentcloud cos

License: GNU General Public License v3.0

Python 100.00%

img_upload_for_markdown's Introduction

img_upload_for_Markdown

自动上传Markdown中的图片到SMMS图床或者腾讯云cos

相关依赖:

Python3
requests
cos-python-sdk-v5    https://github.com/tencentyun/cos-python-sdk-v5

使用方法:

python imgupload tx/smms/clearline <filename.md>

本来是专为Hexo博客用的,所以默认的imgupload中设置的是寻找路径\source\_posts\的文件。

使用腾讯云对象存储需要在UploadImg.ini中设置secret_idsecret_keyregionBucket

上传腾讯云对象存储默认建立一个以文件名命名的文件夹存放图片。

Hexo博客使用方法

下载uploadparser.pyimguploadUploadImg.ini放到博客根目录。如果使用腾讯云cos的话先填好secret_idsecret_keyregionBucket

以smms图床为例,在写完文章hexo g -d以前,输入python imgupload smms article.md,等待上传完成。

参数解释

tx: 腾讯云cos

smms:smms图床

clearline: 清除markdown文件中的空行

local :使用相对引用图片,目前不可用。

使用示例

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.