Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
songkg7 committed Jul 5, 2024
1 parent 4dffc17 commit 9ca1801
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
15 changes: 8 additions & 7 deletions src/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down
9 changes: 0 additions & 9 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9ca1801

Please sign in to comment.