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

Excalidraw support discussion #1187

Open
iceprosurface opened this issue Jun 7, 2024 · 3 comments
Open

Excalidraw support discussion #1187

iceprosurface opened this issue Jun 7, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@iceprosurface
Copy link

iceprosurface commented Jun 7, 2024

I want to add excalidraw support for quartz.

I made a plugin for setup excalidraw.

https://github.com/iceprosurface/quartz-excalidraw-plugin

And add Integration to quartz

iceprosurface/quartz-blog@44fc388

Demo:

https://next.iceprosurface.com/%E7%9F%A5%E8%AF%86%E5%BA%93/%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/%E8%83%8C%E5%8C%85%E5%8A%9F%E8%83%BD%E9%80%BB%E8%BE%91.excalidraw

Currently, the integration method feels very cumbersome. Is there a better approach to directly embed it within Quartz?

@iceprosurface iceprosurface added the enhancement New feature or request label Jun 7, 2024
@iceprosurface
Copy link
Author

Excalidraw is very large, with the source code being over 1MB. I don't want to directly inline it in postscript.js.

@jackyzha0
Copy link
Owner

We can try lazily instantiating it with the data it needs? This is what we do with mermaid for example

@iceprosurface
Copy link
Author

I understand. It might be a better approach to first build an Excalidraw specifically for quartz and publish it to npm. Using upkg to asynchronously fetch the script could be a better option. Additionally, you must export a plugin to handle transform and emits.

Since the default API provided by Excalidraw does not perfectly match the data format of the obsidian-excalidraw-plugin, and the UI also needs some customization, it’s a bit troublesome that Quartz does not seem to support using Preact in inline scripts.

I'll push an implementation on Sunday and give it a try.

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

No branches or pull requests

2 participants