andy-stack_vaultkeeper-ai/Views/MainView.ts
Andrew Beal 3f37870aaa Add markdown rendering support with KaTeX and highlight.js
- Updated package.json to include dependencies for rehype and remark plugins for markdown processing.
- Added default highlight.js CSS for code highlighting.
- Included KaTeX CSS for rendering mathematical expressions.
- Created markdown.css for styling markdown content in the Obsidian plugin, incorporating styles for headings, paragraphs, lists, tables, and code blocks.
- Customized highlight.js colors to match Obsidian theme.
2025-09-16 17:14:37 +01:00

37 lines
No EOL
702 B
TypeScript

import { ItemView, WorkspaceLeaf } from 'obsidian';
import { mount, unmount } from 'svelte';
import ChatWindow from 'Components/ChatWindow.svelte';
export const VIEW_TYPE_MAIN = 'main-view';
export class MainView extends ItemView {
constructor(leaf: WorkspaceLeaf) {
super(leaf);
}
input: ReturnType<typeof ChatWindow> | undefined;
getViewType() {
return VIEW_TYPE_MAIN;
}
getDisplayText() {
return 'Main View';
}
async onOpen() {
const container = this.contentEl;
container.empty();
this.input = mount(ChatWindow, {
target: container,
props: {}
});
}
async onClose() {
if (this.input) {
unmount(this.input);
}
}
}