Made an Obsidian Plugin

For more than five years I’ve moved all my notes and documents – personal and professional – into Obsidian, a super-powerful app for organising and maintaining notes using markdown. I’m quite fanatical about the app. And now, I’ve written a plugin that I’ve just submitted be included in the Obsidian Community Plugins directory. It’s my first-ever bit of coding that I’ve felt I should share.

I moved to Obsidian after using OneNote from the year 2000 to keep my resources and notes as a teacher. I was an early adopter of OneNote when Microsoft first released its tablet pcs. Over the years I accumulated hundreds of “notebooks” filled with handwrtten notes, PDFs, images, audio files, videos. Then in about 2018 I tried to export one of my notebooks into another app and found that it was pretty much impossible to do so. That sent me down a rabbit hole of realising how trapped I’d let myself become by propriety software – including ones that claimed interoperability or easy export but didn’t make it at all possible. (I’d used Evernote and Apple Notes as well for personal stuff – but they were, admittedly easier to export from.) I learned that keeping notes in text files was about the most reliable and so, after trying out a range of apps, settled on Obsidian which was gaining popularity due to the ways in which it could be enhanced through plugins and themes.

My Obsidian vaults (the name given to the collections of notes made by the app) are synced between laptops, ipads and my phone using Syncthing which means I can acces and add to them anywhere. Because I keep my vaults synced like this, I’ve learned to keep my vaults lightweight and containing only text files. Which means that I self-host other media like images, PDFs and audio files separately. (I used to do this using OneDrive and the webhost here where I maintain my blog but now self-host off a server in my house.) Everything works excellently…

… Except that Obsidian embeds PDFs in notes only if they’re kept in the vault. There are workarounds that do things like creating virtual folders and symlinks – but they still require copying the PDFs to a local device. Images aren’t treated like that: you can keep them in your vault or you can embed them from whichever website they’re hosted. I embed lots of images and have tried to embed PDFs over the years with no success. I’ve had lots of conversations online with other Obsidian users who’ve told me that it’s not possible to embed a PDF from an external source. Stubbornly, I just couldn’t understand why it wasn’t possible if other media – including audio and video files – could. It was something that I just couldn’t let go.

So, after installing Paperless-NGX as a repository for all my documents in PDF, I decided to work on a way of embedding a PDF in an Obsidian note. I have a rudimentary knowledge of javascript, which is the language used for Obsidian plugins and began to write the code. Of course, it didn’t work. So I asked some AI tools for assistance in checking my code and suggesting improvements. The AIs were useful in picking out areas and suggesting ways that the plugin could be improved – though, several times, they sent me off on the wrong track. Eventually, the plugin sort of worked… until it sort of didn’t. I found that I needed to make sure that it could work on iOS – and that threw up a massive security issue because Apple don’t seem to like PDFs being embedded on mobile devices. Some sort of security issue that I don’t understand. Then, with a bit of recoding, I managed to get it working across all platforms I had access to: Windows, OSX, Linux and iOS. A little more recoding to enable PDFs to be embedded from local files on a device external to the Obsidian folder and it was pretty much finished.

So, what does my plugin, External PDF, actually do? It’s very simple and fills a hole in what I think should be basic functionality in Obsidian. It lets you embed a PDF hosted on a website in a note without having to download the PDF and save it in your vault. In your note, you just need to add something like this (with your link to the PDF document online, of course):

```external-pdf
https://example.com/document.pdf
```

…and the PDF will be visible in your note, embeded in a reader frame. There are options to include title, sizes and the ability to embed PDF files kept locally on your computer but not in your Obsidian vault. Even if no one else in the world is at all interested in embedding PDFs like this, it is something I’ve wanted to be able to do for a very long time. And now I can.

Just in case someone else is interested in this, I’ve put my plugin up on GitHub and submitted it to Obsidian to be included in their community plugins repo. While I realise this isn’t a big deal for someone who programs, it’s the first time I’ve made something like this that works and the first time in a long, long time that I’ve felt I’ve improved my tech knowledge.

Riverworld

From time to time I think about the books that I read when I was young. That they still have resonance all these years later and I can remember the profound effect that they had on my thinking and my imagination is testimony to their writing. Of course, novels like The Lord of the Rings…

Autechre, Artist in Residence

Thoroughly enjoyed an absorbing Radio 6 mix by Autechre (the first of four!) which was almost all new to me and has provided a wealth of music and musicians to follow up – particularly the startling hip hop tracks. The show is described as: Step into the genre-bending world of Autechre, the legendary duo whose…

Unwelcome Website Woes

THINGS haven’t been great with my blog over the last week or so. That’s an understatement. I’ve spent a great deal of time working out how to save all the content I’ve put up here for the last five years. I’ve maintained blogs of some sort or another since the late 1990s and more consistently…

Thomas Covenant, The Unbeliever

Another charity shop find! A mere £1 for the trilogy of Stephen Donaldson’s The Chronicles of Thomas Covenent, The Unbeliever. It’s a fantasy series started in the mid-1970s in that early wave of post-Toklien novels and I read the first volume way-way-back when I was in my middle-teens (recomended by the owner of Stargate One…

Book Evocation

A discussion about the merits of reading a physical book rather than a digital copy led to considerations about the way that books – like songs – are associated with a particular moment in time in memory. There’s some truth to this. I often recall the first copy of a selection of Thomas Hardy’s poetry…

The Book of Alien, 1979

Another find at our local Oxfam bookshop, The Book of Alien. Published in 1979 to accompany the release of the movie, it’s a behind-the-scenes account of the production with lots of art (mainly by Ron Cobb but also by Moebius and Chris Foss) and photos. There are sections on spaceship design, sets and spacesuits, the…

Another Thrilling Star Wars Adventure!

Love these (fake) book covers for the first three Star Wars movies in the style of sixties pulp paperbacks. Illustrator Russell Walks is amazing!

The Dead of Night

Bought for £1 at the local hospital’s League of Friends bookshop. Onions is one of the great twentieth-century ghost story writers. This volume does include The Beckoning Fair One which Robert Aickmam described as “one of the (possibly) six great masterpieces in the field”. There’s an intense, manic quality to Onions’ writing that is incredibly…

-2,147,483,648 Hours and 24 Minutes

Decided to reinstall OSX on the macbook air that I mostly use at home. I bought it in 2012 and, other than upgrading it to Catalina (which is as new as OSX will go without using OCLP) it’s always worked great. Over the years I’ve installed a lot of apps, fiddled with the settings and…

Weeknotes wb 16 September 2024

I have to admit that I’m struggling to maintain these weekly notes (though I will endeavour to do so). Mainly it’s that I’m over-thinking the detail and it’s taking me far too long to put the notes together. So here’s something shorter… The “Season of mists” is most definitely upon us and I’m waking to…

Radio Times Lord of the Rings Cover

Lovely piece from 2021 by Brian Sibley about the cover to the 7th March 1981 issue of Radio Times. Sibley writes about the illustration, Eric Fraser, and his acquistion of the original artwork. Much like Jimmy Coulty’s stunning 1976 poster illustration for the novel, Sibley’s BBC dramatisation which was originally aired between March and August…

Make Something to Your Taste

At the bottom of Jay Springett’s latest post, Destination Distraction, he’s added a short video, Make Something to Your Taste, his latest 301 Permanently Moved podcast episode, which caught me at exactly the right time. It’s a mesmerising video where Springett is convincing in reinforcing the importance of creativity and a call to “Make a…

Make Something to Your Taste

At the bottom of Jay Springett’s latest post, Destination Distraction, he’s added a short video, Make Something to Your Taste, his latest 301 Permanently Moved podcast episode, which caught me at exactly the right time. It’s a mesmerising video where Springett is convincing in reinforcing the importance of creativity and a call to “Make a…

The Hartnell Years

Picked up a copy of The Doctor Who Production Diary: The Hartnell Years by David Brunt. I’m in the middle of watching the first season of Doctor Who from 1963-4 and, while I make great use of both the first volume of About Time and The Television Companion – both of which I’ve owned for…

Agatha: A Tale of Three Witches

I’ve just backed Andrew MacLean’s Kickstarter project, Agatha: A Tale of Three Witches. It’s a prequel to MacLean’s fantastic quarterly series, Head Lopper, a comic I’ve bought from its first issue. (The last issue, #16, was released in 2021.) Anything Head Lopper gets an automatic “must buy” from me. There are a range of “rewards”…

Hüsker Dü Live

Spent a couple of hours today listening to some of the live recordings of Hüsker Dü that can be found on the Internet Archive. It’s a mixed bag: some pretty good ones that sound as if recorded at the mixing desk, while others are just muffled noise with the occasionally recognisable vocal. I can understand…

Love in Constant Spectacle, Jane Weaver

Have been listening to Jane Weaver’s Love in Constant Spectacle for a couple of weeks now. Such a carefully constructed, intimate and gentle album which builds a fragile melancholic voice over dreamy motorik beats. Weaver’s gentle psychedelic pastoralism (which is the best way I think I can describe it) is something I find incredibly appealing…

Bob Mould, Hüsker Dü, Sugar

It must be the general mood I’m in at the moment but among the albums I’ve been sorting through in my never-ending organisation of my music library have been (last week) Hüsker Dü and (today) Bob Mould and Sugar. I originally got into Hüsker Dü back in in my teens in the 1980s when I…

Rock Bottom, Robert Wyatt

My attention in music recently has shifted again towards the early 1970s to the post-psychedelic stuff produced by musicians loosely grouped as the Canterbury Scene. My tastes in pyschedelia have always been in the slightly-folksy English pastoral strain which has brought me via Soft Machine and Matching Mole to Robert Wyatt’s stunning 1974 album, Rock…

Who and Hobbit

In other news, I went looking in local charity shops for a copy of Susanna Clarke’s Jonathan Strange & Mr Norell, a novel I’ve read twice but don’t have a physical copy. No luck on that front but I did find a delightful hardback of The Hobbit (I have the paperback version so this is…

Dual-booting Noble Numbat

Installed the 24.04 LTS release of Ubuntu, Noble Numbat, on Macbook so it dual boots with Sonoma (itś actually a 10 year-old Macbook Pro using OCLP to enable latest version of OSX to run). The only part of getting Ubuntu to dual boot was the actual dual booting itself. All the resizing of partitions and…

English: “ill-thought-through changes”

Brief – but valid – Guardian editorial calling for changes to English teaching. “Too much of what is valuable about studying English was lost in the educational reforms of the past 14 years,” the paper says and that “ill-thought-through changes, which imposed a model more suited to science and maths learning on to the quite…