Clojure inside your Obsidian documents!

Overview

Obsidian Wielder

Clojure inside your Obsidian documents!

Demonstration Video

This Obsidian plugin allows you to use the full power of Clojure directly inside of your documents in Obsidian! If you view documents with code blocks marked as clojure in the view-mode of Obsidian, this plugin will automatically run the code you have specified inside the block.

The plugin goes block by block for your entire document, so you can build pipelines of data with descriptive text in-between, and slowly build up to the final data and then present it. All directly in your documents without doing anything outside of Obsidian.

Add in rendering React components with Reagent, and you can build fully interactive applications by just writing in markdown files, rendered in Obsidian!

Wielder also allows you to access the Obsidian API directly (via window.app), so anything you can do with a plugin, you could also do directly in just document.

Installation Instructions

Take a look at the Installation Tutorial to learn how you can install Wielder in Obsidian

Warning: Wielder can run any code defined as Clojure code-blocks in your Obsidian documents

Just like Templater or Dataview, Wielder executes code defined by your Obsidian documents. This means any sort of code.

Unless you know exactly what the code you're executing does, it can be harmful to your Vault, Obsidian installation or even complete system.

You should take care to only run Wielder with code you understand what it does, and also not copy-paste code from strangers into your Vault without fully understanding what it does.

Wielder will never run any code defined from outside your Obsidian Vault, so you are yourself responsible for the code that gets executed.

Again, take care of what code you run with Wielder, as it can be potentially destructive.

Demonstration Vault

It's hard to describe exactly what you can do with Wielder with just text, so easiest is to just install the plugin and checkout the demo-vault provided in this repository.

If you don't want to install the plugin before seeing it in action, you can checkout a web version of the vault (and Wielder) here: https://wielder.victor.earth (ah yeah I forgot to mention: of course it works with webpages as well as inside Obsidian!)

Code Layout

The main pieces are the following files:

  • sci-js/src/sci/api.cljs - ClojureScript file which provides a JS<>CLJS interface to be used by this plugin
  • src/evaluator.ts - TypeScript source for initializing the SCI environment and evaluating code snippets from DOM elements
  • src/main.ts - Obsidian Plugin's main source file. Is what gets compiled into main.js and published as the plugin
  • src/publish.ts - Source of the publisher part. Include the compiled version of this library and your published site will work (mostly) the same way as your vault when loaded via desktop Obsidian.
You might also like...

A simple JavaScript library, to display a window inside of the browser

A simple JavaScript library, to display a window inside of the browser

WindowJS WindowJS is a simple JavaScript library, to display a functional window inside of the browser. Demo: prod.thalmann.it/windowjs/demo.html Navi

Dec 14, 2022

Multithread emulator. The wrun allows you to dynamically run a function inside a Web Worker on the client side, without the needing of a dedicated file

wrun This lib allows you to dynamically run a function inside a Web Worker on the client side, without the needing of a dedicated file. This means tha

Nov 5, 2022

Codebraid Preview provides a Markdown preview for Pandoc documents within VS Code.

Codebraid Preview provides a Markdown preview for Pandoc documents within VS Code.

Codebraid Preview provides a Markdown preview for Pandoc documents within VS Code. Most Markdown previews don't support all of Pandoc's extensions to Markdown syntax. Codebraid Preview supports 100% of Pandoc features—because the preview is generated by Pandoc itself! There is also full bidirectional scroll sync and document export.

Dec 28, 2022

Apinto document project, which includes the use tutorials, development documents and other related contents of apinto.

apinto-docs Apinto document project, which includes the use tutorials, development documents and other related contents of apinto. README 本文档由 VuePres

Dec 1, 2022

JSON Struct is a vocabulary that allows you to annotate and validate JSON documents.

JSON-Struct JSON Struct is a vocabulary that allows you to annotate and validate JSON documents. Examples Basic This is a simple example of vocabulary

May 8, 2022

A Hackable Markdown Note Application for Programmers. Version control, AI completion, mind map, documents encryption, code snippet running, integrated terminal, chart embedding, HTML applets, plug-in, and macro replacement.

A Hackable Markdown Note Application for Programmers. Version control, AI completion, mind map, documents encryption, code snippet running, integrated terminal, chart embedding, HTML applets, plug-in, and macro replacement.

Yank Note A hackable markdown note application for programmers Download | Try it Online Not ecommended English | 中文说明 [toc]{level: [2]} Highlights

Dec 31, 2022

A Chinese unofficial documents site.

Grasscutter Documention | 割草机文档 This website is built using Docusaurus 2, a modern static website generator. 此网页使用Docusaurus 2创建,这是一个现代化网页生成器 English

Dec 3, 2022

Add grouped tabsets, which remember the active tab across multiple HTML documents.

Grouped Tabsets See the extension in action. This quarto extension provides support for "grouped" tabsets in Quarto HTML documents. Consider the case

Sep 30, 2022

Digital Identifier is a secure, decentralized, anonymous and tampered proof way of maintaining and verifying all essential identity-based documents to create a unique digital identity of a person.

Digital Identifier is a secure, decentralized, anonymous and tampered proof way of maintaining and verifying all essential identity-based documents to create a unique digital identity of a person.

Digital Identifier 🧐 To design and develop a secure, decentralized, anonymous and tampered proof way of maintaining and verifying all essential ident

Dec 17, 2022
Comments
  • [Bug] Wielder Causing Issues with Templater's Startup Template

    [Bug] Wielder Causing Issues with Templater's Startup Template

    The plugin templater has the ability to set a "startup template" that runs when Obsidian is started. However, when wielder is enabled, the startup template fails to run with a vast error. Prior to the template running (as it happens onLayoutReady), Wielder prints the following error:

    Uncaught (in promise) TypeError: import_sci.default.init is not a function
        at initialize (plugin:wielder:85392:29)
        at ObsidianClojure.eval (plugin:wielder:85553:21)
        at Generator.next (<anonymous>)
        at fulfilled (plugin:wielder:36:24)
    

    After that, the startup template runs and results in a very big error that mentions certain wielder properties. The error is massive, and hence is attached as a error.txt.

    From a basic scan of the error, it looks like it may be related to my startup template's use of obsidian-requirejs that isn't playing nicely with it.

    I hadn't restarted Obsidian in a while and hence only just saw this!

    opened by iamrecursion 2
  • [Question] Document Size and Performance

    [Question] Document Size and Performance

    I'd love to try this plugin out, but I'm slightly worried that due to the eager evaluation model (it seems to try and parse all code blocks in a page eagerly) it won't cope with large files? I don't necessarily want to use it in massive files, but I'm more worried about opening a huge file in general and having things bog down. Are there any plans to make it less eagerly evaluated?

    opened by iamrecursion 4
  • Offer alternative version of publish.js

    Offer alternative version of publish.js

    Currently, publish.js is kind of big (3.6M on disk, 446KB gzipped) because we're not doing any minifying nor tree-shaking (which is hard when we want to evaluate arbitrary code). Biggest reason for not doing any minifying yet is because it'll make the errors a lot harder to understand when you're doing something wrong, so not sure if we can address that somehow.

    But in the meantime, we could probably offer two versions of the publish.js. The first one being the existing one which is the full errors / non-minified one. And a second one which is minified/production/cryptic errors one, that people can use if they want to instead of the full-errors one.

    opened by victorb 0
  • Evaluate on command?

    Evaluate on command?

    Is it possible to evaluate code blocks on command rather than instantaneously as code gets typed? I could see this potentially being problematic if I’m typing code that does something state changing like, say, modifies my vault (e.g., I’m deleting a file by path name and I’m typing out the path name in quotes).

    opened by EricR 2
Releases(1.0.5)
Trims unnecessary whitespace from your Obsidian documents.

Trim Whitespace Trim Whitespace trims unnecessary blank characters from your Obsidian documents. This is a common feature in code editing software, an

Zack Lovatt 18 Dec 13, 2022
A plugin for the Obsidian markdown note application, adding functionality to render markdown documents with multiple columns of text.

Multi-Column Markdown Take your boring markdown document and add some columns to it! With Multi Column Markdown rather than limiting your document lay

Cameron Robinson 91 Jan 2, 2023
A plugin for Obsidian (https://obsidian.md) that adds a button to its search view for copying the Obsidian search URL.

Copy Search URL This plugin adds a button to Obsidian's search view. Clicking it will copy the Obsidian URL for the current search to the clipboard. T

Carlo Zottmann 6 Dec 26, 2022
A VS Code extension to practice and improve your typing speed right inside your code editor. Practice with simple words or code snippets.

Warm Up ?? ??‍?? A VS Code extension to practice and improve your typing speed right inside your code editor. Practice with simple words or code snipp

Arhun Saday 34 Dec 12, 2022
Pack all your node_modules and other files you want inside your project to a zip file.

?? Node Modules Packer Use Cases | Usage | Examples | Headless | Benchmarks | Reference This is a library to package all your node_modules and other f

Vinicius Lourenço 14 Dec 1, 2022
Obsidian Web: Connect your browser with your Obsidian notes

Obsidian Web: Connect your browser with your Obsidian notes This is an unofficial Chrome extension for Obsidian that lets you send content from the we

Adam Coddington 97 Jan 3, 2023
Nest multiple blocks inside lists of any kind of list (ordered, unordered, no marker, etc), or do away with list markers and use it like a repeater!

Nest multiple blocks inside lists of any kind of list (ordered, unordered, no marker, etc), or do away with list markers and use it like a repeater!

Rani 15 Dec 26, 2022
A small CLI utility to configure Japa inside an existing Node.js project

A small CLI utility to configure Japa inside an existing Node.js project

Japa.dev 5 Mar 11, 2022
Inside-out promise; lets you call resolve and reject from outside the Promise constructor function.

Inside-out promise; lets you call resolve and reject from outside the Promise constructor function.

Lily Scott 3 Feb 28, 2022
Wrap a function with bun-livereload to automatically reload any imports inside the function the next time it is called

bun-livereload Wrap a function with bun-livereload to automatically reload any imports inside the function the next time it is called. import liveRelo

Jarred Sumner 19 Dec 19, 2022