@@ -32,8 +32,27 @@ Convert image links in all Markdown files within a folder to online Markdown lin
3232
3333想把有道云笔记里的几千篇笔记迁移到 Obsidian 中,感谢[ youdaonote-pull] ( https://github.com/DeppWang/youdaonote-pull ) 提供的有道云笔记的全量导出功能,很快把所有笔记导出到了本地文件夹,但是由于几千张笔记中的图片也保留在本地,不方便移动端使用,所以想把图片上传到图床,使用markdown链接到笔记里。于是自己写了个批量转换并上传图片的程序。
3434
35+ ## 安装包运行
36+
37+ 1 . 下载安装包
38+ 2 . 解压
39+ 3 . 配置 ` config.json ` 文件
40+ - 配置 ` vault_directory ` 为笔记所在的文件夹路径
41+ - 配置 ` upload_url ` 为 PicList/PicGo 服务的 URL
42+ - 配置 ` base_url ` 为图床的 URL
43+ - 配置 ` cleanup ` 为是否清理本地图片
44+ 4 . 运行
45+ - Windows 用户双击 ` upload-images.exe ` 运行。
46+ - macOS 在terminal中输入 ` ./upload-images ` 运行。
47+
48+
49+ ## 使用Python运行或开发
3550### 安装
3651
52+ 环境准备:python、poetry
53+
54+ 直接运行poetry install即可完成依赖项和环境安装
55+
3756``` bash
3857poetry install
3958```
@@ -45,15 +64,17 @@ poetry install
4564#### 使用命令行参数
4665
4766``` bash
48- poetry run upload-all-images-in-markdown < vault_directory> --upload_url < UPLOAD_URL> --cleanup
67+ python upload_all_images_in_markdown/main.py < vault_directory> --upload_url < UPLOAD_URL> --cleanup
4968```
5069
5170#### 使用配置文件
5271
5372``` bash
54- poetry run upload-all-images-in-markdown --config config.json
73+ python upload_all_images_in_markdown/main.py --config config.json
5574```
5675
76+ 不指定配置文件名时,会使用默认配置文件名` config.json `
77+
5778#### 结合使用
5879
5980命令行参数会覆盖配置文件中的值。
@@ -89,9 +110,7 @@ poetry run pytest
89110---
90111
91112## English Documentation
92-
93113### Table of Contents
94-
95114- [ English Documentation] ( #english-documentation )
96115 - [ Table of Contents] ( #table-of-contents )
97116 - [ Introduction] ( #introduction )
@@ -119,6 +138,10 @@ I wanted to migrate thousands of notes from Youdao Cloud Notes to Obsidian. Than
119138
120139### Installation
121140
141+ Prerequisites: Python, Poetry
142+
143+ Run the following command to install dependencies and set up the environment:
144+
122145``` bash
123146poetry install
124147```
@@ -130,21 +153,23 @@ You can run the script with command-line arguments or specify a configuration fi
130153#### Using Command-Line Arguments
131154
132155``` bash
133- poetry run upload-all-images-in-markdown < vault_directory> --upload_url < UPLOAD_URL> --cleanup
156+ python upload_all_images_in_markdown/main.py < vault_directory> --upload_url < UPLOAD_URL> --cleanup
134157```
135158
136159#### Using a Configuration File
137160
138161``` bash
139- poetry run upload-all-images-in-markdown --config config.json
162+ python upload_all_images_in_markdown/main.py --config config.json
140163```
141164
165+ If no configuration file is specified, the default ` config.json ` will be used.
166+
142167#### Combining Both
143168
144169Command-line arguments will override the values in the configuration file.
145170
146171``` bash
147- poetry run upload-all-images-in-markdown --config config.json --upload_url < UPLOAD_URL>
172+ python upload_all_images_in_markdown/main.py --config config.json --upload_url < UPLOAD_URL>
148173```
149174
150175### Configuration
0 commit comments