Creating āEditā Links That Open Plain-Text Source Files in a Native App
The setup for my notes blog looks like this:
- Content is plain-text markdown files (synced via Dropbox, editable in iA Writer on my Mac, iPad, or iPhone)
- Codebase is on GitHub
- Builds are triggered in Netlify by a Shortcut
I try to catch spelling issues and what not before I publish, but Iām not perfect.
I can proofread a draft as much as I want, but nothing helps me catch errors better than hitting publish and re-reading what I just published on my website.
If that fails, kind readers will often reach out and say āHey, I found a typo in your post [link].ā
To fix these errors, I will:
- Open iA Writer
- Find the post
- Fix typo
- Fire Shortcut to trigger a build
- Refresh my website and see the updated post
However, the āOpen iA Writerā and āFind the postā are points of friction Iāve wanted to optimize.
Iāve found myself thinking: āWhen Iām reading a post on notes.jim-nielsen.com and I spot a mistake, I wish I could just click an āEditā link right there and be editing my file.ā
You might be thinking, āYeah thatās what a hosted CMS does.ā
But I like my plain-text files. And I love my native writing app.
Whatās one to do?
Well, turns out iA Writer supports opening files via links with this protocol:
ia-writer://open?path=location:/path/to/file.md
So, in my case, I can create a link for each post on my website that will open the corresponding plain-text file in iA Writer, e.g.
<article>
<!-- content of post here -->
<a href="ia-writer://open?path=notes:2026-01-04T2023.md">
Edit
</a>
</article>
And voilĆ , my OS is now my CMS!
Itās not a link to open the post in a hosted CMS somewhere. Itās a link to open a file on the device Iām using ā cool!
My new workflow looks like this:
- Read a post in the browser
- Click āEditā hyperlink to open plain-text file in native app
- Make changes
- Fire Shortcut to trigger a build
It works great. Hereās an example of opening a post from the browser on my laptop:
And another on my phone:
Granted, these āEditā links are only useful to me. So I donāt put them in the source markup. Instead, I generate them with JavaScript when itās just me browsing.
How do I know itās just me?
I wrote a little script that watches for the presence of a search param ?edit=true. If that is present, my site generates an āEditā link on every post with the correct href and stores that piece of state in localstorage so every time I revisit the site, the āEditā links are rendered for me (but nobody else sees them).
Well, not nobody. Now that I revealed my secret I know you can go get the āEditā links to appear. But they wonāt work for you because A) you donāt have iA Writer installed, or B) you donāt have my files on your device. So hereās a little tip if you tried rendering the āEditā links: do ?edit=false to turn them back off :)