First, I’ve created a repo for SearchLink plugins. This is mostly going to be example code, but you might find some useful ones in there. If you’ve never checked out SearchLink and do any kind of writing that requires linking to web sites/pages, app landing pages, Gist embeds, or basically any kind of blogging, web writing, or show notes, you should check it out.
One thing I wanted to explore was using SearchLink for more than just searches. I created a couple proofs of concept as plugins. Some of these make more sense as TextExpander snippets, but I wanted to experiment, so here’s what I came up with.
This plugin is a text filter that will turn
!mix A string of text into
A STRInG of TExT, randomly capitalizing characters. It’s just to demonstrate how easily a text filter can be implemented (if you know a little Ruby, anyway).
Another example of a text filter. This one can insert a Markdown calendar for any month and year. You can define the month and year like
!cal 5 2024 to get a calendar for May, 2024. If you use
!cal now it will insert a calendar for the current month and year. It can also print how many days are in a month with
!days 2 2024 to show how many days are in February in 2024. Silly, and again would probably be better as a TextExpander snippet, but I’m just experimenting with extending SearchLink.
This is a port of a TextExpander snippet I use. It takes a natural language date and inserts a formatted date. It provides the following formats:
||Thursday, November 2nd, 2023 at 8:00am|
All of the searches can be abbreviated to two letters, with
This plugin requires that PHP be installed on the system, either with the Apple Command Line Utilties (I think), or with Homebrew (
brew install php).
Use the fully-commented code in
lyrics.rb (documented in the SearchLink wiki) to generate your own plugins, and reference the existing searches for inspiration. Feel free to fork and submit a PR to the plugin repository if you create something you’d like to share!