2 Star 11 Fork 5

烟草的香味 / markdownImage

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
Unlicense

将markdown文件中的图片转换成base64编码

提示

因本人改为使用: typore+PicGo+oss 进行文章的图片管理, 暂时没有对此项目使用的需求了, 故暂时停止更新.

若你在使用时, 碰到问题, 可以提 issuse 给我, 有时间我会加上的

你们在使用markdown的时候有没有这样的烦恼?

  • 文本中的图片保存在本地, 如果给别人发送markdown文件就要连文件夹一起发送, 而且还要担心路径不要出错
  • 文本的图片保存在本地, 编辑完成后想将编辑好的md发布到博客, 但是你发现本地文件不能粘贴
  • 图片保存到服务器, 如果哪天服务器一关, 我之前的所有图片都没了

基于此, 我写了这样一个脚本, 方便自己也方便他人

这个脚本可以将你的md文件中所有图片进行压缩后base64编码, 直接写道markdown文件中, 再也不用担心图片路径什么的了, 你可以在本地进行编辑, 编辑完成后运行脚本一键转换

还有, 这个脚本目前处于初级阶段, 也欢迎大家一起来找茬..

使用介绍

下载后执行

python main.py -h

查看帮助文档, 如果要压缩图片, 请将 配置文件中的 tinify_key 更换为你自己的

目前压缩图片仅有tinypng一个, 可以自由添加多个

tinify_key 获取方式

打开网站: https://tinypng.com/ 注册账号. 打开个人账号页面.

截屏2020-04-25下午5.16.56

再个人页面找到自己的key, 每个账户每月有500张. 如果没有显示key, 申请一个就好了

截屏2020-04-25下午5.18.39


顺便悄悄告诉你, 这篇文章就是用这个工具转换的.

This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to <http://unlicense.org>

简介

将markdown文件中的图片进行压缩编码, 放到文件中 展开 收起
Python
Unlicense
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/hujingnb/markdownImage.git
git@gitee.com:hujingnb/markdownImage.git
hujingnb
markdownImage
markdownImage
master

搜索帮助