Category Archives: Mac

Looking for YAML macOS QuickLook file previews? With PreviewYaml 1.0.0, you got ’em!

Last week I announced the release of a new version of PreviewMarkdown that will preview YAML front matter in Markdown files. Work on that release prompted me to code a new app that enables QuickLook previews and Finder icon thumbnails of YAML files.

QuickLook previews and icon thumbnails of YAML files can now be yours

I have a quite few YAML files that configure a number of projects, mostly websites built using the Hugo static-site generator, and it’s really handy to be able to select one in Finder and quickly view its contents just by hitting space. Thumbnails are nice to see too, but for me it’s the QuickLook preview functionality that I most value because it saves me a heck of lot of time opening files in an editor just to read a line or two — or even just see if this is the file I’m looking for.

With PreviewYaml, I can now tell in a moment.

A typical YAML file preview

PreviewYaml works just like PreviewMarkdown: it’s a host app that makes preview preferences accessible and a pair of app extensions that are called by Finder when you ask for a preview, or open a window containing one or more .yaml files. If you try it yourself, you need to run the app to register the extensions with macOS, and to apply any particular settings you want, such as preview font and size, the colour of keys so they stand out from their values, how much indentation you prefer, and whether bad YAML is displayed in the preview its raw form or ignored.

Apply preview settings in the main app

You can also use the main app to submit feedback and bug reports, and you can check out the app’s known issues. These are under investigation, but I think will only affect a very, very small number of users. But please let me know if I’m wrong in that assumption!

PreviewYaml is available from the Mac App Store for a very modest consideration, and the core source can be viewed on GitHub.

Further Reading

Now available: PreviewMarkdown 1.3.0 with YAML support

Version 1.3.0 of PreviewMarkdown has just been released. Its key new feature: you now have the option to view YAML front matter in Markdown file previews. This is really handy if, like me, you use a static site generator and use YAML to record content metadata at the top of your Markdown page files.

With PreviewMarkdown 1.3.0, you can now preview files’ YAML content too
Continue reading

Take advantage of Xcode’s hidden diagnostics to debug multi-threaded application code

PreviewMarkdown’s Thumbnailer component, an App Extension which generates Finder icon thumbnail previews of Markdown documents, recently started showing some odd behaviour. Tracking down the cause provided some interesting insights into writing macOS software for a multi-threaded environment.

Thumbnailer-rendered thumbnails
Continue reading

How to use zmv — Z Shell’s super-smart file renamer

I’d like to introduce you — if you’re not already acquainted — to the Z Shell’s incredibly handy function zmv. If you ever need to change at the command line the names of a batch of files consistently, it’s the tool you’ll want to turn to first. It’s not well known, and having been given the nod by a colleague, I thought I’d explore and pass on some notes about taking advantage of it.

Continue reading

How to share preferences between macOS/iOS apps

A couple of macOS releases or so ago, Apple introduced app extensions: self-contained modules that are bundled within apps to deliver functionality to the wider operating system. But how do apps and their extensions share information between themselves, in particular users’ preferences?

PreviewMarkdown’s new Preferences sheet
Continue reading

How to migrate to native Homebrew on an M1 Mac

Let the great Homebrew migration begin. Yes, Homebrew now has native support for Apple’s ARM64-based M1 chip. The latest version, 3.0.0, released 5 February, will run nicely on your Apple Silicon Mac. There’s a catch, of course. Well, several catches: first, not all of the tools you can install using Homebrew are M1 native yet and, second, Homebrew doesn’t offer explicit migration instructions, that I could find at least.

Apple Silicon Mac, now with native Homebrew support
Continue reading

A first look at a MicroPython marvel: the Raspberry Pi Pico, in partnership with a Mac

On Thursday morning I awoke to the news that the Raspberry Pi people have entered the microcontroller board market with a new product, the Raspberry Pi Pico. Before I’d even got out of bed, I ordered a couple. Well, at £3.60 a pop, why not? I’ve now had a chance for a quick play, and here are my findings.

The Raspberry Pi Pico
“Yeah, I know it — it’s on Pico…”
Continue reading

Oi, app makers, no! Enough Markdown monkey business!

PreviewMarkdown, my modern QuickLook plug-in for Markdown files, was recently updated to version 1.1.4. It was a minor change, which is why it wasn’t announced here, but the reason for the update may interest to anyone keen to understand the workings of macOS. It also highlights some inconsiderate behaviour on the part of some Mac software developers.

PreviewMarkdown, the markdown file viewer
PreviewMarkdown relies on known Markdown file UTIs
Continue reading