This week, at work I was listening to the latest episode of connected, and I heard Federico Viticci talking about Obsidian. The thing that intrigued me the most about it was the ability to write custom plugins. I love being able to make little changes to the services that I use, so this really sparked my interest.
I needed an idea to get into Obsidian, so I decided I would integrate it into my blogging platform. At first, I thought I could directly integrate it by just editing Quill to support reading from Markdown files, but I decided against that. Mostly because that would require me to rethink a big chunk of how it works. After some thinking, I decided it would be best if I created a custom plugin that allows me to upload my current Obsidian note right onto the blog.
I spent most of the morning looking at the sample project for Obsidian Plugins. This is a perfect example of what a sample project should be. It shows off what seems to be every feature of the Obsidian API that someone jumping into making plugins needs.
After I got the sample project downloaded and running using NPM I started developing. Since my idea is super simple it was actually fairly easy to implement, the hardest part was dealing with CORS, but once I figured out I can just place mode: "no-cors" into my fetch call everything was fixed. Once the Obsidian plugin was written I spent some time tweaking Quill, fixing bugs that popped up while doing this much work with it.
The plugin takes the current file's text and then parses it to extract the title and the date. Once these are extracted a form is constructed and then sent as a POST request to the Quill API. Then, Quill does its magic and the post is uploaded. It is not much different from when I would just email Quill, but it does remove the need for a Zapier integration and allow me to publish right from my text editor.