# huangko555/meo-enhanced architecture

> Architecture diagram of the GitHub repository huangko555/meo-enhanced, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/huangko555/meo-enhanced
- Repository: https://github.com/huangko555/meo-enhanced

## Overview

MEO Enhanced is a VS Code Markdown editor. A user opens a Markdown document, edits it in Live or Source mode, switches to rendered Preview, and can review changes or export the result. The graph covers the documented editing, rendering, review, and export capabilities, plus the host/webview protocol that connects them. Source excerpts directly show the panel message handling and Preview rendering/export path; other capability links are included only where the README documents them.

Main entry points: [`src/extension/panelSession.ts`](https://github.com/huangko555/meo-enhanced/blob/main/src/extension/panelSession.ts) (Document panel session), [`webview/src/index.ts`](https://github.com/huangko555/meo-enhanced/blob/main/webview/src/index.ts) (Webview interface), [`src/protocol/previewRender.ts`](https://github.com/huangko555/meo-enhanced/blob/main/src/protocol/previewRender.ts) (Preview requests), [`src/export/runtime.ts`](https://github.com/huangko555/meo-enhanced/blob/main/src/export/runtime.ts) (Document export)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_host["VS Code Host"]
  node_extension["Extension activation<br/>[extension.ts]"]
  node_panel["Document panel session<br/>[panelSession.ts]"]
  node_session["Document session<br/>[documentSession.ts]"]
  node_git["Git baselines<br/>[baseline.ts]"]
  node_saved["Saved revisions"]
end

subgraph group_protocol["Shared Protocol"]
  node_protocol["Webview message protocol<br/>[messages.ts]"]
  node_sessionprotocol["Session messages<br/>[documentSession.ts]"]
  node_initprotocol["Editor initialization<br/>[readyInit.ts]"]
  node_styleprotocol["Style environment"]
  node_previewprotocol["Preview requests<br/>[previewRender.ts]"]
end

subgraph group_editor["Editing Experience"]
  node_webview["Webview interface<br/>[index.ts]"]
  node_editorcore["Live and Source editing<br/>[editor.ts]"]
  node_modes["Mode and language<br/>[editorMode.ts]"]
  node_tables["Interactive tables"]
  node_images["Image handling<br/>[images.ts]"]
  node_viewport["Reading position"]
end

subgraph group_render["Rendering and Export"]
  node_preview["Rendered preview<br/>[preview.ts]"]
  node_previewadapter["Preview webview adapter"]
  node_markdown["Markdown rendering<br/>[renderMarkdown.ts]"]
  node_export["Document export<br/>[runtime.ts]"]
end

subgraph group_review["Change Review"]
  node_changes["Change review<br/>[changesReview.ts]"]
  node_reviewcontrol["Review controls"]
end

node_user(("Markdown author"))
node_vscode["VS Code"]

node_user -->|"opens document"| node_vscode
node_vscode -.->|"activates extension"| node_extension
node_extension -->|"opens editor"| node_panel
node_panel -->|"manages session"| node_session
node_panel -->|"uses baseline"| node_git
node_panel -->|"tracks revisions"| node_saved
node_panel -->|"decodes messages"| node_protocol
node_webview -->|"decodes messages"| node_protocol
node_panel -.->|"exchanges revisions"| node_sessionprotocol
node_panel -.->|"sends initialization"| node_initprotocol
node_panel -.->|"serves editor"| node_webview
node_user -->|"edits Markdown"| node_webview
node_webview -.->|"hosts editing"| node_editorcore
node_webview -.->|"switches modes"| node_modes
node_webview -.->|"enables table editing"| node_tables
node_webview -->|"handles images"| node_images
node_webview -.->|"preserves position"| node_viewport
node_webview -.->|"shows preview"| node_preview
node_preview -->|"requests rendering"| node_previewadapter
node_previewadapter -->|"sends render request"| node_previewprotocol
node_panel -.->|"handles render request"| node_previewprotocol
node_panel -.->|"provides style data"| node_styleprotocol
node_previewprotocol -.->|"specifies rendered output"| node_markdown
node_user -->|"reviews edits"| node_changes
node_reviewcontrol -->|"controls review"| node_changes
node_panel -.->|"provides baseline state"| node_reviewcontrol
node_user -->|"exports document"| node_export
node_panel -->|"creates export snapshot"| node_export
node_export -->|"renders Markdown"| node_markdown

click node_extension "https://github.com/huangko555/meo-enhanced/blob/main/src/extension.ts"
click node_panel "https://github.com/huangko555/meo-enhanced/blob/main/src/extension/panelSession.ts"
click node_session "https://github.com/huangko555/meo-enhanced/blob/main/src/application/documentSession.ts"
click node_git "https://github.com/huangko555/meo-enhanced/blob/main/src/git/baseline.ts"
click node_saved "https://github.com/huangko555/meo-enhanced/blob/main/src/diff/savedRevisionTracker.ts"
click node_protocol "https://github.com/huangko555/meo-enhanced/blob/main/src/protocol/messages.ts"
click node_sessionprotocol "https://github.com/huangko555/meo-enhanced/blob/main/src/protocol/documentSession.ts"
click node_initprotocol "https://github.com/huangko555/meo-enhanced/blob/main/src/protocol/readyInit.ts"
click node_styleprotocol "https://github.com/huangko555/meo-enhanced/blob/main/src/protocol/editorStyleEnvironment.ts"
click node_previewprotocol "https://github.com/huangko555/meo-enhanced/blob/main/src/protocol/previewRender.ts"
click node_webview "https://github.com/huangko555/meo-enhanced/blob/main/webview/src/index.ts"
click node_editorcore "https://github.com/huangko555/meo-enhanced/blob/main/webview/src/editor.ts"
click node_modes "https://github.com/huangko555/meo-enhanced/blob/main/webview/src/application/editorMode.ts"
click node_tables "https://github.com/huangko555/meo-enhanced/blob/main/webview/src/editor/tableCellInteraction.ts"
click node_images "https://github.com/huangko555/meo-enhanced/blob/main/webview/src/helpers/images.ts"
click node_viewport "https://github.com/huangko555/meo-enhanced/blob/main/webview/src/helpers/viewportController.ts"
click node_preview "https://github.com/huangko555/meo-enhanced/blob/main/webview/src/helpers/preview.ts"
click node_previewadapter "https://github.com/huangko555/meo-enhanced/blob/main/webview/src/adapters/previewWebviewAdapter.ts"
click node_markdown "https://github.com/huangko555/meo-enhanced/blob/main/src/export/renderMarkdown.ts"
click node_export "https://github.com/huangko555/meo-enhanced/blob/main/src/export/runtime.ts"
click node_changes "https://github.com/huangko555/meo-enhanced/blob/main/webview/src/application/changesReview.ts"
click node_reviewcontrol "https://github.com/huangko555/meo-enhanced/blob/main/webview/src/adapters/changesReviewControl.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_extension,node_panel,node_session,node_git,node_saved toneBlue
class node_protocol,node_sessionprotocol,node_initprotocol,node_styleprotocol,node_previewprotocol toneAmber
class node_webview,node_editorcore,node_modes,node_tables,node_images,node_viewport toneMint
class node_preview,node_previewadapter,node_markdown,node_export toneRose
class node_changes,node_reviewcontrol,node_user,node_vscode toneIndigo
```

## Components

### VS Code Host

- [Extension activation](https://github.com/huangko555/meo-enhanced/blob/main/src/extension.ts): `src/extension.ts`
- [Document panel session](https://github.com/huangko555/meo-enhanced/blob/main/src/extension/panelSession.ts): `src/extension/panelSession.ts`
- [Document session](https://github.com/huangko555/meo-enhanced/blob/main/src/application/documentSession.ts): `src/application/documentSession.ts`
- [Git baselines](https://github.com/huangko555/meo-enhanced/blob/main/src/git/baseline.ts): `src/git/baseline.ts`
- [Saved revisions](https://github.com/huangko555/meo-enhanced/blob/main/src/diff/savedRevisionTracker.ts): `src/diff/savedRevisionTracker.ts`

### Shared Protocol

- [Webview message protocol](https://github.com/huangko555/meo-enhanced/blob/main/src/protocol/messages.ts): `src/protocol/messages.ts`
- [Session messages](https://github.com/huangko555/meo-enhanced/blob/main/src/protocol/documentSession.ts): `src/protocol/documentSession.ts`
- [Editor initialization](https://github.com/huangko555/meo-enhanced/blob/main/src/protocol/readyInit.ts): `src/protocol/readyInit.ts`
- [Style environment](https://github.com/huangko555/meo-enhanced/blob/main/src/protocol/editorStyleEnvironment.ts): `src/protocol/editorStyleEnvironment.ts`
- [Preview requests](https://github.com/huangko555/meo-enhanced/blob/main/src/protocol/previewRender.ts): `src/protocol/previewRender.ts`

### Editing Experience

- [Webview interface](https://github.com/huangko555/meo-enhanced/blob/main/webview/src/index.ts): `webview/src/index.ts`
- [Live and Source editing](https://github.com/huangko555/meo-enhanced/blob/main/webview/src/editor.ts): `webview/src/editor.ts`
- [Mode and language](https://github.com/huangko555/meo-enhanced/blob/main/webview/src/application/editorMode.ts): `webview/src/application/editorMode.ts`
- [Interactive tables](https://github.com/huangko555/meo-enhanced/blob/main/webview/src/editor/tableCellInteraction.ts): `webview/src/editor/tableCellInteraction.ts`
- [Image handling](https://github.com/huangko555/meo-enhanced/blob/main/webview/src/helpers/images.ts): `webview/src/helpers/images.ts`
- [Reading position](https://github.com/huangko555/meo-enhanced/blob/main/webview/src/helpers/viewportController.ts): `webview/src/helpers/viewportController.ts`

### Rendering and Export

- [Rendered preview](https://github.com/huangko555/meo-enhanced/blob/main/webview/src/helpers/preview.ts): `webview/src/helpers/preview.ts`
- [Preview webview adapter](https://github.com/huangko555/meo-enhanced/blob/main/webview/src/adapters/previewWebviewAdapter.ts): `webview/src/adapters/previewWebviewAdapter.ts`
- [Markdown rendering](https://github.com/huangko555/meo-enhanced/blob/main/src/export/renderMarkdown.ts): `src/export/renderMarkdown.ts`
- [Document export](https://github.com/huangko555/meo-enhanced/blob/main/src/export/runtime.ts): `src/export/runtime.ts`

### Change Review

- [Change review](https://github.com/huangko555/meo-enhanced/blob/main/webview/src/application/changesReview.ts): `webview/src/application/changesReview.ts`
- [Review controls](https://github.com/huangko555/meo-enhanced/blob/main/webview/src/adapters/changesReviewControl.ts): `webview/src/adapters/changesReviewControl.ts`

### Other components

- **Markdown author**
- **VS Code**

## Connections

- Markdown author → VS Code: opens document (evidence: `README.md`)
- VS Code → Extension activation: activates extension
- Extension activation → Document panel session: opens editor (evidence: `src/extension.ts`)
- Document panel session → Document session: manages session (evidence: `src/extension/panelSession.ts`)
- Document panel session → Git baselines: uses baseline (evidence: `src/extension/panelSession.ts`)
- Document panel session → Saved revisions: tracks revisions (evidence: `src/extension/panelSession.ts`)
- Document panel session → Webview message protocol: decodes messages (evidence: `src/extension/panelSession.ts`)
- Webview interface → Webview message protocol: decodes messages (evidence: `webview/src/index.ts`)
- Document panel session → Session messages: exchanges revisions (evidence: `src/extension/panelSession.ts`)
- Document panel session → Editor initialization: sends initialization (evidence: `src/extension/panelSession.ts`)
- Document panel session → Webview interface: serves editor
- Markdown author → Webview interface: edits Markdown (evidence: `README.md`)
- Webview interface → Live and Source editing: hosts editing
- Webview interface → Mode and language: switches modes (evidence: `webview/src/index.ts`)
- Webview interface → Interactive tables: enables table editing
- Webview interface → Image handling: handles images (evidence: `webview/src/index.ts`)
- Webview interface → Reading position: preserves position (evidence: `webview/src/index.ts`)
- Webview interface → Rendered preview: shows preview (evidence: `webview/src/index.ts`)
- Rendered preview → Preview webview adapter: requests rendering (evidence: `webview/src/helpers/preview.ts`)
- Preview webview adapter → Preview requests: sends render request (evidence: `webview/src/adapters/previewWebviewAdapter.ts`)
- Document panel session → Preview requests: handles render request (evidence: `src/extension/panelSession.ts`)
- Document panel session → Style environment: provides style data
- Preview requests → Markdown rendering: specifies rendered output
- Markdown author → Change review: reviews edits (evidence: `README.md`)
- Review controls → Change review: controls review (evidence: `webview/src/adapters/changesReviewControl.ts`)
- Document panel session → Review controls: provides baseline state
- Markdown author → Document export: exports document (evidence: `README.md`)
- Document panel session → Document export: creates export snapshot (evidence: `src/extension/panelSession.ts`)
- Document export → Markdown rendering: renders Markdown (evidence: `src/export/runtime.ts`)
