The Archive: Plugin System dev log
In the spirit of transparency and buzz and excitement, I want to share with you some progress I'm making on The Archive's plugin system.
Starting with an odd one to not spoil all too much at once
Today was the first time I used the very much work-in-progress development view to verify a couple of JavaScript quirks in the interactive REPL. It's basically line-by-line code execution to test algorithms and poke around things:
The top part is the actual script editing part and filled with a placeholder comment. Nothing to see there yet.
So here's a verified rumor -- the scripting language will be JavaScript by default. Reason for that is the excellent and secure environment Apple provides out of the box. (Other languages I would have preferred would require us to ship the language environment or depend on the user installing everything. So this is currently the only sane way to get started. Let's see what the future holds, though.)
Author at Zettelkasten.de • https://christiantietze.de/
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Yahoo!
I get to learn another programming language. JavaScript isn't the most popular programming language for no reason. Supposedly easy to understand and comes preinstalled are great attributes. This will make the sharing of plugins a no-brainer. What language do Obsidian, Roam, and Zettlr use?
We'll see how easy JavaScript is to learn. The challenge is locked and loaded.
Will Simpson
I must keep doing my best even though I'm a failure. My peak cognition is behind me. One day soon I will read my last book, write my last note, eat my last meal, and kiss my sweetie for the last time.
kestrelcreek.com
@Will Looking forward to see what you'll be exploring!
Coming from Python, the syntax is different, but the core principles and paradigms are similar enough. So I'm confident that you'll become productive in no time.
Author at Zettelkasten.de • https://christiantietze.de/
Is the plugin system TypeScript-compatible? I guess the Javascript-compiled output would be...
GitHub. Erdős #2. CC BY-SA 4.0.
@ZettelDistraction The system doesn't perform any pre-processing step for you, only plain JavaScript (ES6, I believe? Need to check!). To get started, it all needs to be contained in 1 file, so for complex plugins, Babel or whatever needs to be used? Using
require(...)
to import files from the plugin bundle is on my list, but that's beyond a first version to do things withIf you're a TypeScript user, I'd eventually really like to explore how to make the workflow bearable. Delivering type annotations, for example.
Author at Zettelkasten.de • https://christiantietze.de/
The script I executed is a built-in one: "Statistics of All Tags":
It's done for quite some time (2022-08-06) and the plugin management window shows it's info:
Author at Zettelkasten.de • https://christiantietze.de/
The "Copy Settings as JavaScript" button is meant to kick-start development with a template that exposes all the inputs and outputs.
The mechanisms are a bit simple for now. If you selected all the options, you'd get this
Author at Zettelkasten.de • https://christiantietze.de/
Writing JavaScript code without any visual guidance is quite the challenge, I found. I'm spoiled
Luckily, to get rudimentary syntax highlighting for a well-known language like JavaScript to work requires just the inclusion of a couple of simple open source libraries, and things are much more readable:
Author at Zettelkasten.de • https://christiantietze.de/
Very nice.
GitHub. Erdős #2. CC BY-SA 4.0.