Clojure Plugin Host

approved

by Vladimir "farcaller" Pouzanov

A Clojure plugin host, allowing the creation of simple Clojure-based plugins right inside the editor.

6 stars104 downloadsUpdated 1y agoApache-2.0
View on GitHub

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.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.