lajg-dev_Obsidian-Plugin-GP.../main.ts

35 lines
1.2 KiB
TypeScript
Raw Normal View History

import { GpgSettingsTab } from 'src/SettingsTab';
import { HotKeys } from 'src/HotKeys';
import { Plugin } from 'obsidian';
2024-01-21 16:45:00 +00:00
import { GpgEncryptSettings, Settings } from 'src/Settings';
2024-01-22 15:34:10 +00:00
import { livePreviewExtensionGpgEncrypt } from 'src/LivePreview';
import { registerReadingModeProcessor } from 'src/ReadingModeProcessor';
2024-01-21 16:45:00 +00:00
// My plugin PGP Encrypt
export default class GpgEncryptPlugin extends Plugin {
2024-01-21 16:45:00 +00:00
// Settings property in PGP Encrypt Plugin
settings: GpgEncryptSettings;
2024-01-21 16:45:00 +00:00
// OnLoad Method in PGP Encrypt Plugin
async onload() {
// Load settings variables
2024-01-21 16:45:00 +00:00
await new Settings(this).loadSettings();
// Add setting tab
this.addSettingTab(new GpgSettingsTab(this.app, this));
// Add hotkeys
let hotKeys: HotKeys = new HotKeys(this.app, this);
this.addCommand(hotKeys.GpgEncryptInline);
this.addCommand(hotKeys.GpgEncryptDocument);
2024-01-22 15:34:10 +00:00
// Add Live Privew Extension GPG Encrypt
2024-01-23 02:31:28 +00:00
this.registerEditorExtension(livePreviewExtensionGpgEncrypt(this.app, this));
// Add Reading Mode Post Processor for GPG Encrypt
this.registerMarkdownPostProcessor(registerReadingModeProcessor(this.app, this));
}
2024-01-21 16:45:00 +00:00
// OnUnload Method in PGP Encrypt Plugin
onunload() {
}
}