Giter VIP home page Giter VIP logo

imagebedmoving's Introduction

ImageBedMoving

ImageBedMoving做了什么?

  1. ImageBedMoving会先读取ImageMoving.properties内的配置信息
  2. 遍历NotesDir文件树下的所有md内容,将符合配置要求的图片移动到同级目录下的vx_images
  3. 进行笔记备份,存储到同级notes_bak目录
  4. 更新笔记中的图片路径[xxxx/图片.jpg ----> vx_images/图片.jpg]

日志存储在:${NotesDir}/00log.txt

使用教程

  1. 将本仓库clone到本地
  2. 解压jre.zip(Java运行环境),保持如下的路径imageBedMoving/jre/jre

1 ImageMoving

  1. 用记事本编辑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
  1. 双击ImageMoving_Run.bat

对于多线程,将完全遍历笔记根目录下的所有内容,并在相应目录创建各自的notes_bakvx_images

对于单线程,只对当前目录进行处理,不会遍历子目录

2 RegStringTest(如果你希望检测你的正则表达式)

这是一个正则表达式测试工具,用来辅助用户编辑ImageMoving.properties。你可以先使用RegStringTest测试你自己的正则表达式,看一下是否符合预期的效果。确认无误后再将其写入ImageMoving.properties

  1. 用记事本编辑RegStringTest.properties
  2. 双击RegStringTest_Run.bat
  3. 光标会先停顿,你可以将记事本中准备好的案例复制到终端
  4. 回车后,输入exit再次回车
  5. 程序会自动进行匹配,通过打印结果,可以检测你的正则表达式是否有效

成果展示

运行前(run before):

运行后(run after):

原笔记内容

笔记内容已被更改

imagebedmoving's People

Contributors

starleet avatar

Stargazers

Shinonome Tera tanuki avatar

Watchers

 avatar

imagebedmoving's Issues

对于路径中有. 空格等字符的是不是不支持?

Exception in thread "main" java.util.regex.PatternSyntaxException: Illegal/unsupported escape sequence near index 3
D:\OneDrive\Laycher's Knowledge Base\01.Blog\vx_images\w*-?\w*?.(jpeg|[a-zA-Z]{3})
^
at java.util.regex.Pattern.error(Unknown Source)
at java.util.regex.Pattern.escape(Unknown Source)
at java.util.regex.Pattern.atom(Unknown Source)
at java.util.regex.Pattern.sequence(Unknown Source)
at java.util.regex.Pattern.expr(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.util.regex.Pattern.(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at ImageMoving$PropertiesInfo.loadProperties(ImageMoving.java:86)
at ImageMoving.main(ImageMoving.java:199)
请按任意键继续. . .

目前在使用中发现如果路径中有. 或者空格等符号的时候,好像不能继续执行。
另外,这个图片只能放到指定的目录下吗?可以放到每个对应md文件同级的vx_images目录下吗?

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.