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...
The easiest way to move your React application to Server-Side Rendering. Handles Side Effects and synchronizes State.
The easiest way to move your React application to Server-Side Rendering. Handles Side Effects and synchronizes State.

The easiest way to move your React application to Server-Side Rendering. Handles Side Effects and synchronizes State. Table of Contents Articles Featu

Starter project with full stack BigQuery. Allows to overcome customisation restrictions imposed by pre-built dashboards and control data usage. Deploy your own cloud website hydrated by sample BigQuery data in 15 min without installing any development software. Reactivated.app is an open-source app that scans your JS dependencies every 4 hours and generates cool dashboards
Reactivated.app is an open-source app that scans your JS dependencies every 4 hours and generates cool dashboards

Reactivated.app is an open-source app that scans your JS dependencies every 4 hours and generates cool dashboards

Write your own version of React. Why? Because you CAN!
Write your own version of React. Why? Because you CAN!

Write your own version of React. Why? Because you CAN!

🕹 GBA emulator on your React project - easy and powerful to use!
🕹 GBA emulator on your React project - easy and powerful to use!

react-gbajs GBA emulator on your React project - easy and powerful to use! Just three steps to set it up ✨ 1 - Apply GbaProvider import { GbaProvider

Here is the place try to learn to call API using React.js with anything your code style and contribute to open-source. Part of Hacktoberfest

Table of Contents About The Project Built With Getting Started Prerequisites Installation Usage About The Project To welcome hacktoberfest we provide

Make your React Components aware of their width and height!
Make your React Components aware of their width and height!

Make your React Components aware of their width and/or height! Hyper Responsive Components! Performant. Easy to use. Extensive browser support. Suppor

Pimp my README is an open source profile builder that you can use to add some cool components to your README profile - Made with <3 by webapp.io :)
Pimp my README is an open source profile builder that you can use to add some cool components to your README profile - Made with 3 by webapp.io :)

Pimp my README This repository is the open-source project for Pimp my README. How this came to be So basically, GitHub added a feature where you can a

How to mint your own NFT token with react
How to mint your own NFT token with react

Mint your own basic off chain NFT Description This project teaches you how to mint your own NFT token. Here are some important packages that we will b

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 1
Releases(1.0.5)
Live coding in your browser with your favourite language.

Live coding in your browser with your favourite language.

Fatih Erikli 986 Nov 20, 2021
LocateJS predicts your location by analyzing your connection and system data.

LocateJS predicts your location by analyzing your connection and system data.

z0ccc 281 Nov 2, 2022
A React Custom able cursor that can decorate your site also your hand is open to manipulate the cursor with css

custom-react-cursor A React Custom able cursor that can decorate your site also your hand is open to manipulate the cursor with css Demo live Installi

amirhossein 18 Nov 9, 2022
Showcase your skills on your Github readme or resumé with ease ✨

Showcase your skills on your GitHub or resumé with ease! Powered by Cloudflare Workers ⚡ Docs Example Specifying Icons Themed Icons Icons Per Line Cen

Thijs [Coding] 1.3k Nov 19, 2022
✨ View all of your GitHub stats and compare your stats with friends, made using nextjs and tailwind.

✨ View all of your GitHub stats and compare your stats with friends, made using nextjs and tailwind.

ashish 10 Sep 6, 2022
🔍 A package with components for building your dream command palette for your web application.

A command palette for React A package with components for building your dream command palette for your web application. Features Installation Example

Albin Groen 644 Nov 24, 2022
Auto-increment your HTML headings (h1, h2, etc.) for improved accessibility and SEO.

React Headings Never worry about using the wrong heading level (h1, h2, etc.) in complex React apps! React-headings maintains the proper hierarchy of

Alex Nault 49 Nov 18, 2022
Create guided tours in your apps

React Joyride Create awesome tours for your app! Showcase your app to new users or explain functionality of new features. It uses react-floater for po

Gil Barbara 5k Nov 18, 2022
Display PDFs in your React app as easily as if they were images.

React-PDF Display PDFs in your React app as easily as if they were images. Lost? This package is used to display existing PDFs. If you wish to create

Wojciech Maj 6.5k Nov 20, 2022
[Deprecated] Debug performance of your React application

Deprecated ?? As of React 16, react-addons-perf is not supported. Please use your browser’s profiling tools to get insight into which components re-re

Ramon Gebben 413 Nov 13, 2022