๐จ copilot-markdown-canvas
A beautiful read-only Markdown viewer canvas extension for GitHub Copilot. Renders markdown with stunning typography and full mermaid diagram support โ optimized for readability.
โจ Features
- ๐ Beautiful typography โ GitHub-flavored markdown with polished styling
- ๐ง Mermaid diagrams โ flowcharts, sequence diagrams, pie charts, ER diagrams, Gantt charts, and more
- ๐ Dark/light theme โ automatically adapts to your Copilot app theme
- ๐ Optimized diagram layout โ custom spacing, padding, and sizing for maximum readability
- ๐ File loading โ render any
.mdfile from your filesystem - ๏ฟฝ๏ฟฝ Live updates โ swap content on the fly via actions
๐ Installation
From this repo (recommended)
Install extension from URL: https://github.com/bradygaster/copilot-markdown-canvas
Manual install
Copy the extension.mjs file to:
~/.copilot/extensions/markdown-viewer/extension.mjs
Then reload extensions in Copilot.
๐ฏ Usage
Once installed, the canvas is available in any Copilot session. The agent can:
Open with content:
open_canvas({ canvasId: "markdown-viewer", input: { content: "# Hello\n\nWorld" } })
Render a mermaid diagram:
```mermaid
flowchart TD
A[Start] --> B{Decision}
B -->|Yes| C[Do something]
B -->|No| D[Do something else]
```
Load a file:
invoke_canvas_action({ instanceId: "...", actionName: "load_file", input: { path: "/path/to/file.md" } })
Update content dynamically:
invoke_canvas_action({ instanceId: "...", actionName: "update_content", input: { content: "# New content" } })
๐ง Supported Mermaid Diagrams
- Flowcharts (
flowchart) - Sequence diagrams (
sequenceDiagram) - Class diagrams (
classDiagram) - State diagrams (
stateDiagram-v2) - Entity-relationship diagrams (
erDiagram) - Gantt charts (
gantt) - Pie charts (
pie) - Git graphs (
gitGraph) - And more...
All diagrams are rendered with optimized spacing, font sizes, and color schemes that adapt to your theme.
๐ Structure
โโโ extension.mjs # The canvas extension (single file, no deps)
โโโ copilot-extension.json # Extension manifest
โโโ README.md
โโโ LICENSE
๐ ๏ธ Development
This is a single-file extension โ no build step, no dependencies. Edit extension.mjs and reload:
- Make changes to
extension.mjs - In Copilot, reload extensions
- Re-open the canvas to see changes
๐ License
MIT โ use it, share it, make it better.