Git Product home page Git Product logo

previewcode's Introduction

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

  • ActionScript (.actionscript)
  • Ada (.ads, .adb)
  • AppleScript (.applescript)
  • Arduino (.arduino, .ino)
  • Basic (.basic, .bas)
  • Brainfuck (.brainfuck, .b, .bf)
  • C (.c, .h)
  • C++ (.cpp, .hpp)
  • C# (.csx, .cs, .c-sharp, .csharp)
  • Clojure (.clojure, .clj, .cljc, .cljs)
  • CoffeeScript (.coffee, .coffeescript, .litcoffee)
  • Dart (.dart)
  • Elixir (.elxir, .ex, .exs)
  • Elm (.elm)
  • Erlang (.erlang, .erl, .hrl)
  • Fortran (.for)
  • F# (.fsharp, .f-sharp, .fsi, .fsx, .fsscript)
  • Go (.go)
  • GameMaker Language (.gml)
  • Haskell (.haskell, .hs, .lhs)
  • Java (.java)
  • JavaScript (.js)
  • Julia (.julia, .jl)
  • Kotlin (.kotlin, .kt, .ktm, .kts)
  • Lisp (.lisp, .lsp, .fasl)
  • Lua (.lua)
  • Objective-C (.m)
  • Pascal (.pas)
  • Perl (.perl)
  • PHP (.php)
  • Python (.py)
  • Ruby (.rb)
  • Rust (.rs, .rust)
  • Swift (.swift)
  • TypeScript (.typescript, .tsx)
  • Visual Basic Script (.vbscript, .vbe, .vbs, .wsc, .wsf)
  • Vue.js (.vue)

Shell Scripting

  • Bash (.sh)
  • C Shell (.csh)
  • Korn Shell (.ksh)
  • TCSH (.tsch)
  • Z Shell (.zsh)

Assembly

  • ARM Assembler (.s)
  • x86-64 Assembler (.asm, .nasm)

Others

  • AsciiDoc (.asciidoc, .adoc, .asc)
  • Config files (.conf, .cf, .cfg, .ini, .rc)
  • Cmake files (.cmake)
  • CSS (.css)
  • Environment (.env)
  • LaTex (.latex, .tex)
  • Makefiles (makefile)
  • Apple Property list files (.plist)
  • Apple Entitlements files (.entitlements)
  • Apple Xcode NIB files (.xib)
  • Apple Xcode storyboard files (.storyboard)
  • Protobuf (.proto)
  • SASS/SCSS (.scss, .sass)
  • SQL script (.sql)
  • Terraform source file (.tf, .terraform)
  • Terraform variable file (.tfvars)
  • Twig (.twig)

Known Issues

  • PreviewCode will not render Clojure .edn files. This is because the .edn file extension is pre-set on macOS to an Adobe digital rights management product.
  • PreviewCode will not render TypeScript .ts files. This is because the .ts file extension is pre-set on macOS to MPEG-2 transport stream video files. The .tsx and .typescript extensions are supported.
  • PreviewCode will not render Elixir .exs files if GarageBand and/or Logic Pro is installed on your Mac. This is because these apps use this file extension for EXS24 instrument files.
  • Previews displayed on external displays, or on Macs with connected to multiple monitors, may intermittently not be scrollable if you’re using a third-party mouse. Workaround: a MacBook’s built-in trackpad will be able to scroll.
  • Deselecting code in the preview is not immediate: the highlight clears after ~1s. We are investigating fixes.

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

  • 1.3.3 13 May 2024
    • Revise thumbnailer to improve memory utilization and efficiency.
  • 1.3.2 15 November 2023
    • Add the com.microsoft.typescript UTI.
    • Fix missing What’s New dialog.
    • Fix What’s New dialog ‘white flash’ in dark mode.
  • 1.3.1 14 August 2023
    • Non-shipping release: repo/code reorganisation.
  • 1.3.0 31 May 2023
    • Support automatic dark/light theme application by macOS UI mode.
    • Add line spacing control.
  • 1.2.7 31 March 2023
    • Support .elm Elm files.
    • Stop PreviewCode attempting to preview .scpt binary applescript files.
    • Under-the-hood improvements
  • 1.2.6 18 March 2023
    • Allow text to be selected in previews.
    • Support .gml GML (GameMaker Language) files.
    • Support .vue Vue.js files.
    • Support .entitlements, .xib, .storyboard Xcode files.
    • Update to use HighlighterSwift 1.1.1.
  • 1.2.5 21 January 2023
    • Add link to PreviewText.
    • Better menu handling when panels are visible.
    • Better app exit management.
  • 1.2.4 14 December 2022
    • Add com.microsoft.c-sharp UTI.
    • Support makefiles.
  • 1.2.3 2 October 2022
  • 1.2.2 26 August 2022
    • Add public.lua-script UTI.
    • Support XML .plist files.
    • Initial support for non-utf8 source code file encodings.
  • 1.2.1 7 August 2022
    • Support the .cs C# extension.
    • Fix ARM assembly file display.
    • Fix operation of Preferences’ font style popup.
  • 1.2.0 26 April 2022
    • Update to use HighlighterSwift 1.1.0.
    • Support environment .env files.
    • Support CMake .cmake files.
    • Support Terraform variable .tfvars files.
    • Support AsciiDoc .adoc, .asciidoc and .asc files.
    • Support .conf, .cf, .cfg, .ini and .rc config files
    • Fix Haskell .hsl extension.
    • Fix x86 .nasm preview.
    • Change ActionScript supported extension to .actionscript to avoid clash with AppleSingle .as.
    • Remove Lisp .cl — clash with OpenCL source.
    • Remove Lisp .l — clash with Lex source.
    • Remove F# .fs — clash with OpenGL Fragment Shader source.
    • Remove Dylan .dylan and .lid extensions.
  • 1.1.1 19 November 2021
    • Support HashiCorp Terraform .tf files.
    • Disable file-type thumbnail tags under macOS 12 Monterey to avoid clash with system-added tags.
  • 1.1.0 28 July 2021
    • Improved font selection code.
    • Separate font style selection.
    • Accelerate loading of the Preferences panel, especially on Intel Macs.
    • Code streamlining.
    • Fixed a rare bug in the previewer error reporting code.
    • Apple wants links to other apps to be App Store links. So be it. What Apple wants, Apple gets.
  • 1.0.0 16 June 2021
    • Initial public release.

Copyright and Credits

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

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

previewcode's People

Contributors

smittytone avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

previewcode's Issues

Add complete support for .NET files

You should add support for these text files that are very used in every middle-to-big .NET project:

  • .csproj (fundamental!)
  • .sln (fundamental!)
  • .nuspec
  • .props
  • .target
  • .config

File-type Requests

Requests to include textual file types and extensions are welcome and should be made as a comment in this thread.

Please include any existing macOS UTIs (eg. public.text.markdown) for each of the request extensions and list any macOS applications you currently use to edit or view these applications. Please provide sample file content.

Thank you!

PS. Priority will be given to macOS development/scripting files, but I will consider files relevant only to other operating systems if they might be viewed on a Mac.

Need a setting for preferred theme as per time of day

As of right now, there seems to be only one global theme in the previewer preferences. But it would be greatly appreciated if there would be two theme options - one for dark and another for light- so it changes with time of the day for users who have set their macOS theme to be automatic, which switches from light to dark with reference to time.

Without it, the system looks inconsistent with certain files opening in light theme (how macOS handles the previews) and others (code) always opening with a dark theme.

Other than this, I'd just like to thank for the wonderful app that's open-source and on the app-store. Takes the pain away of inability of installing un-notarized apps or dealing with privacy policy of similar proprietary apps.

Some extensions/files that could be added for the code preview.

Hi, I just bought your extensions, and of course, I have a request :)

Could you please add those standard Go files to be previewed?

  • go.mod
  • go.sum
  • go.work

And probably (which actually is YAML though):

  • Dockerfile (yam)
  • Earthfile (YAML / that would be great, as I use them a lot)

NOTE: I have no idea if it is possible to add those, especially the later ones.

The project includes files from OneDrive.

PreviewCode.xcodeproj/project.pbxproj

110:		3BFBEC372663FDD400B4E70C /* new */ = {isa = PBXFileReference; lastKnownFileType = folder; name = new; path = "../../../Library/CloudStorage/OneDrive-Personal/Programming/PreviewCode/new"; sourceTree = "<group>"; };
114:		3BFD78192663E16E002AD588 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = "/Users/smitty/Library/CloudStorage/OneDrive-Personal/Programming/PreviewCode/Assets.xcassets"; sourceTree = "<absolute>"; };
131:		3BFD785B2663E38F002AD588 /* Secrets.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = Secrets.swift; path = "../../../Library/CloudStorage/OneDrive-Personal/Programming/mnu/Secrets.swift"; sourceTree = "<group>"; };

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.