Skip to content
This repository was archived by the owner on Sep 1, 2024. It is now read-only.

Commit 121cf97

Browse files
committed
perf: improve setting and add donation
1 parent 57df0b2 commit 121cf97

8 files changed

+38
-16
lines changed

.github/funding/QR_alipay.jpg

214 KB
Loading

.github/funding/QR_wechat.jpg

120 KB
Loading

CHANGELOG.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
1+
## [2.1.4](https://github.com/JYC333/obsidian-file-structure-format/compare/2.1.3...2.1.4) (2023-12-07)
2+
3+
4+
### Performance Improvements
5+
6+
* improve setting and add donation ([56c02a6](https://github.com/JYC333/obsidian-file-structure-format/commit/56c02a63d2ce75c0c21db5d19ef756521a9ec142))
7+
8+
9+
110
## [2.1.3](https://github.com/JYC333/obsidian-file-structure-format/compare/2.1.0...2.1.3) (2023-11-14)
211

312

413
### Bug Fixes
514

6-
* fix destination conflict ([5830926](https://github.com/JYC333/obsidian-file-structure-format/commit/583092624d1bc2c04ea2e7355ee256843eaa2508)), closes [#31](https://github.com/JYC333/obsidian-file-structure-format/issues/31)
715
* fix setting issue after pull request ([582b9fd](https://github.com/JYC333/obsidian-file-structure-format/commit/582b9fd3b5a6fe622e12ce4b4f4bfe01388a285d)), closes [#32](https://github.com/JYC333/obsidian-file-structure-format/issues/32)
8-
* fix vault config bug ([60084b3](https://github.com/JYC333/obsidian-file-structure-format/commit/60084b3df9e0f27fcf2382c4b8ebeb08605ab38d)), closes [#30](https://github.com/JYC333/obsidian-file-structure-format/issues/30)
916

1017

1118

README.md

+20-9
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
## Obsidian Attachment Name Formatting
22

3-
This plugin will format all attachments in the format: "notename attachmentFormat indexNumber.xxx"
3+
This plugin will format all attachments in the format: "noteName attachmentFormat indexNumber.xxx"
44

5-
The attachmentFormat are image, audio, video and pdf. IndexNumber is ascending number from 1 based on the attchmentFormat.You can change the default format for different type of attachments and the connector in the setting. Basically, there are three types of format:
5+
The attachmentFormat are image, audio, video and pdf. IndexNumber is ascending number from 1 based on the attchmentFormat.You can change the default format for different type of attachments and the connector in the setting. Basically, there are three components can be enabled or disabled in attachment name: **noteName**, **time** (format time), and **pathHash** (absolute note path hash). Therefore, there could be seven types for the attachment name format:
66

7-
1. notename attachmentFormat indexNumber.xxx
8-
2. notename attachmentFormat indexNumber time.xxx
9-
3. attachmentFormat indexNumber time.xxx
7+
1. noteName attachmentFormat indexNumber.xxx
8+
2. noteName attachmentFormat indexNumber time.xxx
9+
3. noteName attachmentFormat indexNumber pathHash.xxx
10+
4. noteName attachmentFormat indexNumber time pathHash.xxx
11+
5. attachmentFormat indexNumber time.xxx
12+
6. attachmentFormat indexNumber pathHash.xxx
13+
7. attachmentFormat indexNumber time pathHash.xxx
1014

1115
The space in between can be set by your choice, even use nothing in between.
1216

@@ -24,11 +28,11 @@ When using "Copy" mode, it will take a bit longer time than usual renaming time,
2428

2529
#### Core Function
2630

27-
- Format attachments in active file, such as "notename image 1.png". It can also add modify time after index, such as "notename image 1 20220101000000.png", defualt setting is not adding time. You can also exclude the notename in the attachment notename, but the time suffix will be added automatically.
31+
- Format attachments in active file, such as "noteName image 1.png". Format time and absolute note path hash can add into attachment name, such as "noteName image 1 20220101000000.png", "noteName image 1 6666cd76.png". Defualt setting is not adding time and path hash. You can also exclude the noteName in the attachment noteName, but the time suffix will be added automatically.
2832
- Format attachmnets in selected folder
2933
- Format attachments with customize subfolder for each attachment type
3034
- Attachment name can be customized for each type of attachment, you can use any character that allowed in a note name
31-
- Connector (the character between notename, attachmentFormat, indexNumber and time) can be customized, you can use any character that allowed in a note name. You can also customized different connectors seperately or even don't use connector.
35+
- Connector (the character between noteName, attachmentFormat, indexNumber, time and pathHash) can be customized, you can use any character that allowed in a note name. You can also customized different connectors seperately or even don't use connector.
3236
- Add new attachment -> will rename the attachment based on type and index
3337
- Change order -> will rename attachments with new order
3438
- Delete attachment -> will rename attachments with new order
@@ -54,9 +58,8 @@ When using "Copy" mode, it will take a bit longer time than usual renaming time,
5458

5559
### Roadmap
5660

57-
- When deleting attachment in a file, rename it with "notename attachmentFormat unuse 1.xxx".
61+
- When deleting attachment in a file, rename it with "noteName attachmentFormat unuse 1.xxx".
5862
- When deleting an attachment that no other file using this attachment, delete it from vault. (Could be disable)
59-
- Support the situation that attachments have same name but under different path.
6063

6164
### Development Setup
6265

@@ -86,6 +89,14 @@ npm run version --new=<new_version>
8689
git push origin --tag
8790
```
8891

92+
## Thanks
93+
94+
I develop this plugin as a hobby, spending my free time doing this. If you find it valuable, then please say THANK YOU or buy me a coffee...
95+
96+
![Alipay](.github/funding/QR_alipay.jpg)
97+
![Wechat](.github/funding/QR_wechat.jpg)
98+
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/G2G7RXRRO)
99+
89100
### LICENSE
90101

91102
MIT

manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"id": "obsidian-attachment-name-formatting",
33
"name": "Attachment Name Formatting",
4-
"version": "2.1.3",
4+
"version": "2.1.4",
55
"minAppVersion": "0.12.0",
66
"description": "Obsidian plugin for formatting attachments name (filename attachmentType indexNumber.xxx)",
77
"author": "JYC333",

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "obsidian-attachment-name-formattion",
3-
"version": "2.1.3",
3+
"version": "2.1.4",
44
"description": "Obsidian plugin for formatting attachments name (filename attachmentType indexNumber.xxx)",
55
"main": "main.js",
66
"scripts": {

src/settings.ts

+5-2
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ export class ANFSettingTab extends PluginSettingTab {
148148
] as string)
149149
)
150150
.onChange(async (value) => {
151-
const fileNamepatn = /\||<|>|\?|\*|:|\/|\\|#|\^|\[|\]"|%/;
151+
const fileNamepatn =
152+
/\||<|>|\?|\*|:|\/|\\|#|\^|\[|\]"|%/;
152153
if (fileNamepatn.test(value)) {
153154
new WarningModal(
154155
this.app,
@@ -286,7 +287,9 @@ export class ANFSettingTab extends PluginSettingTab {
286287
.setValue(this.plugin.settings.enableExcludeFileName)
287288
.onChange(async (value) => {
288289
this.plugin.settings.enableExcludeFileName = value;
289-
this.plugin.settings.enableTime = value;
290+
if (!this.plugin.settings.enablePathHash && value) {
291+
this.plugin.settings.enableTime = value;
292+
}
290293
this.plugin.settings.multipleConnectorsEnabled[0] =
291294
!value;
292295
this.plugin.settings.oneInMany = "Default";

versions.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,6 @@
2525
"2.1.0": "0.12.0",
2626
"2.1.1": "0.12.0",
2727
"2.1.2": "0.12.0",
28-
"2.1.3": "0.12.0"
28+
"2.1.3": "0.12.0",
29+
"2.1.4": "0.12.0"
2930
}

0 commit comments

Comments
 (0)