How suptimio/viewlive works
ViewLive is a VS Code extension that opens Markdown files in a live WYSIWYG editor. The main workflow is: a VS Code user opens a Markdown file, the extension presents the editor, webview code parses and renders Markdown, and edits are written back to the file. Editing also includes table and list actions; separate branches handle links, PDF export, styles and themes, and saved preferences. The graph uses the sampled entry point and module references; some extension-to-webview wiring and unsampled subsystem internals are documented by the README rather than shown in source excerpts.
Main entry points: main.ts Webview entry · extension.ts Extension host · host.ts Host messaging · editor.ts WYSIWYG editor
Components 19
VS Code Extension
- Extension host
src/extension.ts
Markdown Editing
- Webview entry
webview/src/main.ts - WYSIWYG editor
webview/src/editor/editor.ts - Markdown parser
webview/src/editor/markdown.ts - Inline previews
webview/src/editor/preview.ts - List actions
webview/src/actions/list.ts - Table editing
webview/src/actions/table.ts - Link handling
webview/src/editor/links.ts - Link completion
webview/src/editor/link-completion.ts
Paper and UI
- Styles workbench
webview/src/ui/style-menu.ts - Style profiles
webview/src/paper/profiles.ts - Theme handling
webview/src/paper/theme.ts - Toolbar
webview/src/ui/toolbar.ts - Action menu
webview/src/ui/tool-menu.ts - Paper styles
webview/src/paper/style.css
Host Services
- Host messaging
webview/src/host/host.ts - Preferences
webview/src/host/preferences.ts - PDF export
webview/src/host/exporter.ts
Other components
- VS Code user
Connections 26
- VS Code user → Extension host: opens Markdown
README.md - Extension host → Webview entry: opens editor
README.md - Webview entry → WYSIWYG editor: creates editor
webview/src/main.ts - Webview entry → Markdown parser: creates parser
webview/src/main.ts - WYSIWYG editor → Markdown parser: parses source
webview/src/editor/editor.ts - Markdown parser → Inline previews: renders nodes
- Webview entry → Action menu: sets up menu
webview/src/main.ts - Action menu → Table editing: runs actions
- Action menu → List actions: runs actions
- Inline previews → Table editing: dispatches edits
webview/src/editor/preview.ts - Table editing → List actions: sorts rows
webview/src/actions/table.ts - Webview entry → Link handling: sets up links
webview/src/main.ts - Webview entry → Link completion: sets up completion
webview/src/main.ts - WYSIWYG editor → Host messaging: sends edits
webview/src/editor/editor.ts - Webview entry → Host messaging: handles messages
webview/src/main.ts - Host messaging → Extension host: exchanges messages
webview/src/host/host.ts - Extension host → Extension host: writes file edits
README.md - Webview entry → Preferences: loads preferences
webview/src/main.ts - Preferences → Host messaging: posts updates
webview/src/host/preferences.ts - Webview entry → PDF export: sets up export
webview/src/main.ts - PDF export → Host messaging: sends PDF
webview/src/main.ts - Webview entry → Styles workbench: sets up styles
webview/src/main.ts - Styles workbench → Style profiles: selects profile
webview/src/ui/style-menu.ts - Webview entry → Theme handling: sets theme
webview/src/main.ts - Webview entry → Toolbar: sets up toolbar
webview/src/main.ts - Styles workbench → Paper styles: applies CSS