mirror of
https://github.com/codeonquer/obsidian-sync-config-folder-to-common-folder.git
synced 2026-07-22 10:00:23 +00:00
feat: review
This commit is contained in:
parent
5bec950843
commit
e792ff380c
6 changed files with 14 additions and 18 deletions
|
|
@ -5,7 +5,7 @@ The development of this plugin was motivated by the following two reasons:
|
|||
- The config folder for Obsidian must start with a dot (`.`);
|
||||
- Some synchronization tools used do not support syncing folders that start with a dot (`.`).
|
||||
|
||||
Therefore, the plugin was developed to synchronize the contents of the config folder to a common folder with the command `Sync ConfigFolder to CommonFolder`, and it also supports restoring the config folder from the common folder with the command `Restore ConfigFolder from CommonFolder`.
|
||||
Therefore, the plugin was developed to synchronize the contents of the config folder to a common folder with the command `Sync`, and it also supports restoring the config folder from the common folder with the command `Restore`.
|
||||
|
||||
The settings for the common folder support both relative and absolute paths, with relative paths based on the root folder of the current Vault.
|
||||
|
||||
|
|
@ -14,6 +14,6 @@ The settings for the common folder support both relative and absolute paths, wit
|
|||
- obsidian 的配置路径必须以 `.` 开头;
|
||||
- 使用的部分同步工具不支持同步以 `.` 开头的目录;
|
||||
|
||||
所以开发该插件将配置目录的内容同步到普通目录之中(`Sync ConfigFolder to CommonFolder` 命令),也支持将配置目录复原到配置目录之中(`Restore ConfigFolder from CommonFolder` 命令)。
|
||||
所以开发该插件将配置目录的内容同步到普通目录之中(`Sync` 命令),也支持将配置目录复原到配置目录之中(`Restore` 命令)。
|
||||
|
||||
设置的普通目录支持相对路径和绝对路径,相对路径基于当前 Vault 的根目录。
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"id": "sync-config-folder-to-common-folder",
|
||||
"name": "Sync ConfigFolder to CommonFolder",
|
||||
"description": "Sync ConfigFolder to CommonFolder",
|
||||
"name": "Sync config folder to common folder",
|
||||
"description": "Sync contents from config folder to common folder for backup or other purposes",
|
||||
"author": "codeonquer",
|
||||
"authorUrl": "https://github.com/codeonquer",
|
||||
"isDesktopOnly": true,
|
||||
"version": "1.0.1",
|
||||
"minAppVersion": "0.15.0"
|
||||
"version": "1.0.2",
|
||||
"minAppVersion": "1.5.0"
|
||||
}
|
||||
|
|
@ -45,13 +45,10 @@ export class SyncPlugin extends Plugin {
|
|||
|
||||
async loadSettings() {
|
||||
const originData = await this.loadData();
|
||||
console.log('sync-config-folder-to-common-folder loadData ', originData);
|
||||
this.settings = Object.assign({}, DEFAULT_SETTINGS, originData);
|
||||
console.log('sync-config-folder-to-common-folder loadSettings ', this.settings);
|
||||
}
|
||||
|
||||
async saveSettings() {
|
||||
console.log('sync-config-folder-to-common-folder saveData ', this.settings);
|
||||
await this.saveData(this.settings);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,10 +16,8 @@ export class SyncSettingTab extends PluginSettingTab {
|
|||
|
||||
containerEl.empty();
|
||||
|
||||
containerEl.createEl('h1', { text: 'The following changes need to be restarted to take effect (以下修改都需要重启生效)' });
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Config Folder Path')
|
||||
.setName('Config folder path')
|
||||
.setDesc('Customize the path filled in ConfigFolder, which needs to be consistent with the one in Files and links->Override config folder (自定义填入 ConfigFolder 的路径,需要和 文件与链接->切换配置文件夹 中的保持一致)')
|
||||
.addText(text => text
|
||||
.setPlaceholder(DEFAULT_CONFIG_FOLDER_PATH)
|
||||
|
|
@ -30,7 +28,7 @@ export class SyncSettingTab extends PluginSettingTab {
|
|||
}));
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Common Folder Path')
|
||||
.setName('Common folder path')
|
||||
.setDesc('Customize the path to be filled in ConfigFolder for synchronization. The relative path needs to start with ./ or ../ (自定义填入 ConfigFolder 同步的路径,相对路径需要以 ./ 或者 ../ 开头)')
|
||||
.addText(text => text
|
||||
.setPlaceholder(DEFAULT_COMMON_FOLDER_PATH)
|
||||
|
|
@ -41,8 +39,8 @@ export class SyncSettingTab extends PluginSettingTab {
|
|||
}));
|
||||
|
||||
new Setting(containerEl)
|
||||
.setName('Auto Save Interval')
|
||||
.setDesc('Customize the auto save time interval in seconds, 0 means off (自定义自动保存的时间间隔,单位是秒,0 代表关闭)')
|
||||
.setName('Auto save interval')
|
||||
.setDesc('Customize the auto save time interval in seconds, 0 means off (自定义自动保存的时间间隔,单位是秒,0 代表关闭). Need to be restarted to take effect (修改都需要重启生)')
|
||||
.addText(text => text
|
||||
.setPlaceholder(String(DEFAULT_INTERVAL))
|
||||
.setValue(String(this.plugin.settings.autoSaveInterval))
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "obsidian-sync-config-folder-to-common-folder",
|
||||
"version": "1.0.1",
|
||||
"description": "Obsidian Sync ConfigFolder to CommonFolder",
|
||||
"version": "1.0.2",
|
||||
"description": "Sync contents from config folder to common folder for backup or other purposes",
|
||||
"keywords": [],
|
||||
"author": "codeonquer",
|
||||
"repository": {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
{
|
||||
"1.0.0": "0.15.0",
|
||||
"1.0.1": "0.15.0"
|
||||
"1.0.1": "0.15.0",
|
||||
"1.0.2": "1.5.0"
|
||||
}
|
||||
Loading…
Reference in a new issue