Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nkristek/highlight
A syntax highlighter for JSON data completely written in Swift with no dependencies
https://github.com/nkristek/highlight
hacktoberfest json nsattributedstring swift syntax-highlighting
Last synced: 6 days ago
JSON representation
A syntax highlighter for JSON data completely written in Swift with no dependencies
- Host: GitHub
- URL: https://github.com/nkristek/highlight
- Owner: nkristek
- License: mit
- Created: 2019-12-18T10:01:39.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-08T14:15:57.000Z (over 3 years ago)
- Last Synced: 2024-11-01T13:51:36.612Z (13 days ago)
- Topics: hacktoberfest, json, nsattributedstring, swift, syntax-highlighting
- Language: Swift
- Homepage:
- Size: 45.9 KB
- Stars: 37
- Watchers: 1
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Highlight
[![CI Status](https://github.com/nkristek/Highlight/workflows/CI/badge.svg)](https://github.com/nkristek/Highlight/actions)
This library provides a syntax highlighter which currently supports highlighting JSON data. It is fully written in Swift and there are no additional dependencies.
It uses a compatibility layer for colors and fonts for `UIKit` and `AppKit` and the default theme supports dark mode on both platforms.## Features
This library provides a `JsonSyntaxHighlightProvider` which can either be instanciated or accessed through a static instance `JsonSyntaxHighlightProvider.shared`.
It parses the given `String` and highlights the given `NSMutableAttributedString` by setting the color and font on specific areas.
## Installation
Currently supported methods of importing it:
- SwiftPM: https://github.com/nkristek/Highlight.git
- Manually copying all files in the [Sources](https://github.com/nkristek/Highlight/tree/master/Sources) folder## Contribution
If you find a bug feel free to open an issue. Contributions are also appreciated.