tldraw79k downloadsIntegration with tldraw, allowing users to draw and edit content on a virtual whiteboard.
https://github.com/holxsam/holxsam/assets/41220650/1786cc75-3a15-431f-b13a-e8f51cfde952
This Obsidian plugin allows users to use Tldraw, which is a tiny little drawing app, inside of Obsidian. Users can draw, plan, and use all of Tldraw's tools to augment their Obsidian experience. The data for each drawing is stored as a regular markdown file similar to the Excalidraw plugin meaning users will always have access to their data in plain markdown. Users have the option to switch between the Tldraw view or the markdown view in case they wish to include backlinks, tags, or any other elements to facilitate linking their drawings with their existing knowledge base.
TIP: You can toggle between the view modes, using the command palette, keyboard shortcuts, status bar toggle at the bottom right, file menu, and context menu. See the plugin settings tab for customization options as well.
The main goals of this plugin and repo is to keep up to date with the Tldraw's latest version and to add these features:
src/ - Source code for the Obsidian plugindist/ - Compiled output (generated during build)development/ - Development buildproduction/ - Production buildrelease/ - Files that are needed for the plugin releasemanifest.json versions.jsontest/ - End-to-end tests (WebdriverIO) and fixture vaultsmanifest.json and versions.json are updated by npm run make-release-files and should be committed if there are any changes.
Tldraw in Obsidian is now available on the official community plugins list!
obsidian://show-plugin?id=tldraw (paste in your browser's address bar).Settings > Community plugins > Browse > Type 'tldraw' > Install.Obsidian42 - BRAT from the community plugins.Obsidian42 - Brat and select Add Beta Pluginhttps://github.com/tldraw/obsidian-pluginCommunity plugins and make sure to enable TldrawVaultFolder/.obsidian/plugins/tldraw-in-obsidianmain.js, styles.css, manifest.json into the newly created /tldraw-in-obsidian folder..obsidian/plugins folder.npm i in the command line under your repo folder.npm run vite:dev (recommended) to compile your plugin using Vite with fast HMR, or npm run dev to use the legacy build script. Changes to src/ will be automatically compiled to dist/development/./src. Those changes should be automatically compiled into main.js and styles.css.styles.css file at the root of the repo. Edit the one in /src/styles.css and the changes will be reflected automatically.To build the plugin for production using the existing build pipeline:
npm run build
To build the plugin for production using the Vite pipeline:
npm run vite:build
E2E tests run WebdriverIO against a real Obsidian instance using wdio-obsidian-service. Specs live under test/specs/ (files matching *.e2e.ts). The default vault is test/vaults/default.
Prerequisites: The runner needs a plugin to load. By default it expects a production build at dist/production/. Build first, or point to another build with environment variables.
npm run build
npm run e2e
Plugin location (optional):
TLDRAW_PLUGIN_DIR — Path to a plugin folder (the directory that contains manifest.json, main.js, etc.).TLDRAW_PLUGIN_VERSION — If set, the test run installs the published plugin with id tldraw at this version from the community registry instead of using a local folder.Configuration is in wdio.conf.mts (timeouts, Obsidian installer version, parallel runs, and more are documented in the sample plugin config).
This plugin was created by Sam Alhaqab, the original author whose initial contributions kickstarted the beginning of using tldraw within Obsidian. So a huge shoutout to him!
All Tldraw's code is theirs, a few patches were made to address issues when using pop-out windows within Obsidian. Also shout out to the Excalidraw plugin for inspiration on how I should structure this Tldraw plugin.