Skip to content

Commit

Permalink
feat: additional (e.g. hobby) archive
Browse files Browse the repository at this point in the history
  • Loading branch information
mwoz123 committed Nov 13, 2023
1 parent fb5bce7 commit c46d4d7
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@ import { App, Editor, MarkdownView, Plugin, PluginSettingTab, Setting, TFile } f

interface PluginSettings {
archiveFile: string;
archiveHobbyFile: string;
}

const DEFAULT_SETTINGS: PluginSettings = {
archiveFile: 'archive.md'
archiveFile: 'archive.md',
archiveHobbyFile: 'archive-hobby.md'
}

export default class ArchiveToSingleFilePlugin extends Plugin {
Expand All @@ -30,7 +32,6 @@ export default class ArchiveToSingleFilePlugin extends Plugin {
}

onunload() {

}

async loadSettings() {
Expand Down Expand Up @@ -75,13 +76,23 @@ class ArchiveToSingleFilePluginSettingTab extends PluginSettingTab {

new Setting(containerEl)
.setName('Archive file path')
.setDesc('with folder (if required)')
.setDesc('with folder prefix (if required)')
.addText(text => text
.setPlaceholder('archive.md')
.setValue(this.plugin.settings.archiveFile)
.onChange(async (value) => {
this.plugin.settings.archiveFile = value;
await this.plugin.saveSettings();
}));
new Setting(containerEl)
.setName('Additional (e.g. hobby, work) archive')
.setDesc('with folder prefix (if required)')
.addText(text => text
.setPlaceholder('archive-hobby.md')
.setValue(this.plugin.settings.archiveHobbyFile)
.onChange(async (value) => {
this.plugin.settings.archiveHobbyFile = value;
await this.plugin.saveSettings();
}));
}
}

0 comments on commit c46d4d7

Please sign in to comment.