Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Canvas support #72

Open
marcus-universe opened this issue Apr 9, 2023 · 2 comments
Open

Adding Canvas support #72

marcus-universe opened this issue Apr 9, 2023 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@marcus-universe
Copy link

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

@marcus-universe marcus-universe added the enhancement New feature or request label Apr 9, 2023
@secure-77
Copy link
Owner

secure-77 commented Aug 1, 2023

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"}
	]
}

@secure-77 secure-77 added the help wanted Extra attention is needed label Aug 1, 2023
@secure-77
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants