Skip to content

kitschpatrol/vscode-tldraw-preview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VS Code Tldraw Preview Extension

License: MIT CI Visual Studio Marketplace Version

Thumbnail preview images on hover for @kitschpatrol/unplugin-tldraw file paths.

Getting started

This extension assumes you have VS Code installed and are working in a project that uses the unplugin-tldraw build-tool plugin. That plugin renders local tldraw .tldr files into SVGs or bitmaps at build time via tldraw-cli.

Install the extension from the Marketplace, or run the following in VS Code's command palette:

ext install kitschpatrol.tldraw-preview

Now, when you hover over a .tldr link in your code, you should see a live preview thumbnail of the referenced drawing.

vscode-tldraw-preview banner

For now, this extension does not itself resolve or fetch images; it only provides thumbnail previews for cached tldraw URLs that have already been resolved by unplugin-tldraw via tldraw-cli.

This extension is extremely niche and is not a part of the official tldraw project. If you want an extension to actually edit .tldr files in VS Code, then you want the official tldraw extension.

Configuration

The extension provides the following settings:

Setting Default Description
tldraw-preview.manifestPath node_modules/.cache/tldraw/.tldraw-plugin-cache.json Path to the unplugin-tldraw cache manifest file. Absolute, or relative to the workspace root.
tldraw-preview.maxWidth 300 Maximum width for image previews (points)

Supported file types

Hover previews work in the following file types: JavaScript, TypeScript, JSX, TSX, Markdown, MDX, HTML, Astro, and Svelte.

Query parameters on .tldr references (e.g. ./sketch.tldr?dark=true) are matched against variant entries in the manifest. The &tldr and &tldraw suffix workarounds for TypeScript issue #38638 (e.g. ./sketch.tldr?format=png&tldr) are recognized and stripped before lookup.

Maintainers

kitschpatrol

Contributing

Issues are welcome and appreciated.

Please open an issue to discuss changes before submitting a pull request. Unsolicited PRs (especially AI-generated ones) are unlikely to be merged.

This repository uses @kitschpatrol/shared-config (via its ksc CLI) for linting and formatting, plus MDAT for readme placeholder expansion.

License

MIT © Eric Mika

About

Thumbnail preview images on hover for @kitschpatrol/unplugin-tldraw file paths.

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors