A plugin for Obsidian that allows you to run JavaScript code in your notes.
- Download the manifest file from manifest.json and the main file from main.js.
- Create a folder in your vault's
.obsidian/plugins
folder calledobsidian-runjs
. - Place the downloaded files in the folder.
- Reload Obsidian.
- Enable the plugin in the settings.
- Create a code block with the language set to
js
orjavascript
with your code inside. - In
Preview Mode
, on hover the block will have aRun
button. - Click the button to run the code.
- Add
run
command to the command palette. - Add
run
command to the context menu. - Add run button in edit mode.
- Add import/export functionality.
- Add settings.
- Add toggle to hide code and show only as a button.