- ImageBedMoving会先读取
ImageMoving.properties
内的配置信息 - 遍历
NotesDir
文件树下的所有md内容
,将符合配置要求的图片移动到同级目录
下的vx_images
- 进行笔记备份,存储到
同级notes_bak目录
- 更新笔记中的图片路径[xxxx/图片.jpg ----> vx_images/图片.jpg]
日志存储在:${NotesDir}/00log.txt
- 将本仓库clone到本地
- 解压
jre.zip
(Java运行环境),保持如下的路径imageBedMoving/jre/jre
- 用记事本编辑
ImageMoving.properties
# 笔记所在目录(需要用户自定义) 采用/路径符
NotesDir=E:/git_exercise/imageBedMoving/example
# 例如:你有一张图片![](Z:/MyNotes/github图床/cloud_img/data/图片.jpg)
# ImagesBedPathReg=Z:/MyNotes/github图床/cloud_img/data/ 可以匹配 Z:/MyNotes/github图床/cloud_img/data/
# ImageNameReg=.*?\\.(jpeg|[a-zA-Z]{3}) 可以匹配 图片.jpg
# 原图床路径(支持Java正则) 无论笔记中如何,此处统一采用/路径符
ImagesBedPathReg=Z:/MyNotes/github图床/cloud_img/data
# ------------------非必选----------------
# 匹配图片名的正则式(下式几乎可匹配所有图片名)
# 如有需求,自行编写; 填写前,请运行RegStringTest测试是否有效
ImageNameReg=.*?\\.(jpeg|[a-zA-Z]{3})
# 笔记文件名后缀 md
NotesType=md
# 是否保留原来的图片 no | yes(建议)
KeepOriginImages=yes
- 双击
ImageMoving_Run.bat
对于多线程,将完全遍历笔记根目录下的所有内容,并在相应目录创建各自的notes_bak
和vx_images
对于单线程,只对当前目录进行处理,不会遍历子目录
这是一个正则表达式测试工具,用来辅助用户编辑
ImageMoving.properties
。你可以先使用RegStringTest测试你自己的正则表达式,看一下是否符合预期的效果。确认无误后再将其写入ImageMoving.properties
- 用记事本编辑
RegStringTest.properties
- 双击
RegStringTest_Run.bat
- 光标会先停顿,你可以将记事本中准备好的案例复制到终端
- 回车后,输入exit再次回车
- 程序会自动进行匹配,通过打印结果,可以检测你的正则表达式是否有效
运行前(run before):
运行后(run after):