mirror of
https://github.com/kotaindah55/extended-markdown-syntax.git
synced 2026-07-22 05:38:06 +00:00
37 lines
No EOL
1.3 KiB
TypeScript
37 lines
No EOL
1.3 KiB
TypeScript
import { Plugin } from "obsidian";
|
|
import { drawSelection } from "@codemirror/view";
|
|
import { extendedFormattingPlugin, customHighlightPlugin, alignerPlugin } from "./src/editorPlugins";
|
|
import { customHighlightField, extendedFormattingField } from "./src/editorPlugins/stateFields";
|
|
import { ExtendedFormattingPostProcessor, CustomHighlightPostProcessor, AlignerPostProcessor } from "./src/postProcessor";
|
|
|
|
export default class ExtendedMarkdownSyntax extends Plugin {
|
|
|
|
async onload() {
|
|
await this.loadData();
|
|
|
|
// state fields
|
|
this.registerEditorExtension([
|
|
extendedFormattingField,
|
|
customHighlightField
|
|
]);
|
|
|
|
// view plugins
|
|
this.registerEditorExtension([
|
|
extendedFormattingPlugin,
|
|
customHighlightPlugin,
|
|
alignerPlugin,
|
|
drawSelection()
|
|
]);
|
|
|
|
// postprocessor
|
|
this.registerMarkdownPostProcessor(new ExtendedFormattingPostProcessor(this.app.workspace).postProcess);
|
|
this.registerMarkdownPostProcessor(new CustomHighlightPostProcessor().postProcess);
|
|
this.registerMarkdownPostProcessor(new AlignerPostProcessor().postProcess);
|
|
|
|
console.log("Load Extended Markdown Syntax");
|
|
}
|
|
|
|
onunload(): void {
|
|
console.log("Unload Extended Markdown Syntax");
|
|
}
|
|
} |