Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/oleander/ansi
Ansi parser written in Swift 3 for constructing NSAttributedStrings
https://github.com/oleander/ansi
Last synced: 2 months ago
JSON representation
Ansi parser written in Swift 3 for constructing NSAttributedStrings
- Host: GitHub
- URL: https://github.com/oleander/ansi
- Owner: oleander
- License: mit
- Created: 2017-05-05T21:17:59.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-13T22:50:14.000Z (over 7 years ago)
- Last Synced: 2024-11-18T03:15:54.255Z (2 months ago)
- Language: Swift
- Homepage:
- Size: 43 KB
- Stars: 14
- Watchers: 2
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ansi [![Status](https://travis-ci.org/oleander/Ansi.svg?branch=master)](https://travis-ci.org/oleander/Ansi)
Ansi parser written in Swift 3 for constructing `NSAttributedString`s. Currently supports 8 & 256 bit colors, italic, strikethrough, underline and bold text.
## Usage
```swift
import Ansilet attr = "ABC\\e[3;4;33mDEF\\e[0mGHI".ansified()
attr // => "ABC" + "DEF".italic.underline.yellow + "GHI"
attr.string // => "ABCDEF GHI"
```## Install
Add `pod 'Ansi'` to your `Podfile` and run `pod install`.