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:
2026-01-12 12:23:44 +08:00
parent 2517aa27d5
commit 49f264b53b
20 changed files with 2261 additions and 1 deletions
+7
View File
@@ -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[] = []
+21
View File
@@ -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 }
}