A tool to generate YAML QuickLook previews for macOS Catalina and up

Latest Release: 1.0.1

 New Version

 

How to Use PreviewYaml

Install the app and run it. This will register the availability of the app’s QuickLook extensions, Yaml Previewer and Yaml Thumbnailer. You can now quit the app: just click OK:

The PreviewYaml app UI

To use QuickLook in Finder, select a YAML file — one with the extension .yaml, for example — and press space. This will pop up a rendered preview of the file:

A PreviewYaml sample

You will also see YAML file previews in Finder’s preview pane, enabled using View > Show Preview or by hitting Cmd-Shift-P, and in the Preview: section of Finder’s file info panel (select a file and hit Cmd-I).

You can disable or re-enable Yaml Previewer and/or Yaml Thumbnailer in System Preferences > Extensions:

Control PreviewYaml extensions in System Preferences, Extensions

For some background information on how Catalina delivers QuickLook previews, you might like to read this blog post.


Customise the Preview

Open the Preferences panel from the main app’s PreviewYaml menu. This allows you to adjust some of the key elements of the preview:

  • The colour of mapping keys.
  • The preview’s font.
  • The preview’s text size.
  • The level of indentation.
  • Whether previews should be displayed white-on-black even in macOS Dark Mode.
  • Whether previews should include raw YAML if rendering fails because the YAML was malformed.
  • Whether thumbnails should should feature a YAML file type tag.

The PreviewYaml app preferences

Changing these settings will affect previews straight away, but may not affect thumbnails until you open a folder that has not been previously opened during the current login session.


Feedback and Bug Reports

You can use the main app to submit feedback. Just click in the Send Feedback button in the main window, or select Report a Bug… from the Help menu:

The PreviewYaml app feedback mechanism

Please include your email address if you would like a response. I can’t respond without one. Please see the privacy policy for details of email address usage.


Troubleshooting

If it appears that either Yaml Previewer or Yaml Thumbnailer are not working after you have run the host app, please log out of your Mac and then log back in.

If PreviewYaml reports that it was unable to render YAML, this is almost certainly caused by a malformation of the YAML itself — the error message should help you spot the problem. PreviewYaml’s YAML library is quite strict, so YAML malformations which other apps allow may be rejected by PreviewYaml. For this reason, you can optionally tell PreviewYaml to display a file’s raw YAML in the event of a parsing error. This option is chosen in the Preferences panel and will allow you to QuickLook even bad YAML files, just without rendering.

Known Issues

PreviewYaml currently expects files to be encoded in UTF-8.

Certain YAML features, including custom tags, are not as yet correctly rendered by PreviewYAML.

A YAML file containing .nan, .inf and/or -.inf float values will prevent PreviewYAML from rendering the file, either as a preview or as a thumbnail. This issue is currently under investigation.


Enjoyed Using PreviewYaml?

If you have found PreviewYaml to be useful, please consider writing a positive review on the Mac App Store, or simply give it a rating.

Thank you!


Acknowledgements

PreviewYaml makes use of code from the following sources:

  • YamlSwift — Yaml-to-NSAttributedString conversion.

Source Code

You can view PreviewYaml’s source code at GitHub.


Release Notes

  • 1.0.1 17 June 2021
    • Add links to other PreviewApps.
    • Support macOS 11 Big Sur’s UTType API.
    • Stability improvements.
  • 1.0.0 11 May 2021
    • Initial public release.

Related Software


The Seal of RassilonThe Seal of Rassilon
Site and software copyright © 2021, Tony Smith