smittytone / PreviewCode

QuickLook source code preview and icon thumbnailing app extensions for macOS Catalina and beyond
https://smittytone.net/previewcode
MIT License
41 stars 3 forks source link
extensions macos preview-generator quicklook swift thumbnail-generator

PreviewCode 1.3.3

PreviewCode provides macOS QuickLook file previews and Finder icon thumbnails for more than 50 programming and scripting languages, header files, and data files.

It is not exhaustive, nor is it intended to be. It is, however, intended to support the most popular languages used by Mac-based developers, whether for use on a Mac or on other platforms.

PreviewCode App Store QR code

Installation and Usage

Just run the host app once to register the extensions — you can quit the app as soon as it has launched. We recommend logging out of your Mac and back in again at this point. Now you can preview source code files using QuickLook (select an icon and hit Space), and Finder’s preview pane and Info panels.

You can disable and re-enable the Code Previewer and Code Thumbnailer extensions at any time in System Preferences > Extensions > Quick Look.

Adjusting the Preview

Open the main app and click on Show Preview Preferences, or select Preferences... from the PreviewCode menu.

You can select from a range of text sizes, choose a monospace font, select the font’s style — regular, bold, italic, etc. — choose your preferred line spacing, and pick which theme you would like previews to use. One hundred themes are included, and you can view all of them, or just dark or light ones.

PreviewCode will allow you to select a dark theme or a light one. These will be applied whatever UI mode your Mac is set to. If you select auto mode, you choose two themes, one light, the other dark. These will be applied automatically based on the current UI mode.

Languages

Compiled Languages

Shell Scripting

Assembly

Others

Known Issues

Source Code

This repository contains the primary source code for PreviewCode. Certain graphical assets, code components and data files are not included. To build PreviewCode from scratch, you will need to add these files yourself or remove them from your fork.

The files REPLACE_WITH_YOUR_FUNCTIONS and REPLACE_WITH_YOUR_CODES must be replaced with your own files. The former will contain your sendFeedback(_ feedback: String) -> URLSessionTask? function. The latter your Developer Team ID, used as the App Suite identifier prefix.

You will need to generate your own Assets.xcassets file containing the app icon, app_logo.png and theme screenshots.

You will need to create your own new directory containing your own new.html file.

Acknowledgements

PreviewCode makes use of HighlighterSwift which provides a Swift wrapper for Highlight.js and is derived from Highlightr.

Release Notes

Copyright and Credits

Primary app code and UI design © 2024, Tony Smith.

Code portions © 2016 Juan Pablo Illanes.
Code portions © 2006-22 Ivan Sagalaev.