Back to directory
bradygaster avatar

copilot-markdown-canvas

๐ŸŽจ A beautiful read-only Markdown viewer canvas for GitHub Copilot with mermaid diagram rendering and optimized typography. Read more below about its uses, features, and usage.

Clone repository

git clone https://github.com/bradygaster/copilot-markdown-canvas.git

1

Stars

0

Forks

0

Watchers

MIT

License

๐ŸŽจ 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.

License

โœจ 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 .md file from your filesystem
  • ๏ฟฝ๏ฟฝ Live updates โ€” swap content on the fly via actions

๐Ÿš€ Installation

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:

  1. Make changes to extension.mjs
  2. In Copilot, reload extensions
  3. Re-open the canvas to see changes

๐Ÿ“„ License

MIT โ€” use it, share it, make it better.