Blog markdown file upload Park

Personal habit of writing blog with markdown, and then synchronized to the blog garden, each synchronization is too much trouble.

So by metaweblog realized step by gadget markdown upload files.

Tools Address: https://github.com/dongfanger/PyCnblog

On how to use the tool, visit the link to view readme

markdown picture storage settings

Write markdown have a weapon Typora, the general picture storage settings I would revise it.

Open File> Preferences, find the 'picture insertion'

1573286231251

Modified to 'copy to the specified path' rule to ./${filename}/

The following three options all checked.

So that when copying and pasting images to markdown, it will create a new folder with the same name in the directory, store pictures.

Tool Description

The basic principle of this tool is that after calling the relevant api metaweblog of the pictures uploaded to the server, obtain a replacement local address of the picture url, then upload the file to the blog garden, garden background in the blog to see the new blog.

metaweblog is an open api, and for remote interactive blog, establish a connection via xmlrpc

server = xmlrpc.client.ServerProxy(blog_url)

This uses two api: image upload .metaWeblog.newMediaObject blog and upload .metaWeblog.newPost.

Upload pictures section, by asyncio package, to achieve asynchronous upload.

config.py in gen_network_file used to control whether to generate a new file to replace the picture in the local network, turned off by default.

If you are interested or know python, visit github suggestions and exchange, ha ha.

It is also very welcome star or push.

Guess you like

Origin www.cnblogs.com/df888/p/11826480.html