excalidraw / excalidraw-vscode

Excalidraw for Visual Studio Code
https://marketplace.visualstudio.com/items?itemName=pomdtr.excalidraw-editor
MIT License
477 stars 60 forks source link

Add support for linking to local files #123

Open lorefnon opened 9 months ago

lorefnon commented 9 months ago

Resolves https://github.com/excalidraw/excalidraw-vscode/issues/122

pomdtr commented 9 months ago

Thanks for your contribution.

I think we can improve this a bit:

Here a url or type: https://raw.githubusercontent.com/.../example excalidraw would not be handled properly.

Instead of relying on the file extension, maybe we can just open any url without scheme in vscode:

Ex: ./test.excalidraw or /tmp/readme.md

lorefnon commented 9 months ago

Instead of relying on the file extension, maybe we can just open any url without scheme in vscode:

This is what I originally did. However it opens excalidraw files as json. So I added special handling for .excalidraw extension. References to non excalidraw files do work.

I'll update this so absolute paths will be handled correctly. The Url handling can stay as it currently is, yes ?

pomdtr commented 9 months ago

I see, then it make sense. I'll play a bit with your branch locally to see if the linking behavior match my expectations