Highlightr is an iOS & macOS syntax highlighter built with Swift. It uses highlight.js as it core, supports 185 languages and comes with 89 styles. Takes your lame string with code and returns a NSAttributtedString with proper syntax highlighting. CocoaPods is a dependency manager for Cocoa projects. Carthage is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. Yes, Highlightr relies on iOS & macOS JavaScriptCore to parse the code using highlight.js. This is actually quite fast! It will never be as fast as a native solution, but it's fast enough to be used on a real-time editor. It comes with a custom-made HTML parser for creating NSAttributtedStrings, is pre-processing the themes, and is preloading the JS libraries. As result it's taking around of 50 ms on my iPhone 6s for processing 500 lines of code.

Features

  • Highlightr relies on iOS & macOS JavaScriptCore to parse the code using highlight.js
  • It will never be as fast as a native solution, but it's fast enough to be used on a real time editor
  • It comes with a custom made HTML parser for creating NSAttributtedStrings, is pre-processing the themes and is preloading the JS libraries
  • Highlightr is available under the MIT license
  • Requires iOS 8.0+
  • Supports macOS 10.10+

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow Highlightr

Highlightr Web Site

Other Useful Business Software
Your top-rated shield against malware and online scams | Avast Free Antivirus Icon
Your top-rated shield against malware and online scams | Avast Free Antivirus

Browse and email in peace, supported by clever AI

Our antivirus software scans for security and performance issues and helps you to fix them instantly. It also protects you in real time by analyzing unknown files before they reach your desktop PC or laptop — all for free.
Free Download
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of Highlightr!

Additional Project Details

Operating Systems

Android, Apple iPhone

Programming Language

Swift

Related Categories

Swift Source Code Analysis Tool

Registered

2023-06-21