secure-77 / Perlite

A web-based markdown viewer optimized for Obsidian

Home Page:https://perlite.secure77.de/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding Canvas support

marcus-universe opened this issue · comments

Obsidian Canvas Support

Since the newest updates of Obsidian it added a new node type named Canvas.

Its awesome to create moodboard, collection of images or mindmaps.
Currently Perlite does not support this filetype and does not show it in the vault.

Obsidian Canvas
image

commented

Yes, I would like to have that too, but looking at the canvas source code, I have no idea how to achieve that at the moment.
If anyone has a good js library or an idea how to render this, please let me know.

Example

{
	"nodes":[
		{"id":"fbf016a2366d4d5b","x":-1241,"y":-533,"width":250,"height":60,"type":"text","text":"Start of Enum"},
		{"id":"49f6f3de90eab0ac","x":-774,"y":-593,"width":250,"height":60,"type":"text","text":"test 2"},
		{"id":"a47a5494d9e717cb","x":-561,"y":-343,"width":250,"height":60,"color":"3","type":"text","text":"what can i doe here?"},
		{"id":"a0076932c1b056bc","x":-1316,"y":-398,"width":400,"height":400,"type":"file","file":"OFFSEC Notes/Network Services/OCSP.md"}
	],
	"edges":[
		{"id":"f6d63d5748f282a3","fromNode":"fbf016a2366d4d5b","fromSide":"top","toNode":"49f6f3de90eab0ac","toSide":"left"},
		{"id":"89d6375ccd9600e0","fromNode":"49f6f3de90eab0ac","fromSide":"bottom","toNode":"a47a5494d9e717cb","toSide":"top"}
	]
}

little update to this, I found two workarounds to get at least a html / pdf out of the canvas.

Best option so far is to use the obsidian-webpage-export plugin and manually export the desired canvas files (self-contained-documents), this html file can then be placed into the webserver and is directly accessible. Its not nice because its not included in perlite and also needs a manuell export but at least its a quick way to get your canvas into the browser.

Iam thinking about to write some script to extract the canvas part only from the exported file and store it into some custom file format, which then will be recognized and displayed by Perlite. But not sure if this is really the only and best option. Another idea would be to create a fork of the plugin and adjust it to export canvas files only and perlite "ready".

Also found another option by using this script https://forum.obsidian.md/t/exporting-canvas-to-html-and-pdf/60331 to export the canvas as a html and then create a pdf out of it and include it into perlite.