No description
Find a file
2025-01-16 08:45:18 +00:00
src/clojure_plugin_host Initial commit 2024-10-06 20:17:53 +00:00
.envrc Initial commit 2024-10-06 20:17:53 +00:00
.gitignore Initial commit 2024-10-06 20:17:53 +00:00
.npmrc add version bump script (#10) 2022-01-22 16:13:50 -05:00
bb.edn Initial commit 2024-10-06 20:17:53 +00:00
deps.edn Initial commit 2024-10-06 20:17:53 +00:00
devenv.lock Initial commit 2024-10-06 20:17:53 +00:00
devenv.nix Initial commit 2024-10-06 20:17:53 +00:00
devenv.yaml Initial commit 2024-10-06 20:17:53 +00:00
esbuild.config.mjs Initial commit 2024-10-06 20:17:53 +00:00
LICENSE Initial commit 2024-10-06 20:17:53 +00:00
manifest.json Update manifest.json 2025-01-16 08:45:18 +00:00
package-lock.json Initial commit 2024-10-06 20:17:53 +00:00
package.json Initial commit 2024-10-06 20:17:53 +00:00
README.md Initial commit 2024-10-06 20:17:53 +00:00
shadow-cljs.edn Initial commit 2024-10-06 20:17:53 +00:00
version-bump.mjs add version bump script (#10) 2022-01-22 16:13:50 -05:00
versions.json Initial commit 2024-10-06 20:17:53 +00:00

Clojure Plugin Host for Obsidian

This plugin allows one to author simple plugins written in Clojure (SCI specifically) directly inside Obsidian.

Usage

As of 0.1, this plugin requires Dataview plugin to be installed. To create a new plugin, add a note like this:

---
tags:
  - clojure-plugin
---
```clojure

(defn on-ribbon
  []
  (let [Notice (.-Notice obsidian/exports)]
    (Notice. "A notice from Clojure!")))

(defn on-load
  [plugin]
  (prn "hello plugin!")
  (let [status-bar-el (.addStatusBarItem plugin)
        rib (.addRibbonIcon plugin "dice" "Sample Plugin" on-ribbon)]
    (.setText status-bar-el "Hello world!")))
```

The note must be tagged with clojure-plugin and must contain a single code block with the clojure code inside. The code must have a form on-load, which will be called upon the plugin initialization.

License

This repository is forked off the Obsidian plugin template, which does not have a license. At the same time, this repository doesn't use any code provided in the aforementioned repository, other than general plugin setup. All the clojure code within is distrubuted under Apache-2.0.