Realtime WYSIWYG markdown editing that looks like GitHub Pages in light mode - the same inline editor experience VS Code's new built-in Markdown Editor gives you, rendered with GitHub's own markdown styling.
VS Code's built-in Markdown Editor (vscode.markdown.editor) styles itself
from the active color theme and loads no user CSS, no markdown.styles, and no
extension preview styles β so it can't be themed like GitHub.
This extension ships a companion editor built on the same engine Microsoft
publishes as @vscode/markdown-editor
(MIT), mounted with its bundled github-markdown-theme β a faithful port of
GitHub's light markdown typography (headings, borders, code blocks, tables,
blockquotes, task listsβ¦).
Result: edit a .md file directly in the rendered view, GitHub-styled, in
realtime β regardless of whether VS Code itself uses a dark theme.
- Realtime WYSIWYG markdown editing (GitHub Flavored Markdown: tables, task lists, strikethrough)
- GitHub light typography and palette (Primer values), pinned independent of your VS Code theme
- Math rendering via bundled KaTeX (fonts included)
- Raw HTML rendered like GitHub (sanitized with GitHub's allowlist): centered
logos,
<picture>(variant for the active theme),<details>,<kbd>,<sub>/<sup>β¦ - Relative images (
,<img src="public/logo.png">) load from the workspace - GitHub alerts (
> [!NOTE],[!TIP],[!IMPORTANT],[!WARNING],[!CAUTION]) - Edit / read-only toggle (top-right, like the built-in Markdown Editor); the last choice becomes the default for new editors
- Links: web links open in the browser, relative links open the file in VS
Code,
#anchorlinks jump to the heading - Shares the underlying document with the text editor β edit in either view, both stay in sync
- Scroll position persists per document
- Undo/redo inside the editor
- Works with
*.md; open via Reopen Editor With⦠or a workspace mapping:
{
"workbench.editorAssociations": {
"*.md": "githubStyle.markdownEditor"
}
}- Extension host (
src/webviewEditorProvider.ts): aCustomTextEditorProvidersyncs the document to the webview; edits arrive as text diffs and are applied throughWorkspaceEdit; undo/redo use a compact snapshot history kept host-side. - Webview (
webview/main.ts): mountsEditorModel+EditorView({ classNames: ['github-markdown-theme'] })+EditorControllerfrom@vscode/markdown-editor, mirroring VS Code's own bootstrap code (open source, MIT). - Styling: the package theme provides GitHub typography scoped under the
theme class;
webview/github-light.cssre-pins any deltas to the markdown styles github.com ships today (1pxhr, 16px code-block padding, 6px table-header padding, GitHub's selection/caret/checkbox colors, heading hover anchors, the 888px README column) so the port tracks the live site, andwebview/canvas.csspins the surrounding chrome (--vscode-*tokens) to Primer light values so the look doesn't follow your workbench.
- Syntax coloring inside code blocks is not wired yet (code renders styled but monochrome); the editor API accepts a syntax highlighter β see roadmap
- Undo history is kept per document by the extension (native document undo is not re-wired yet)
- No readonly ("locked") mode yet
- No Mermaid rendering yet (diagrams render as source)
- GitHub dark themes are not built into the package; a dark variant is on the roadmap as a custom theme stylesheet
- Syntax highlighting in code blocks (the package ships Monarch/Monaco
helpers β
createDefaultMonacoSyntaxHighlighter) - Settings: code font size, canvas width, caret behavior on external changes
- Checkbox click-to-toggle, link hover cards, rich link presentations
- Mermaid rendering (same plugin slot VS Code uses)
- Theme setting:
githubStyleMarkdownEditor.theme: light | github-dark
npm install
npm run compile # typecheck + bundle -> dist/ + media/
npm run lint # eslint
npm test # unit tests (vitest)
npm run test:integration # integration tests in a real VS Code (downloads it once)
npm run package # compile + vsce -> .vsixDev workflow (VS Code tasks, mirrors .vscode/tasks.json):
- Dev (default build, F6) β opens agent tabs (Claude, Codex, Antigravity, OpenCode) alongside Install Locally
- Package VSIX (default test, F7) β bundles and packages a
.vsixviavsce - Install Locally β packages a
.vsixand installs it into your everyday VS Code (npm run install:local); run Developer: Reload Window afterwards.
.vscode/launch.json ships two configs:
- Launch Markdown Editor Github Style β the usual F5 flow. Opens an
Extension Development Host; reopen a
.mdwith Reopen Editor Withβ¦ β Markdown Editor Github Style. Breakpoints insrc/andwebview/both bind (esbuild emits source maps intodist/andmedia/, and the launch config setsresolveSourceMapLocations+debugWebviewsso the webview bundle and webworkers debug too). - Attach to Extension Host (installed VSIX) β for a packaged/installed
copy. Start VS Code with
code --inspect-extensions=9229, then launch this config; points the debugger at the installed extension's code via its.mapfiles.
Debug-only side-by-side comparison: in an Extension Development Host, opening a
.md in Markdown Editor Github Style also opens VS Code's built-in Markdown
Editor (vscode.markdown.editor) in the column beside it, so the two
renderings can be compared while editing. This is gated on
ExtensionMode.Development; packaged builds run in Production mode and never
open the extra pane.
Maps are dev-only: .vscodeignore excludes **/*.map, so the packaged
.vsix never carries them β installed copies get maps only if you install the
unbuilt folder, or re-enable them deliberately for a debug VSIX.
- CI (
ci.yml) β on pushes tomainand pull requests: lint, typecheck, unit tests, integration tests in a real VS Code, and an uploadable.vsixartifact. No secrets required. - Release (
release.yml) β onv*.*.*tags (or manual runs on a tag): verifies the tag matchespackage.json, runs lint + unit tests, packages the.vsix, and attaches it to a GitHub release. Publishing to the VS Code Marketplace and Open VSX only happens once theVSCE_PAT/OVSX_PATsecrets are configured β see Releasing.
- Bump
versioninpackage.json, updateCHANGELOG.md, commit. git tag v0.2.0 && git push origin v0.2.0β the release workflow does the rest.
Repository secrets (Settings β Secrets and variables β Actions) β only needed for marketplace publishing:
VSCE_PATβ Azure DevOps personal access token with the Marketplace β Manage scope, created under the account that owns the publisher configured inpackage.json.OVSX_PATβ access token from open-vsx.org after claiming the publisher namespace.
While the secrets are absent, tagged releases still build the .vsix and
attach it to a GitHub release. After adding them, publish an existing tag with
gh workflow run release.yml --ref v0.1.1. Before the first publish, replace
the publisher placeholder in package.json with your real Marketplace
publisher id.
This extension was developed using GLM-5.3-Flash Free with the OpenCode harness at max effort β from the webview bootstrap to the GitHub Primer styling.
@vscode/markdown-editorβ Microsoft, MIT. This extension reuses its public API and follows the bootstrap approach of VS Code's built-in Markdown Editor (MIT).- Styling values follow GitHub's Primer design tokens.
MIT