From 9ca18012d518557660e50a4bbac6b2bcdb179c9e Mon Sep 17 00:00:00 2001 From: haril Date: Fri, 5 Jul 2024 14:20:45 +0900 Subject: [PATCH] . --- src/settings.ts | 15 ++++++++------- src/utils.ts | 9 --------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/src/settings.ts b/src/settings.ts index fefbf7e..8389b03 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -35,12 +35,20 @@ export class O2SettingTab extends PluginSettingTab { this.containerEl.createEl('h1', { text: 'Settings for O2 plugin', }); + this.containerEl.createEl('h2', { text: 'Path Settings', }); this.addReadyFolderSetting(); this.addArchiveFolderSetting(); this.addAttachmentsFolderSetting(); + + this.containerEl.createEl('h2', { + text: 'Features', + }); + this.enableCurlyBraceSetting(); + this.enableUpdateFrontmatterTimeOnEditSetting(); + this.enableAutoCreateFolderSetting(); this.enableAutoArchiveSetting(); // jekyll settings @@ -56,13 +64,6 @@ export class O2SettingTab extends PluginSettingTab { }); this.addDocusaurusPathSetting(); this.dateExtractionPatternSetting(); - - this.containerEl.createEl('h2', { - text: 'Features', - }); - this.enableCurlyBraceSetting(); - this.enableUpdateFrontmatterTimeOnEditSetting(); - this.enableAutoCreateFolderSetting(); } private enableUpdateFrontmatterTimeOnEditSetting() { diff --git a/src/utils.ts b/src/utils.ts index b0ccc4a..ebb05b7 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -42,15 +42,6 @@ export const getFilesInReady = (plugin: O2Plugin): TFile[] => plugin.app.vault.getMarkdownFiles() .filter((file: TFile) => file.path.startsWith(plugin.obsidianPathSettings.readyFolder)); -export async function backupOriginalNotes(plugin: O2Plugin) { - const readyFiles = getFilesInReady(plugin); - const backupFolder = plugin.obsidianPathSettings.archiveFolder; - const readyFolder = plugin.obsidianPathSettings.readyFolder; - readyFiles.forEach((file: TFile) => { - return plugin.app.vault.copy(file, file.path.replace(readyFolder, backupFolder)); - }); -} - const copyFile = (sourceFilePath: string, targetFilePath: string) => { // if directory not exist create it const targetDirectory = path.dirname(targetFilePath);