# jungkhyun/ezmarkdown architecture

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

- Interactive diagram: https://gitdiagram.com/jungkhyun/ezmarkdown
- Repository: https://github.com/jungkhyun/ezmarkdown

## Overview

EzMarkDown is a portable Markdown viewer/editor with both a standalone browser experience and a Windows desktop host. The main workflow is opening or dropping a Markdown file, viewing or editing it, then saving changes; the README also documents preview/split/edit modes, Mermaid rendering, TOC navigation, themes, and multiple windows. The sampled Program.cs shows desktop instance/window management and file loading into WebView2. Front-end internals are not sampled, so their documented capabilities are represented at the index.html level.

Main entry points: [`Program.cs`](https://github.com/jungkhyun/ezmarkdown/blob/main/Program.cs) (Desktop host), [`index.html`](https://github.com/jungkhyun/ezmarkdown/blob/main/index.html) (Markdown preview)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_desktop["Windows desktop"]
  node_windows["Desktop host<br/>[Program.cs]"]
  node_windowing["Multi-window routing<br/>[Program.cs]"]
  node_webview["WebView2 surface<br/>[Program.cs]"]
end

subgraph group_web["Web experience"]
  node_browser["Browser app<br/>[index.html]"]
end

subgraph group_document["Document features"]
  node_editor["Markdown editor<br/>[index.html]"]
  node_modes["View modes<br/>[index.html]"]
  node_preview["Markdown preview<br/>[index.html]"]
  node_mermaid["Mermaid diagrams<br/>[index.html]"]
  node_toc["TOC navigation<br/>[index.html]"]
  node_theme["Theme switching<br/>[index.html]"]
end

subgraph group_state["Local state"]
  node_localfiles[("Markdown files")]
  node_windowsettings[("Window bounds<br/>[Program.cs]")]
end

node_user(("Reader/editor"))
node_webviewruntime["WebView2 runtime"]

node_user -->|"opens desktop"| node_windows
node_user -->|"opens browser app"| node_browser
node_windows -->|"routes launch"| node_windowing
node_windowing -->|"creates window"| node_webview
node_webview -->|"initializes"| node_webviewruntime
node_webview -->|"sends opened text"| node_editor
node_user -->|"selects or drops"| node_localfiles
node_windows -->|"reads and saves"| node_localfiles
node_browser -->|"opens dropped files"| node_editor
node_editor -->|"switches modes"| node_modes
node_modes -->|"shows rendered text"| node_preview
node_preview -->|"renders diagrams"| node_mermaid
node_preview -->|"builds navigation"| node_toc
node_preview -->|"synchronizes colors"| node_theme
node_editor -->|"saves edits"| node_localfiles
node_windows -->|"stores bounds"| node_windowsettings
node_windowsettings -->|"restores bounds"| node_windows

click node_windows "https://github.com/jungkhyun/ezmarkdown/blob/main/Program.cs"
click node_windowing "https://github.com/jungkhyun/ezmarkdown/blob/main/Program.cs"
click node_webview "https://github.com/jungkhyun/ezmarkdown/blob/main/Program.cs"
click node_browser "https://github.com/jungkhyun/ezmarkdown/blob/main/index.html"
click node_editor "https://github.com/jungkhyun/ezmarkdown/blob/main/index.html"
click node_modes "https://github.com/jungkhyun/ezmarkdown/blob/main/index.html"
click node_preview "https://github.com/jungkhyun/ezmarkdown/blob/main/index.html"
click node_mermaid "https://github.com/jungkhyun/ezmarkdown/blob/main/index.html"
click node_toc "https://github.com/jungkhyun/ezmarkdown/blob/main/index.html"
click node_theme "https://github.com/jungkhyun/ezmarkdown/blob/main/index.html"
click node_windowsettings "https://github.com/jungkhyun/ezmarkdown/blob/main/Program.cs"

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_windows,node_windowing,node_webview,node_webviewruntime toneBlue
class node_browser toneAmber
class node_editor,node_modes,node_preview,node_mermaid,node_toc,node_theme toneMint
class node_localfiles,node_windowsettings toneRose
class node_user toneIndigo
```

## Components

### Windows desktop

- [Desktop host](https://github.com/jungkhyun/ezmarkdown/blob/main/Program.cs): `Program.cs`
- [Multi-window routing](https://github.com/jungkhyun/ezmarkdown/blob/main/Program.cs): `Program.cs`
- [WebView2 surface](https://github.com/jungkhyun/ezmarkdown/blob/main/Program.cs): `Program.cs`

### Web experience

- [Browser app](https://github.com/jungkhyun/ezmarkdown/blob/main/index.html): `index.html`

### Document features

- [Markdown editor](https://github.com/jungkhyun/ezmarkdown/blob/main/index.html): `index.html`
- [View modes](https://github.com/jungkhyun/ezmarkdown/blob/main/index.html): `index.html`
- [Markdown preview](https://github.com/jungkhyun/ezmarkdown/blob/main/index.html): `index.html`
- [Mermaid diagrams](https://github.com/jungkhyun/ezmarkdown/blob/main/index.html): `index.html`
- [TOC navigation](https://github.com/jungkhyun/ezmarkdown/blob/main/index.html): `index.html`
- [Theme switching](https://github.com/jungkhyun/ezmarkdown/blob/main/index.html): `index.html`

### Local state

- **Markdown files**
- [Window bounds](https://github.com/jungkhyun/ezmarkdown/blob/main/Program.cs): `Program.cs`

### Other components

- **Reader/editor**
- **WebView2 runtime**

## Connections

- Reader/editor → Desktop host: opens desktop (evidence: `README.md`)
- Reader/editor → Browser app: opens browser app (evidence: `README.md`)
- Desktop host → Multi-window routing: routes launch (evidence: `Program.cs`)
- Multi-window routing → WebView2 surface: creates window (evidence: `Program.cs`)
- WebView2 surface → WebView2 runtime: initializes (evidence: `Program.cs`)
- WebView2 surface → Markdown editor: sends opened text (evidence: `Program.cs`)
- Reader/editor → Markdown files: selects or drops (evidence: `README.md`)
- Desktop host → Markdown files: reads and saves (evidence: `README.md`)
- Browser app → Markdown editor: opens dropped files (evidence: `README.md`)
- Markdown editor → View modes: switches modes (evidence: `README.md`)
- View modes → Markdown preview: shows rendered text (evidence: `README.md`)
- Markdown preview → Mermaid diagrams: renders diagrams (evidence: `README.md`)
- Markdown preview → TOC navigation: builds navigation (evidence: `README.md`)
- Markdown preview → Theme switching: synchronizes colors (evidence: `README.md`)
- Markdown editor → Markdown files: saves edits (evidence: `README.md`)
- Desktop host → Window bounds: stores bounds (evidence: `Program.cs`)
- Window bounds → Desktop host: restores bounds (evidence: `Program.cs`)
