mara-li5k downloadsEnhance the read-only mode in Canvas with fully lock the scroll, zoom, drag-and-drop in read-only!
Experimental plugin for Obsidian, that lock the "view" of canvas. You can disable:
It will monkey-patch the lock function using monkey-around, so you just need to enable the plugin to make it work. Also, canvas are detected on the active-leaf-change.
You can also enable/disable the logs in the console. Beware, because the logs spam the console, and you will see redondant error.
[!NOTE] For some "usefulness", the dragging / scrolling is enabled when a canvas card is focused, so you can move freely the canvas and adjust the view (SHIFT+2) on a specific card if you need. To disable again the dragging, just click away (or escape) from the canvas card.
https://github.com/mara-li/obsidian-better-canvas-lockbetter-canvas-lock.zip in .obsidian/plugins/ pathTo make changes to this plugin, first ensure you have the dependencies installed.
pnpm install
To start building the plugin with what mode enabled run the following command:
pnpm run dev
Note If you haven't already installed the hot-reload-plugin you'll be prompted to. You need to enable that plugin in your obsidian vault before hot-reloading will start. You might need to refresh your plugin list for it to show up. To start a release build run the following command:
pnpm run build
Note You can use the
.envfile with adding the keyVAULT_DEVto specify the path to your Obsidian (development) vault. This will allow you to test your plugin without specify each times the path to the vault.
You can use the pnpm run export command to export your plugin to your Obsidian Main Vault. To do that, you need the .env file with the following content:
VAULT="path/to/your/obsidian/vault"
VAULT_DEV="path/to/your/dev/vault"
To add a translation:
src/i18n/locales folder with the name of the language (ex: fr.json)en.json file in the new file