feat(project): scaffold Vue 3 + Vite markdown editor
Add initial project structure including: - .gitignore and VSCode settings - Vite configuration and package.json with Vue 3 dependencies - Basic HTML entry point and README update - Core source files: App.vue, main.js, style.css - Markdown editor component with plugin system and related types - Sample HelloWorld component, router, and Pinia store - Assets and SVG icons This commit establishes the foundation for the Vue 3 application.
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
import type { MarkdownPlugin } from './types'
|
||||
|
||||
/**
|
||||
* Global plugin registry.
|
||||
* Plugins can implement lifecycle hooks defined in {@link MarkdownPlugin}.
|
||||
*/
|
||||
export const plugins: MarkdownPlugin[] = []
|
||||
@@ -0,0 +1,21 @@
|
||||
export interface MarkdownPlugin {
|
||||
/**
|
||||
* Called during component setup. Allows plugin to initialize.
|
||||
* @param context - an object that can be extended by plugins.
|
||||
*/
|
||||
onSetup?(context: Record<string, any>): void
|
||||
|
||||
/**
|
||||
* Called after markdown is parsed to HTML, before emitting.
|
||||
* Allows plugin to modify the HTML.
|
||||
* @param payload - contains original markdown and generated html.
|
||||
*/
|
||||
onAfterParse?(payload: { markdown: string; html: string }): { html?: string }
|
||||
|
||||
/**
|
||||
* Called right before the HTML is rendered (e.g., before v-html).
|
||||
* Allows final adjustments.
|
||||
* @param payload - contains html that will be rendered.
|
||||
*/
|
||||
onBeforeRender?(payload: { html: string }): { html?: string }
|
||||
}
|
||||
Reference in New Issue
Block a user