canvas-to-html
Skill0 starsChanged 10 months agoMITView on GitHub
Convert Obsidian Canvas (.canvas) JSON files to standalone HTML for viewing on GitHub or in browsers. Use when users want to export, convert, or view canvas files as HTML, share canvas diagrams outside Obsidian, or need a web-viewable version of their .canvas files. Handles edge cases like scrollable content for long text, proper box sizing, markdown rendering, and SVG edge connections.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Jlosev/agent-skillstheir own version, first seen Oct 30, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Jlosev/agent-skills★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repositoryOne other file it gives its agents.
- to-canvas-jsonSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Run the conversion script:
- Very specific: line 23
If no output path is specified, creates <input-name>.html in the same directory.
- Distinctive: line 50
Standalone HTML: No external dependencies, embedded CSS
- Distinctive: line 82
Import and call directly:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Canvas to HTML Converter
Convert Obsidian Canvas (.canvas) files to standalone, GitHub-viewable HTML.
Quick Start
Run the conversion script:
python scripts/canvas_to_html.py <input.canvas> [-o output.html]Example:
python scripts/canvas_to_html.py architecture.canvas -o architecture.htmlIf no output path is specified, creates <input-name>.html in the same directory.
Features
The converter handles:
| Feature | Implementation |
| Long text content | Scrollable containers within fixed node bounds |
| Markdown rendering | Headers, bold, italic, code, tables, lists, links |
| Node types | Text, file, link, and group nodes |
| Edge connections | SVG paths with arrows and labels |
| Color presets | Maps "1"-"6" to Obsidian-like colors |
| Groups | Dashed border containers with labels |
Content Overflow Handling
Nodes with content exceeding their dimensions get:
overflow: autoon the content container- Styled scrollbars (thin, semi-transparent)
- Fixed outer dimensions matching canvas specification
- Inner content scrollable both vertically and horizontally
This ensures long text, tables, or code blocks remain readable without breaking the visual layout.
Output Characteristics
- Standalone HTML: No external dependencies, embedded CSS
- Dark theme: GitHub-compatible dark background
- Responsive scrolling: Both canvas-level and node-level scrolling
- Preserved layout: Exact node positions from canvas JSON
Markdown Support
| Element | Syntax | |||
| Headers | # through ###### | |||
| Bold | **text** | |||
| Italic | *text* | |||
| Strikethrough | ~~text~~ | |||
| Code (inline) | `code` | |||
| Code blocks | ```lang ... ``` | |||
| Links | [text](url) | |||
| Lists | - item or * item | |||
| Tables | ` | col | col | ` format |
Color Mapping
| Preset | Hex Value | Color |
| "1" | #fb464c | Red |
| "2" | #e9973f | Orange |
| "3" | #e0de71 | Yellow |
| "4" | #44cf6e | Green |
| "5" | #53dfdd | Cyan |
| "6" | #a882ff | Purple |
Programmatic Usage
Import and call directly:
from canvas_to_html import convert_canvas_to_html
# Basic conversion
output_path = convert_canvas_to_html("diagram.canvas")
# With custom output path
output_path = convert_canvas_to_html("diagram.canvas", "output/diagram.html")Edge Cases Handled
- Content overflow: Scrollable containers prevent text from being cut off
- Negative coordinates: Canvas bounds calculated to include all nodes
- Missing optional fields: Sensible defaults for colors, sides, labels
- Special characters: HTML entities properly escaped
- Empty canvas: Generates valid HTML with minimal dimensions
- Large canvases: Viewport scrolling for oversized diagrams
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

