Compare uncommitted Markdown changes in the current working tree in VS Code.
Features
List uncommitted .md, .markdown, and .mdx files in the Markdown Diff activity bar view.
Include staged, unstaged, and untracked Markdown changes in the working tree.
Optionally choose a base branch and compare it against the current working tree.
Open the normal VS Code source diff for any changed Markdown file.
Open a rendered Markdown comparison in a webview with synchronized scrolling.
Highlight changed blocks in the rendered Markdown comparison.
Render Mermaid diagrams from fenced mermaid code blocks in the rendered comparison.
Render PlantUML diagrams from fenced plantuml and puml code blocks through a PlantUML server.
Handles added, deleted, modified, copied, and renamed Markdown files.
Development
npm install
npm run compile
Open this folder in VS Code and press F5 to launch an Extension Development Host.
In the launched VS Code window:
Open a Git repository.
Run Markdown Diff: Compare Uncommitted Markdown Files.
To compare against a branch, run Markdown Diff: Compare Working Tree with Base Branch and choose the base branch.
Open files from the Markdown Diff activity bar view.
Commands
Markdown Diff: Compare Uncommitted Markdown Files
Markdown Diff: Compare Working Tree with Base Branch
Markdown Diff: Refresh
Open Rendered Markdown Diff
Open Markdown Source Diff
Settings
markdownDiff.plantumlServerUrl: PlantUML server base URL. Defaults to https://www.plantuml.com/plantuml.
Implementation Notes
The extension shells out to git, so it does not require the built-in VS Code Git extension API. Source diffs are backed by a virtual document provider, while rendered diffs are rendered with markdown-it, Mermaid, and PlantUML server images in a VS Code webview.